You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Faw <fa...@gmail.com> on 2010/09/10 16:25:08 UTC

Deploy cocoon 2.2 in geronimo

I'm trying to make a cocoon 2.2 application using m2Eclipse (Maven plugin), I
created a block+webapp and created a war. When I try to deploy to geronimo
it says it deploys but it fails to start. The error I get (among a few, but
I think this is the one responsible) is 'Could not open ServletContext
resource [/WEB-INF/applicationContext.xml]' even though the file is in the
war. The full error message and stack trace is:

09:47:11,682 ERROR [ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: IOException
parsing XML document from ServletContext resource
[/WEB-INF/applicationContext.xml]; nested exception is
java.io.FileNotFoundException: Could not open ServletContext resource
[/WEB-INF/applicationContext.xml]
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341)
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
	at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
	at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
	at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
	at
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
	at
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
	at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
	at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
	at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
	at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
	at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
	at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
	at
org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:643)
	at
org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:189)
	at
org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:913)
	at
org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:584)
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:341)
	at
org.apache.geronimo.jetty7.handler.GeronimoWebAppContext.doStart(GeronimoWebAppContext.java:71)
	at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
	at
org.apache.geronimo.jetty7.WebAppContextWrapper.doStart(WebAppContextWrapper.java:323)
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:953)
	at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:269)
	at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:103)
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.start(GBeanInstance.java:525)
	at
org.apache.geronimo.gbean.runtime.GBeanDependency.attemptFullStart(GBeanDependency.java:110)
	at
org.apache.geronimo.gbean.runtime.GBeanDependency.addTarget(GBeanDependency.java:145)
	at
org.apache.geronimo.gbean.runtime.GBeanDependency$1.running(GBeanDependency.java:119)
	at
org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.fireRunningEvent(BasicLifecycleMonitor.java:175)
	at
org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.access$300(BasicLifecycleMonitor.java:44)
	at
org.apache.geronimo.kernel.basic.BasicLifecycleMonitor$RawLifecycleBroadcaster.fireRunningEvent(BasicLifecycleMonitor.java:253)
	at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:295)
	at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:103)
	at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:125)
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:539)
	at
org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:377)
	at
org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:456)
	at
org.apache.geronimo.kernel.config.KernelConfigurationManager.start(KernelConfigurationManager.java:190)
	at
org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:546)
	at
org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:527)
	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.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
	at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:130)
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:851)
	at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:237)
	at org.apache.geronimo.kernel.KernelGBean.invoke(KernelGBean.java:342)
	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.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
	at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:130)
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:851)
	at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:237)
	at
org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke(MBeanGBeanBridge.java:172)
	at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
	at
javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1426)
	at
javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
	at
javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1264)
	at java.security.AccessController.doPrivileged(Native Method)
	at
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1366)
	at
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
	at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
	at sun.rmi.transport.Transport$1.run(Transport.java:159)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
	at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
	at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.FileNotFoundException: Could not open ServletContext
resource [/WEB-INF/applicationContext.xml]
	at
org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:118)
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)
	... 78 more
-- 
View this message in context: http://apache-geronimo.328035.n3.nabble.com/Deploy-cocoon-2-2-in-geronimo-tp1452716p1452716.html
Sent from the Users mailing list archive at Nabble.com.

Re: Deploy cocoon 2.2 in geronimo

Posted by Kevan Miller <ke...@gmail.com>.
On Sep 13, 2010, at 12:17 PM, Faw wrote:

> 
> Ok,  https://issues.apache.org/jira/browse/GERONIMO-5605 created a bug report
> . The funny thing is that the web app will deploy in tomcat but not in
> jetty, but now my secure webservice will deploy in jetty but not in tomcat.

Closing the loop on this. As Ivan has noted in the Jira, Cocoon's web.xml contains a <filter-mapping> for a non-existent servlet. This is causing Jetty to fail (Tomcat seems to ignore). Hoping we can improve the error processing and provide a more useful failure message.

--kevan

Re: Deploy cocoon 2.2 in geronimo

Posted by Faw <fa...@gmail.com>.
Ok,  https://issues.apache.org/jira/browse/GERONIMO-5605 created a bug report
. The funny thing is that the web app will deploy in tomcat but not in
jetty, but now my secure webservice will deploy in jetty but not in tomcat.
-- 
View this message in context: http://apache-geronimo.328035.n3.nabble.com/Deploy-cocoon-2-2-in-geronimo-tp1452716p1466640.html
Sent from the Users mailing list archive at Nabble.com.

Re: Deploy cocoon 2.2 in geronimo

Posted by Kevan Miller <ke...@gmail.com>.
On Sep 10, 2010, at 5:23 PM, Faw wrote:

