Details

Description

I deployed a web application (including a resource-ref to a database pool) successfully, with a module ID containing only an artifact element.

I changed the web.xml and redeployed it. It failed due to a syntax error in web.xml (I changed the login page to not start with a / and it complained; apparently the / is necessary). The application still appeared to be running, though I didn't test it.

I fixed the web.xml and redeployed it. It failed with the following error. It seems that after the redeploy the JNDI entry for the data source was invalid?

UPDATE: a simple redeploy of the working application causes the error – it's not necessary to have the failed redeploy in between.

11:57:44,865 ERROR [ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DataSource' defined in resource [/WEB-INF/applicationContext.xml] of ServletContext: Initialization of bean failed; nested exception is javax.naming.NamingException: Could not look up : env/jdbc/Database
javax.naming.NamingException: Could not look up : env/jdbc/Database [Root exception is org.apache.geronimo.kernel.proxy.DeadProxyException: Proxy is no longer valid]
at org.apache.geronimo.naming.enc.CachingReference.resolveReference(CachingReference.java:59)
at org.apache.geronimo.naming.enc.CachingReference.get(CachingReference.java:45)
at org.apache.geronimo.naming.enc.AbstractReadOnlyContext.lookup(AbstractReadOnlyContext.java:86)
at org.apache.geronimo.naming.java.RootContext.lookup(RootContext.java:51)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:120)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:117)
at org.springframework.jndi.AbstractJndiLocator.lookup(AbstractJndiLocator.java:181)
at org.springframework.jndi.AbstractJndiLocator.afterPropertiesSet(AbstractJndiLocator.java:171)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:801)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:249)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:177)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:177)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:268)
at org.springframework.web.context.support.XmlWebApplicationContext.refresh(XmlWebApplicationContext.java:131)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:156)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:97)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:48)
at org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContext.java:495)
at org.apache.geronimo.jetty.JettyWebAppContext.doStart(JettyWebAppContext.java:401)
at org.mortbay.util.Container.start(Container.java:72)
at org.apache.geronimo.jetty.JettyWebAppContext.doStart(JettyWebAppContext.java:389)
at org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:981)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:267)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:102)
at org.apache.geronimo.gbean.runtime.GBeanInstance.start(GBeanInstance.java:526)
at org.apache.geronimo.gbean.runtime.GBeanDependency.attemptFullStart(GBeanDependency.java:111)
at org.apache.geronimo.gbean.runtime.GBeanDependency.addTarget(GBeanDependency.java:146)
at org.apache.geronimo.gbean.runtime.GBeanDependency$1.running(GBeanDependency.java:120)
at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.fireRunningEvent(BasicLifecycleMonitor.java:173)
at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.access$300(BasicLifecycleMonitor.java:41)
at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor$RawLifecycleBroadcaster.fireRunningEvent(BasicLifecycleMonitor.java:251)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:292)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:102)
at org.apache.geronimo.gbean.runtime.GBeanInstance.start(GBeanInstance.java:526)
at org.apache.geronimo.gbean.runtime.GBeanDependency.attemptFullStart(GBeanDependency.java:111)
at org.apache.geronimo.gbean.runtime.GBeanDependency.addTarget(GBeanDependency.java:146)
at org.apache.geronimo.gbean.runtime.GBeanDependency$1.running(GBeanDependency.java:120)
at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.fireRunningEvent(BasicLifecycleMonitor.java:173)
at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.access$300(BasicLifecycleMonitor.java:41)
at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor$RawLifecycleBroadcaster.fireRunningEvent(BasicLifecycleMonitor.java:251)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:292)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:102)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:124)
at org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:540)
at org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:379)
at org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:374)
at org.apache.geronimo.kernel.config.KernelConfigurationManager.start(KernelConfigurationManager.java:187)
at org.apache.geronimo.kernel.config.SimpleConfigurationManager.reloadConfiguration(SimpleConfigurationManager.java:1055)
at org.apache.geronimo.kernel.config.SimpleConfigurationManager.reloadConfiguration(SimpleConfigurationManager.java:768)
at org.apache.geronimo.kernel.config.SimpleConfigurationManager.reloadConfiguration(SimpleConfigurationManager.java:718)
at org.apache.geronimo.kernel.config.SimpleConfigurationManager$$FastClassByCGLIB$$ce77a924.invoke(<generated>)
at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:122)
at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:852)
at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
at org.apache.geronimo.kernel.KernelGBean.invoke(KernelGBean.java:338)
at org.apache.geronimo.kernel.KernelGBean$$FastClassByCGLIB$$1cccefc9.invoke(<generated>)
at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:122)
at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:852)
at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke(MBeanGBeanBridge.java:168)
at mx4j.server.interceptor.InvokerMBeanServerInterceptor.invoke(InvokerMBeanServerInterceptor.java:221)
at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:120)
at mx4j.server.interceptor.SecurityMBeanServerInterceptor.invoke(SecurityMBeanServerInterceptor.java:84)
at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:120)
at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:120)
at mx4j.server.interceptor.ContextClassLoaderMBeanServerInterceptor.invoke(ContextClassLoaderMBeanServerInterceptor.java:203)
at mx4j.server.MX4JMBeanServer.invoke(MX4JMBeanServer.java:1043)
at mx4j.remote.rmi.RMIConnectionInvoker.invoke(RMIConnectionInvoker.java:219)
at sun.reflect.GeneratedMethodAccessor279.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at mx4j.remote.rmi.RMIConnectionProxy.invoke(RMIConnectionProxy.java:34)
at mx4j.remote.rmi.RMIConnectionSubjectInvoker.chain(RMIConnectionSubjectInvoker.java:99)
at mx4j.remote.rmi.RMIConnectionSubjectInvoker.access$000(RMIConnectionSubjectInvoker.java:31)
at mx4j.remote.rmi.RMIConnectionSubjectInvoker$1.run(RMIConnectionSubjectInvoker.java:90)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
at mx4j.remote.MX4JRemoteUtils.subjectInvoke(MX4JRemoteUtils.java:163)
at mx4j.remote.rmi.RMIConnectionSubjectInvoker.subjectInvoke(RMIConnectionSubjectInvoker.java:86)
at mx4j.remote.rmi.RMIConnectionSubjectInvoker.invoke(RMIConnectionSubjectInvoker.java:80)
at $Proxy0.invoke(Unknown Source)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:221)
at sun.reflect.GeneratedMethodAccessor335.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:534)
Caused by: org.apache.geronimo.kernel.proxy.DeadProxyException: Proxy is no longer valid
at org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:87)
at org.apache.geronimo.kernel.config.Configuration$$EnhancerByCGLIB$$8df662f2.getGBeans(<generated>)
at org.apache.geronimo.kernel.config.Configuration.findGBeanDatas(Configuration.java:714)
at org.apache.geronimo.kernel.config.Configuration.findGBeanData(Configuration.java:647)
at org.apache.geronimo.kernel.config.Configuration.findGBean(Configuration.java:632)
at org.apache.geronimo.naming.reference.ConfigurationAwareReference.resolveTargetName(ConfigurationAwareReference.java:64)
at org.apache.geronimo.naming.reference.ResourceReference.getContent(ResourceReference.java:54)
at org.apache.geronimo.naming.enc.CachingReference.resolveReference(CachingReference.java:55)
... 98 more
11:57:44,880 WARN [JettyWebAppContext] JettyWebAppContext failed
11:57:44,881 ERROR [GBeanInstanceState] Error while starting; GBean is now in the FAILED state: abstractName="default/IIIQuotes/1154620499045/war?J2EEApplication=null,j2eeType=WebModule,name=default/IIIQuotes/1154620499045/war"

