users@glassfish.java.net

Spring WebApplicationContext Problem War/Ear deployment differs....

From: Andrew Hughes <ahhughes_at_gmail.com>
Date: Tue, 22 Apr 2008 10:27:43 +0930

Hi All,

I apologise (and hope) if this is a bit of an easy/n00b question but here
goes:

I'm trying to deploy the opensource geoserver.war (http://geoserver.org)
spatial web server inside an ear. My reasoning is to pair/deploy myapp.war
(client) deployed in the same release as the supporting geoserver.war
(server) (its a client/server thing), no ejb's just two wars - pretty
simple. In fact for simplicity I have only got geoserver.war in the ear at
present.

When I deploy the geoserver.war it deploys/works perfectly. However, if I
pack exactly the same war into an ear, kaboom! It seems as tho the problem
is with "Loading Spring root WebApplicationContext". I don't know why the
context initialization is different between the war, and the war inside an
ear... but something is not happy.

Any help would be much appreciated, THANKS. :)


Server Log Below:
------------------------------------------------------------------------------

[#|2008-04-22T09:48:42.779+0930|INFO|sun-appserver9.1|javax.enterprise.system.tools.deployment|_ThreadID=34;_ThreadName=Thread-49;|deployed
with moduleid = mycompany-spatial-ear-1.0.0-SNAPSHOT|#]

[#|2008-04-22T09:48:43.431+0930|INFO|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=35;_ThreadName=Thread-48;enableURLRewriting;|WEB0109:
Property [enableURLRewriting] is not yet supported|#]

[#|2008-04-22T09:48:43.461+0930|INFO|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=35;_ThreadName=Thread-48;enableURLRewriting;|WEB0109:
Property [enableURLRewriting] is not yet supported|#]

[#|2008-04-22T09:48:44.923+0930|INFO|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=35;_ThreadName=Thread-48;|PWC1412:
WebModule[/geoserver] ServletContext.log():Loading Spring root
WebApplicationContext|#]

[#|2008-04-22T09:48:47.294+0930|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=35;_ThreadName=Thread-48;|22
Apr 09:48:47 ERROR [context.ContextLoader] - Context initialization
failed
java.lang.NoSuchFieldError: TRACE
        at org.geotools.util.logging.Log4JLogger.toLog4JLevel(Log4JLogger.java:72)
        at org.geotools.util.logging.Log4JLogger.isLoggable(Log4JLogger.java:112)
        at org.geotools.util.logging.LoggerAdapter.logrb(LoggerAdapter.java:492)
        at org.geotools.util.logging.LoggerAdapter.log(LoggerAdapter.java:334)
        at org.geotools.resources.IndexedResourceBundle.ensureLoaded(IndexedResourceBundle.java:241)
        at org.geotools.resources.IndexedResourceBundle.handleGetObject(IndexedResourceBundle.java:293)
        at java.util.ResourceBundle.getObject(ResourceBundle.java:380)
        at java.util.ResourceBundle.getString(ResourceBundle.java:346)
        at org.geotools.util.ResourceInternationalString.toString(ResourceInternationalString.java:104)
        at org.geotools.referencing.cs.DefaultCoordinateSystemAxis.toMap(DefaultCoordinateSystemAxis.java:796)
        at org.geotools.referencing.cs.DefaultCoordinateSystemAxis.<init>(DefaultCoordinateSystemAxis.java:786)
        at org.geotools.referencing.cs.DefaultCoordinateSystemAxis.<init>(DefaultCoordinateSystemAxis.java:818)
        at org.geotools.referencing.cs.DefaultCoordinateSystemAxis.<clinit>(DefaultCoordinateSystemAxis.java:115)
        at org.geotools.referencing.cs.AbstractCS.<clinit>(AbstractCS.java:88)
        at org.geotools.referencing.crs.DefaultGeographicCRS.<clinit>(DefaultGeographicCRS.java:92)
        at org.geoserver.wms.DefaultWebMapService.<clinit>(DefaultWebMapService.java:79)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at org.springframework.util.ClassUtils.forName(ClassUtils.java:88)
        at org.springframework.beans.factory.support.BeanDefinitionReaderUtils.createBeanDefinition(BeanDefinitionReaderUtils.java:65)
        at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:369)
        at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:335)
        at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitions(DefaultXmlBeanDefinitionParser.java:266)
        at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinitions(DefaultXmlBeanDefinitionParser.java:186)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:246)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:163)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:125)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:141)
        at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:126)
        at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
        at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:268)
        at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:230)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:156)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:48)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4515)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:5176)
        at com.sun.enterprise.web.WebModule.start(WebModule.java:327)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:973)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:957)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:688)
        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1581)
        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1222)
        at com.sun.enterprise.web.WebContainer.loadJ2EEApplicationWebModules(WebContainer.java:1147)
        at com.sun.enterprise.server.TomcatApplicationLoader.doLoad(TomcatApplicationLoader.java:141)
        at com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:244)
        at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:336)
        at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:210)
        at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:645)
        at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeployEventListener(AdminEventMulticaster.java:928)
        at com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDeployEvent(AdminEventMulticaster.java:912)
        at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:461)
        at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:176)
        at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:308)
        at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:226)
        at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:298)
        at com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(ApplicationStartPhase.java:132)
        at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:919)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:591)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:635)
        at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(ApplicationsConfigMBean.java:744)
        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 com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:375)
        at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:358)
        at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:464)
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
        at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
        at $Proxy1.invoke(Unknown Source)
        at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:304)
        at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:174)
        at com.sun.enterprise.deployment.client.DeploymentClientUtils.startApplication(DeploymentClientUtils.java:145)
        at com.sun.enterprise.deployment.client.DeployAction.run(DeployAction.java:537)
        at java.lang.Thread.run(Thread.java:619)
