Re: Deploying a Cocoon 2.2 webapp in Tomcat 6.0.20
Barbara / Christopher / Robby, thanks again for your help - finally i found out that my jre installation was messed up, so the problems were caused by a corrupt jre classpath config, not by tomcat or cocoon (i didn't expect that since other java apps and tomcat webapps were running fine and didn't show any errors). florian - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
RE: Deploying a Cocoon 2.2 webapp in Tomcat 6.0.20
Some hints: *) When you run mvn jetty:run you don't have a WebapplicationContext in your url so you can address it like http://localhost:/block/ However, when you deploy the warfile in tomcat you do have a webapplicationContext so it will become something like http://localhost:8080/mywebapp/block/ *) Did you make sure you have declared a dependency on the block in your webapp project? *) It's best to disable the reloading classloader when deploying as a war. Use it only while developing for quick prototyping Kind regards, Robby Pelssers -Oorspronkelijk bericht- Van: fls...@googlemail.com namens Florian Schmitt Verzonden: ma 4-10-2010 12:59 Aan: users@cocoon.apache.org Onderwerp: Deploying a Cocoon 2.2 webapp in Tomcat 6.0.20 Hi, i'm quite new regarding cocoon 2.2 and i'm stuck trying to deploy a Cocoon 2.2 webapp in Tomcat 6.0.20. I've spent two days googling, going through the tutorials at cocoon.apache.org and the nice article at http://www.csparks.com/cocoon/c22without, but without any success. I followed those steps to create a minimal webapp : - create a new dir for the complete webapp == create a new block: - in that new dir, run mvn archetype:generate -DarchetypeCatalog=http://cocoon.apache.org; - select 2 to create a block, enter groupId, artifactId block, version and package - change to block subdir created by maven, run mvn install to build and install block in repo; == create a new webapp - change back to parent dir - run mvn archetype:generate -DarchetypeCatalog=http://cocoon.apache.org; again - select 3 to create a webap, enter same groupId, artifactId webapp, same version and same package with new artifactId appended - modified webapp/pom.xml to add the block dependency; - change to package subdir created by maven, run mvn package jetty:run to build webapp and test it using Jetty; - open http://localhost:/block/ - works :-) == deploy it in tomcat - open Tomcat manager app, select webapp/target/webapp-1.0.0.war, hit deploy; - Tomcat replies OK, displaying webapp-1.0.0 as deployed but not started; starting manually fails. :-( - Tomcat log contains the stacktrace attached. I found some hints online regarding class loaders, but i'm not experienced enough to fix this on my own. I tried to add dependency groupIdjavax.servlet/groupId artifactIdservlet-api/artifactId version2.5/version /dependency to webapp/pom.xml because it seems that Tomcat can't find the javax.servlet.ServletContextListener class, but that didn't help. Are there any step i missed? TIA for any help! florian winmail.dat - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: Deploying a Cocoon 2.2 webapp in Tomcat 6.0.20
I had similar problem. I fixed it by adding: filter filter-namespringRequestContextFilter/filter-name filter-classorg.springframework.web.filter.RequestContextFilter/ filter-class /filter filter-mapping filter-namespringRequestContextFilter/filter-name url-pattern/*/url-pattern dispatcherFORWARD/dispatcher dispatcherREQUEST/dispatcher /filter-mapping to my application web.xml file. Barbara On 4 Oct, 2010, at 1:01 pm, Florian Schmitt wrote: Hi, i'm quite new regarding cocoon 2.2 and i'm stuck trying to deploy a Cocoon 2.2 webapp in Tomcat 6.0.20. I've spent two days googling, going through the tutorials at cocoon.apache.org and the nice article at http://www.csparks.com/cocoon/c22without, but without any success. I followed those steps to create a minimal webapp : - create a new dir for the complete webapp == create a new block: - in that new dir, run mvn archetype:generate -DarchetypeCatalog=http://cocoon.apache.org; - select 2 to create a block, enter groupId, artifactId block, version and package - change to block subdir created by maven, run mvn install to build and install block in repo; == create a new webapp - change back to parent dir - run mvn archetype:generate -DarchetypeCatalog=http://cocoon.apache.org again - select 3 to create a webap, enter same groupId, artifactId webapp, same version and same package with new artifactId appended - modified webapp/pom.xml to add the block dependency; - change to package subdir created by maven, run mvn package jetty:run to build webapp and test it using Jetty; - open http://localhost:/block/ - works :-) == deploy it in tomcat - open Tomcat manager app, select webapp/target/webapp-1.0.0.war, hit deploy; - Tomcat replies OK, displaying webapp-1.0.0 as deployed but not started; starting manually fails. :-( - Tomcat log contains the stacktrace attached. I found some hints online regarding class loaders, but i'm not experienced enough to fix this on my own. I tried to add dependency groupIdjavax.servlet/groupId artifactIdservlet-api/artifactId version2.5/version /dependency to webapp/pom.xml because it seems that Tomcat can't find the javax.servlet.ServletContextListener class, but that didn't help. Are there any step i missed? TIA for any help! florian stacktrace2.txt - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: Deploying a Cocoon 2.2 webapp in Tomcat 6.0.20
Hi Barbara / Robby, thanks both of you for the quick reply - and sorry for originally posting my question twice! Sadly, your hints didn't help me solving the issue. @Robby: - i think it's not a webapp context issue - tomcat refuses to start the wepapp, so no context (neither the webabb nor the block) is accesible; - the block dependency is declared in the pom, and maven doesn't complain on mvn package, so i think this isn't the problem, too; - how to disable the reloading classloader? I'm not sure, but after reading http://cocoon.apache.org/2.2/maven-plugins/maven-plugin/1.0/1297_1_1.html i think i have to enable it explicitly, so i don't know ho to disable it after i don't hae such a dependency declaration in my webapp pom.xml. @Barbara: Inserting the filter and the filter-mapping as proposed didn't change anything - tomcat still refuses to start that webapp, still the same stacktrace appears. I've checked the content of the web.xml in the packaged war to be sure that the change shows up there. Are there any other changes to apply to the standard webapp code? I tried the adding the filter to web.xml with both my own test app (involving a block, as described in my first post) and the cocoon22-classic-webapp from the cocoon whiteboard - both with the same result (Jetty works, Tomcat doesn't, same NoClassDefFoundError), both with and without the proposed filer/filter-mapping. mvn -v displays (just if it's a matter of the JRE / Tomcat version): Apache Maven 2.2.1 (rdebian-1) Java version: 1.6.0_20 Java home: /usr/lib/jvm/java-6-sun-1.6.0.20/jre Default locale: de_DE, platform encoding: UTF-8 OS name: linux version: 2.6.31-22-generic-pae arch: i386 Family: unix florian - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: Deploying a Cocoon 2.2 webapp in Tomcat 6.0.20
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Florian, On 10/4/2010 7:01 AM, Florian Schmitt wrote: i'm quite new regarding cocoon 2.2 and i'm stuck trying to deploy a Cocoon 2.2 webapp in Tomcat 6.0.20. Ok. I followed those steps to create a minimal webapp : Good. If you have a WAR file, then you should be done with the Cocoon-related steps. - Tomcat log contains the stacktrace attached. I found some hints online regarding class loaders, but i'm not experienced enough to fix this on my own. These issues can sometimes be complex: note that the server can't find javax/servlet/ServletContextListener, which is a pretty intrinsic class for a servlet container. I tried to add dependency groupIdjavax.servlet/groupId artifactIdservlet-api/artifactId version2.5/version /dependency to webapp/pom.xml because it seems that Tomcat can't find the javax.servlet.ServletContextListener class, but that didn't help. This is unlikely to help: Tomcat doesn't use pom.xml for anything: only Maven and the compilation/build steps use it. If your code has complied properly, then your pom.xml should be good to go. Can you tell us how you installed Tomcat? Please list the libraries in TOMCAT_HOME/lib and also (all) the libraries in your WAR file's WEB-INF/lib directory. It might also be a good idea to cross-post to us...@tomcat.apache.org. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkyp8ecACgkQ9CaO5/Lv0PCn/wCgtXHghVzdRxZtY56R6h3Ju7jJ xuAAn3nCXbKzWJDiKvPWnvkY0qxVjOCU =K0FI -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: Deploying a Cocoon 2.2 webapp in Tomcat 6.0.20
Hi Barbara / Robby, thanks both of you for the quick reply - and sorry for originally posting my question twice! Sadly, your hints didn't help me solving the issue. @Robby: - i think it's not a webapp context issue - tomcat refuses to start the wepapp, so no context (neither the webabb nor the block) is accesible; - the block dependency is declared in the pom, and maven doesn't complain on mvn package, so i think this isn't the problem, too; - how to disable the reloading classloader? I'm not sure, but after reading http://cocoon.apache.org/2.2/maven-plugins/maven-plugin/1.0/1297_1_1.html i think i have to enable it explicitly, so i don't know ho to disable it after i don't hae such a dependency declaration in my webapp pom.xml. @Barbara: Inserting the filter and the filter-mapping as proposed didn't change anything - tomcat still refuses to start that webapp, still the same stacktrace appears. I've checked the content of the web.xml in the packaged war to be sure that the change shows up there. Are there any other changes to apply to the standard webapp code? I tried the adding the filter to web.xml with both my own test app (involving a block, as described in my first post) and the cocoon22-classic-webapp from the cocoon whiteboard - both with the same result (Jetty works, Tomcat doesn't, same NoClassDefFoundError), both with and without the proposed filer/filter-mapping. mvn -v displays (just if it's a matter of the JRE / Tomcat version): Apache Maven 2.2.1 (rdebian-1) Java version: 1.6.0_20 Java home: /usr/lib/jvm/java-6-sun-1.6.0.20/jre Default locale: de_DE, platform encoding: UTF-8 OS name: linux version: 2.6.31-22-generic-pae arch: i386 Family: unix florian - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
RE: Deploying a Cocoon 2.2 webapp in Tomcat 6.0.20
Normally your pom will have dependency on the servlet-api assuming it will be provided. dependency groupIdjavax.servlet/groupId artifactIdservlet-api/artifactId version2.4/version scopeprovided/scope /dependency Somehow this does not seem the case for you. Can you check if the {tomcat-home}/lib contains the servlet-api.jar? Robby -Oorspronkelijk bericht- Van: fls...@googlemail.com namens Florian Schmitt Verzonden: ma 4-10-2010 13:01 Aan: users@cocoon.apache.org Onderwerp: Deploying a Cocoon 2.2 webapp in Tomcat 6.0.20 Hi, i'm quite new regarding cocoon 2.2 and i'm stuck trying to deploy a Cocoon 2.2 webapp in Tomcat 6.0.20. I've spent two days googling, going through the tutorials at cocoon.apache.org and the nice article at http://www.csparks.com/cocoon/c22without, but without any success. I followed those steps to create a minimal webapp : - create a new dir for the complete webapp == create a new block: - in that new dir, run mvn archetype:generate -DarchetypeCatalog=http://cocoon.apache.org; - select 2 to create a block, enter groupId, artifactId block, version and package - change to block subdir created by maven, run mvn install to build and install block in repo; == create a new webapp - change back to parent dir - run mvn archetype:generate -DarchetypeCatalog=http://cocoon.apache.org; again - select 3 to create a webap, enter same groupId, artifactId webapp, same version and same package with new artifactId appended - modified webapp/pom.xml to add the block dependency; - change to package subdir created by maven, run mvn package jetty:run to build webapp and test it using Jetty; - open http://localhost:/block/ - works :-) == deploy it in tomcat - open Tomcat manager app, select webapp/target/webapp-1.0.0.war, hit deploy; - Tomcat replies OK, displaying webapp-1.0.0 as deployed but not started; starting manually fails. :-( - Tomcat log contains the stacktrace attached. I found some hints online regarding class loaders, but i'm not experienced enough to fix this on my own. I tried to add dependency groupIdjavax.servlet/groupId artifactIdservlet-api/artifactId version2.5/version /dependency to webapp/pom.xml because it seems that Tomcat can't find the javax.servlet.ServletContextListener class, but that didn't help. Are there any step i missed? TIA for any help! florian winmail.dat - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org