Activity

Maybe caused by the JNDI reference (a ConfigurationAwareReference) having the wrong Configuration set on it? That is, the ConfigurationAwareReference has the web app module ID with the old version instead of the web app module ID with the new version?

Aaron Mulder
added a comment - 03/Aug/06 19:19 Maybe caused by the JNDI reference (a ConfigurationAwareReference) having the wrong Configuration set on it? That is, the ConfigurationAwareReference has the web app module ID with the old version instead of the web app module ID with the new version?

OK, the exception above is actually a problem trying to restart the old web app after the deployment of the new web app has failed. So that's one problem, but it is actually suppressing the underlying problem that caused the new web app to fail. Here's the original exception:

javax.naming.NamingException: Could not look up : env/jdbc/Database [Root exception is java.lang.NullPointerException]
at org.apache.geronimo.naming.enc.CachingReference.resolveReference(CachingReference.java:59)
at org.apache.geronimo.naming.enc.CachingReference.get(CachingReference.java:45)
at org.apache.geronimo.naming.enc.AbstractReadOnlyContext.lookup(AbstractReadOnlyContext.java:86)
at org.apache.geronimo.naming.java.RootContext.lookup(RootContext.java:51)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:120)
...
Caused by: java.lang.NullPointerException
at org.apache.geronimo.naming.reference.ConfigurationAwareReference.resolveTargetName(ConfigurationAwareReference.java:64)
at org.apache.geronimo.naming.reference.ResourceReference.getContent(ResourceReference.java:54)
at org.apache.geronimo.naming.enc.CachingReference.resolveReference(CachingReference.java:55)
... 98 more