|#]

[#|2008-04-22T09:48:47.296+0930|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=35;_ThreadName=Thread-48;_RequestID=9b56beda-d079-4a6f-b7ab-9e901651290a;|WebModule[/geoserver]PWC1275:
Exception sending context initialized event to listener instance of
class org.springframework.web.context.ContextLoaderListener
java.lang.NoSuchFieldError: TRACE
        at org.geotools.util.logging.Log4JLogger.toLog4JLevel(Log4JLogger.java:72)
        at org.geotools.util.logging.Log4JLogger.isLoggable(Log4JLogger.java:112)
        at org.geotools.util.logging.LoggerAdapter.logrb(LoggerAdapter.java:492)
        at org.geotools.util.logging.LoggerAdapter.log(LoggerAdapter.java:334)
        at org.geotools.resources.IndexedResourceBundle.ensureLoaded(IndexedResourceBundle.java:241)
        at org.geotools.resources.IndexedResourceBundle.handleGetObject(IndexedResourceBundle.java:293)
        at java.util.ResourceBundle.getObject(ResourceBundle.java:380)
        at java.util.ResourceBundle.getString(ResourceBundle.java:346)
        at org.geotools.util.ResourceInternationalString.toString(ResourceInternationalString.java:104)
        at org.geotools.referencing.cs.DefaultCoordinateSystemAxis.toMap(DefaultCoordinateSystemAxis.java:796)
        at org.geotools.referencing.cs.DefaultCoordinateSystemAxis.<init>(DefaultCoordinateSystemAxis.java:786)
        at org.geotools.referencing.cs.DefaultCoordinateSystemAxis.<init>(DefaultCoordinateSystemAxis.java:818)
        at org.geotools.referencing.cs.DefaultCoordinateSystemAxis.<clinit>(DefaultCoordinateSystemAxis.java:115)
        at org.geotools.referencing.cs.AbstractCS.<clinit>(AbstractCS.java:88)
        at org.geotools.referencing.crs.DefaultGeographicCRS.<clinit>(DefaultGeographicCRS.java:92)
        at org.geoserver.wms.DefaultWebMapService.<clinit>(DefaultWebMapService.java:79)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at org.springframework.util.ClassUtils.forName(ClassUtils.java:88)
        at org.springframework.beans.factory.support.BeanDefinitionReaderUtils.createBeanDefinition(BeanDefinitionReaderUtils.java:65)
        at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:369)
        at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:335)
        at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitions(DefaultXmlBeanDefinitionParser.java:266)
        at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinitions(DefaultXmlBeanDefinitionParser.java:186)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:246)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:163)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:125)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:141)
        at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:126)
        at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
        at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:268)
        at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:230)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:156)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:48)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4515)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:5176)
        at com.sun.enterprise.web.WebModule.start(WebModule.java:327)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:973)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:957)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:688)
        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1581)
        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1222)
        at com.sun.enterprise.web.WebContainer.loadJ2EEApplicationWebModules(WebContainer.java:1147)
        at com.sun.enterprise.server.TomcatApplicationLoader.doLoad(TomcatApplicationLoader.java:141)
        at com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:244)
        at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:336)
        at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:210)
        at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:645)
        at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeployEventListener(AdminEventMulticaster.java:928)
        at com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDeployEvent(AdminEventMulticaster.java:912)
        at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:461)
        at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:176)
        at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:308)
        at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:226)
        at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:298)
        at com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(ApplicationStartPhase.java:132)
        at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:919)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:591)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:635)
        at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(ApplicationsConfigMBean.java:744)
        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 com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:375)
        at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:358)
        at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:464)
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
        at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
        at $Proxy1.invoke(Unknown Source)
        at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:304)
        at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:174)
        at com.sun.enterprise.deployment.client.DeploymentClientUtils.startApplication(DeploymentClientUtils.java:145)
        at com.sun.enterprise.deployment.client.DeployAction.run(DeployAction.java:537)
        at java.lang.Thread.run(Thread.java:619)
|#]


[#|2008-04-22T09:48:47.297+0930|SEVERE|sun-appserver9.1|org.apache.catalina.core.StandardContext|_ThreadID=35;_ThreadName=Thread-48;_RequestID=9b56beda-d079-4a6f-b7ab-9e901651290a;|PWC1306:
Startup of context /geoserver failed due to previous errors|#]

[#|2008-04-22T09:48:47.300+0930|INFO|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=35;_ThreadName=Thread-48;|PWC1412:
WebModule[/geoserver] ServletContext.log():Closing Spring root
WebApplicationContext|#]