Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.1.1
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Testcase included:yes
Description
Since -nojars does not bundle any application specific dependency (See http://jira.codehaus.org/browse/GRAILS-5174), I created a script based on War.groovy, which creates the WAR file with plugins and any application specific jars but NOT the grails dependencies. This is so that the WAR size is small. The grails dependencies are copied to tomcat6/shared/lib (everything from $GRAILS_HOME/lib and $GRAILS_HOME/dist). However when tomcat is started and the war file (Attached with this issue) is deployed it gives this error and deployment fails:
I am attaching the war file which is from petclinic sample of grails 1.1.1 and the script to create the WAR. To use the script, copy it to $GRAILS_HOME/lib and type grails shared-war inside petclinic sample directory
Oct 1, 2009 8:17:17 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.14
Oct 1, 2009 8:17:18 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Oct 1, 2009 8:17:18 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Oct 1, 2009 8:17:18 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/21 config=null
Oct 1, 2009 8:17:18 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1336 ms
Oct 1, 2009 8:17:58 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive pet.war
Oct 1, 2009 8:18:00 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Oct 1, 2009 8:18:00 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/pet] startup failed due to previous errors
-
Hide
- pet.war
- 01/Oct/09 3:27 PM
- 3.77 MB
- Vivek Pandey
-
- META-INF/MANIFEST.MF 0.1 kB
- WEB-INF/applicationContext.xml 2 kB
- WEB-INF/.../BootStrap$_closure1.class 5 kB
- WEB-INF/.../BootStrap$_closure1_closure3.class 3 kB
- WEB-INF/.../BootStrap$_closure2.class 3 kB
- WEB-INF/classes/BootStrap.class 5 kB
- WEB-INF/.../Config$_run_closure1.class 3 kB
- WEB-INF/.../Config$_run_closure1_closure3.class 3 kB
- WEB-INF/.../Config$_run_closure2.class 4 kB
- WEB-INF/classes/Config.class 8 kB
- WEB-INF/.../DataSource$_run_closure1.class 3 kB
- WEB-INF/.../DataSource$_run_closure2.class 3 kB
- WEB-INF/.../DataSource$_run_closure3.class 3 kB
- WEB-INF/.../DataSource$_run_closure3_closure4.class 3 kB
- WEB-INF/.../DataSource$_run_closure3_closure4_closure7.class 3 kB
- WEB-INF/.../DataSource$_run_closure3_closure5.class 3 kB
- WEB-INF/.../DataSource$_run_closure3_closure5_closure8.class 3 kB
- WEB-INF/.../DataSource$_run_closure3_closure6.class 3 kB
- WEB-INF/.../DataSource$_run_closure3_closure6_closure9.class 3 kB
- WEB-INF/classes/DataSource.class 6 kB
- WEB-INF/.../HibernateGrailsPlugin$_closure1.class 3 kB
- WEB-INF/.../HibernateGrailsPlugin.class 7 kB
- WEB-INF/.../UrlMappings$__clinit__closure1.class 4 kB
- WEB-INF/.../UrlMappings$__clinit__closure1_closure2.class 3 kB
- WEB-INF/.../UrlMappings$__clinit__closure1_closure2_closure3.class 3 kB
- WEB-INF/classes/UrlMappings.class 4 kB
- WEB-INF/classes/application.properties 0.2 kB
- WEB-INF/.../ClinicController$_closure1.class 3 kB
- WEB-INF/.../ClinicController$_closure2.class 3 kB
- WEB-INF/classes/.../ClinicController.class 5 kB
-
- SharedWar.groovy
- 01/Oct/09 3:27 PM
- 12 kB
- Vivek Pandey
-
- stacktrace.log
- 01/Oct/09 4:09 PM
- 86 kB
- Vivek Pandey
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
It would be nice to support smaller war files that share libs so that multiple Grails war files can be deployed with a small memory footprint.
I get the same error in grails 2.1.1 when generating the war file with:
defaultDependenciesProvided true
in the BuildConfig.groovy file. All I did was copy the additional lib jar files found in a war file made with this set to false (default) into Tomcat /lib/ directory (there is no "shared/lib" in Tomcat 7).
Presumably, this should work; Grails is supposed to keep some jar files in the /lib/ dir of the war file even when defaultDependenciesProvided is true (it indeed has 20 jar files include many hibernate, jersey, and restlet files). This reduces the size of my war file to 8MB down from 30MB.
Attaching the grails generated stactrace.log file. Looks like grails can not instantiate HibernateGrailsPlugin.
2009-05-01 18:42:11,039 [main] ERROR StackTrace - Sanitizing stacktrace:
org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [HibernateGrailsPlugin]!
at org.codehaus.groovy.grails.commons.AbstractGrailsClass.newInstance(AbstractGrailsClass.java:106)
at org.codehaus.groovy.grails.commons.AbstractGrailsClass.<init>(AbstractGrailsClass.java:71)
at org.codehaus.groovy.grails.plugins.AbstractGrailsPlugin$GrailsPluginClass.<init>(AbstractGrailsPlugin.java:62)