Deploying a Cocoon 2.2 webapp in Tomcat 6.0.20

2010-10-04 Thread Florian Schmitt
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


javax.servlet
servlet-api
2.5


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
04.10.2010 11:27:46 org.apache.catalina.core.ApplicationContext log
INFO: HTMLManager: list: Listing contexts for virtual host 'localhost'
04.10.2010 11:28:03 org.apache.catalina.core.StandardContext listenerStart
SCHWERWIEGEND: Error configuring application listener of class 
org.springframework.web.util.WebAppRootListener
java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:296)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1314)
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1245)
at 
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3877)
at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at 
org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:123)
at 
org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:145)
at java.security.AccessController.doPrivileged(Native Method)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:769)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:902)
at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:525)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1340)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at 
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
at 
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at 
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at 
org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1473)
at 
org.apache.catalina.manager.HTMLManagerServlet.doPo

Deploying a Cocoon 2.2 webapp in Tomcat 6.0.20

2010-10-04 Thread Florian Schmitt
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


javax.servlet
servlet-api
2.5


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
04.10.2010 11:27:46 org.apache.catalina.core.ApplicationContext log
INFO: HTMLManager: list: Listing contexts for virtual host 'localhost'
04.10.2010 11:28:03 org.apache.catalina.core.StandardContext listenerStart
SCHWERWIEGEND: Error configuring application listener of class 
org.springframework.web.util.WebAppRootListener
java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:296)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1314)
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1245)
at 
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3877)
at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at 
org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:123)
at 
org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:145)
at java.security.AccessController.doPrivileged(Native Method)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:769)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:902)
at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:525)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1340)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at 
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
at 
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at 
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at 
org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1473)
at 
org.apache.catalina.manager.HTMLManagerServlet.doPo

Re: Deploying a Cocoon 2.2 webapp in Tomcat 6.0.20

2010-10-04 Thread Florian Schmitt
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

2010-10-04 Thread Florian Schmitt
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

2010-10-05 Thread Florian Schmitt
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