It looks like that means the ConfigurationAwareReference was not able to look up its Configuration.

Aaron Mulder
added a comment - 03/Aug/06 21:13 OK, the exception above is actually a problem trying to restart the old web app after the deployment of the new web app has failed. So that's one problem, but it is actually suppressing the underlying problem that caused the new web app to fail. Here's the original exception:
javax.naming.NamingException: Could not look up : env/jdbc/Database [Root exception is java.lang.NullPointerException]
at org.apache.geronimo.naming.enc.CachingReference.resolveReference(CachingReference.java:59)
at org.apache.geronimo.naming.enc.CachingReference.get(CachingReference.java:45)
at org.apache.geronimo.naming.enc.AbstractReadOnlyContext.lookup(AbstractReadOnlyContext.java:86)
at org.apache.geronimo.naming.java.RootContext.lookup(RootContext.java:51)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:120)
...
Caused by: java.lang.NullPointerException
at org.apache.geronimo.naming.reference.ConfigurationAwareReference.resolveTargetName(ConfigurationAwareReference.java:64)
at org.apache.geronimo.naming.reference.ResourceReference.getContent(ResourceReference.java:54)
at org.apache.geronimo.naming.enc.CachingReference.resolveReference(CachingReference.java:55)
... 98 more
It looks like that means the ConfigurationAwareReference was not able to look up its Configuration.

At the time start is called on the new configuration (around SimpleConfigurationManager:982), the new configuration is still not loaded according to the ConfigurationManager. So the ConfigurationAwareReference is actually looking for the correct configuration, but it gets null because that configuration is not loaded.

Aaron Mulder
added a comment - 03/Aug/06 21:28 OK, more info...
At the time start is called on the new configuration (around SimpleConfigurationManager:982), the new configuration is still not loaded according to the ConfigurationManager. So the ConfigurationAwareReference is actually looking for the correct configuration, but it gets null because that configuration is not loaded.

Problem finally was that the ConfigurationModel thinks that the new Configuration being reloaded was still in the "unloaded" state until after the reload completed. That meant that any ConfigurationAwareReferences failed, because when they tried to get their configuration (which had, in truth, been loaded and was starting) they were told it didn't exist.

Patch fixes this by adding a placeholder for the "currently reloading configuration" (one that's in process and has been loaded but may or may not be started). This is safe because all the SimpleConfigurationManager methods are synchronized. Now isLoaded and getConfiguration check the currently reloading configuration as well as the ConfigurationModel. (It would have been more complex to keep the ConfigurationModel continuously updated with the state of the Configurations being loaded, etc.)

Aaron Mulder
added a comment - 03/Aug/06 21:57 Problem finally was that the ConfigurationModel thinks that the new Configuration being reloaded was still in the "unloaded" state until after the reload completed. That meant that any ConfigurationAwareReferences failed, because when they tried to get their configuration (which had, in truth, been loaded and was starting) they were told it didn't exist.
Patch fixes this by adding a placeholder for the "currently reloading configuration" (one that's in process and has been loaded but may or may not be started). This is safe because all the SimpleConfigurationManager methods are synchronized. Now isLoaded and getConfiguration check the currently reloading configuration as well as the ConfigurationModel. (It would have been more complex to keep the ConfigurationModel continuously updated with the state of the Configurations being loaded, etc.)