> 
>> Do you have a pointer to a war file (sample app) that exhibits this
> problem?
> 
> This is the created war: http://www.megaupload.com/?d=EI0ZMKRQ
> 
> Simple test war I made using the m2eclipse plugin. I don't know if it is
> build correctly (since i cant test it). I just created a maven project, used
> the cocoon22-webapp archetype, created a block using the cocoon22-block
> archetype, installed the block, set dependency on webapp, packaged webapp
> (all jar files are in the WEB-INF/lib including the block one)
> 
> 
>> Are you sure that the war file contains WEB-INF/applicationContext.xml and
> the xml file is not in a 
>> different location?
> 
> I opened the war with 7zip and the file is there.
> 
>> You can be sure there's not interference between the version of spring
> packaged in your war file 
>> and the version of spring used by geronimo, you can try the following
> deployment plan (e.g. 
>> ./deploy.sh deploy <your-app> nospring.xml). Where nospring.xml contains:
> 
> Version in war is different from geronimo (war=2.5.1, geronimo=3.0.3), tried
> the deployment file but just get a generic "deployment failed" exception.
> BTW im using windows, deploying using the deployment page in geronimo.

Thanks. I see there is a sample cocoon app, also -- http://cocoon.apache.org/1284_1_1.html

I'm able to deploy this app on a Geronimo tomcat assembly, but not a jetty assembly. I'm not sure what to do after it's deployed... Somebody is eating the error that's causing the failure in Jetty. Looks like somebody will need to degug on Jetty...

You're welcome to create a Jira... Hopefully somebody will have a look.

--kevan

Re: Deploy cocoon 2.2 in geronimo

Posted by Faw <fa...@gmail.com>.
> Do you have a pointer to a war file (sample app) that exhibits this
problem?

This is the created war: http://www.megaupload.com/?d=EI0ZMKRQ

Simple test war I made using the m2eclipse plugin. I don't know if it is
build correctly (since i cant test it). I just created a maven project, used
the cocoon22-webapp archetype, created a block using the cocoon22-block
archetype, installed the block, set dependency on webapp, packaged webapp
(all jar files are in the WEB-INF/lib including the block one)


>Are you sure that the war file contains WEB-INF/applicationContext.xml and
the xml file is not in a 
>different location?

I opened the war with 7zip and the file is there.

>You can be sure there's not interference between the version of spring
packaged in your war file 
>and the version of spring used by geronimo, you can try the following
deployment plan (e.g. 
>./deploy.sh deploy <your-app> nospring.xml). Where nospring.xml contains:

Version in war is different from geronimo (war=2.5.1, geronimo=3.0.3), tried
the deployment file but just get a generic "deployment failed" exception.
BTW im using windows, deploying using the deployment page in geronimo.
-- 
View this message in context: http://apache-geronimo.328035.n3.nabble.com/Deploy-cocoon-2-2-in-geronimo-tp1452716p1455043.html
Sent from the Users mailing list archive at Nabble.com.

Re: Deploy cocoon 2.2 in geronimo

Posted by Kevan Miller <ke...@gmail.com>.
On Sep 10, 2010, at 10:25 AM, Faw wrote:

> 
> I'm trying to make a cocoon 2.2 application using m2Eclipse (Maven plugin), I
> created a block+webapp and created a war. When I try to deploy to geronimo
> it says it deploys but it fails to start. The error I get (among a few, but
> I think this is the one responsible) is 'Could not open ServletContext
> resource [/WEB-INF/applicationContext.xml]' even though the file is in the
> war. The full error message and stack trace is:

Do you have a pointer to a war file (sample app) that exhibits this problem?

Are you sure that the war file contains WEB-INF/applicationContext.xml and the xml file is not in a different location?

You can be sure there's not interference between the version of spring packaged in your war file and the version of spring used by geronimo, you can try the following deployment plan (e.g. ./deploy.sh deploy <your-app> nospring.xml). Where nospring.xml contains:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1" xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1" xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1">
  <dep:environment>
    <dep:moduleId>
      <dep:groupId>org.mygroup</dep:groupId>
      <dep:artifactId>MyApp</dep:artifactId>
      <dep:version>1.1</dep:version>
      <dep:type>car</dep:type>
    </dep:moduleId>
    <!-- 
         Don't load spring classes or resources from parent ClassLoaders.
      -->
    <dep:hidden-classes>
      <dep:filter>org.springframework.</dep:filter>
      <dep:filter>META-INF/spring</dep:filter>
    </dep:hidden-classes>
    <dep:inverse-classloading/>
  </dep:environment>
</web-app>

--kevan