1 Reply Latest reply on Nov 2, 2007 11:22 AM by Kevin Lagace

    Can not deploy simple WAR in JBoss 5.0.0Beta2

    Kevin Lagace Newbie

      Hi all,
      I'm cutting my teeth with JBoss5.0.0Beta2, Struts2 and Google Guice and have come across what appears to be a classloading issue.

      The WAR I created deploys successfully in JBoss4.0.3 and fails with 5.0.0Beta2.

      The exception I receive is:

      10:58:48,796 ERROR [[/templateWAR]] Exception starting filter struts2
      Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean - jar:file:/C:/lm/tools/jboss-5.0.0.Beta2/server/default/work/jboss.web/localhost/templateWAR/WEB-INF/lib/struts2-core-2.0.11.jar!/struts-default.xml:30:72
      at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:208)
      at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)
      at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:131)
      at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
      at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
      at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
      at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
      at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
      at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
      at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:108)
      at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3720)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4367)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
      at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
      at org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)
      at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:298)
      at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:138)
      at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:367)
      at org.jboss.web.deployers.WebModule.startModule(WebModule.java:104)
      at org.jboss.web.deployers.WebModule.start(WebModule.java:80)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
      at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:184)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
      at org.jboss.system.microcontainer.ServiceControllerContextAction.install(ServiceControllerContextAction.java:46)
      at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:233)
      at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:238)
      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:724)
      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:445)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:555)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:489)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:335)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:205)
      at org.jboss.system.ServiceController.doChange(ServiceController.java:656)
      at org.jboss.system.ServiceController.start(ServiceController.java:431)
      at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:142)
      at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:103)
      at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
      at org.jboss.deployers.plugins.deployers.helpers.AbstractSimpleRealDeployer.deploy(AbstractSimpleRealDeployer.java:56)
      at org.jboss.deployers.plugins.deployer.AbstractSimpleDeployer.commitDeploy(AbstractSimpleDeployer.java:52)
      at org.jboss.deployers.plugins.deployer.DeployerWrapper.commitDeploy(DeployerWrapper.java:170)
      at org.jboss.deployers.plugins.deployment.MainDeployerImpl.commitDeploy(MainDeployerImpl.java:592)
      at org.jboss.deployers.plugins.deployment.MainDeployerImpl.commitDeploy(MainDeployerImpl.java:603)
      at org.jboss.deployers.plugins.deployment.MainDeployerImpl.process(MainDeployerImpl.java:476)
      at org.jboss.deployers.plugins.deployment.MainDeployerImpl.process(MainDeployerImpl.java:406)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:121)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:110)
      at org.jboss.profileservice.aop.MainDeployerAspect.process(MainDeployerAspect.java:53)
      at org.jboss.aop.advice.org.jboss.profileservice.aop.MainDeployerAspect_z_process_32961174.invoke(MainDeployerAspect_z_process_32961174.java)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at AOPContainerProxy$0.process(AOPContainerProxy$0.java)
      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:371)
      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.bootstrap(ProfileServiceBootstrap.java:247)
      at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:89)
      at org.jboss.system.server.profileservice.ServerImpl.doStart(ServerImpl.java:403)
      at org.jboss.system.server.profileservice.ServerImpl.start(ServerImpl.java:342)
      at org.jboss.Main.boot(Main.java:210)
      at org.jboss.Main$1.run(Main.java:522)
      at java.lang.Thread.run(Unknown Source)
      Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with the name xwork has already been loaded by bean - jar:vfsfile:/C:/lm/tools/jboss-5.0.0.Beta2/server/default/deploy/templateWAR.war/WEB-INF/lib/struts2-core-2.0.11.jar!/struts-default.xml:30:72 - bean - jar:file:/C:/lm/tools/jboss-5.0.0.Beta2/server/default/work/jboss.web/localhost/templateWAR/WEB-INF/lib/struts2-core-2.0.11.jar!/struts-default.xml:30:72
      at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:193)
      ... 79 more
      10:58:48,812 ERROR [StandardContext] Error filterStart
      10:58:48,812 ERROR [StandardContext] Context [/templateWAR] startup failed due to previous errors
      10:58:49,906 WARN [config] Unable to process deployment descriptor for context 'null'
      10:58:54,500 INFO [XmlConfigurationProvider] Parsing configuration file [struts-default.xml]
      10:58:54,593 ERROR [[/templateWAR]] Exception starting filter struts2
      Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean - jar:file:/C:/lm/tools/jboss-5.0.0.Beta2/server/default/tmp/deploy/templateWAR17243-exp.war/WEB-INF/lib/struts2-core-2.0.11.jar!/struts-default.xml:30:72
      at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:208)
      at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)
      at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:131)
      at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
      at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
      at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
      at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
      at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
      at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
      at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:108)
      at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3720)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4367)
      at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:300)
      at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:138)
      at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:367)
      at org.jboss.web.deployers.WebModule.startModule(WebModule.java:104)
      at org.jboss.web.deployers.WebModule.start(WebModule.java:80)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
      at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:184)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
      at org.jboss.system.microcontainer.ServiceControllerContextAction.install(ServiceControllerContextAction.java:46)
      at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:233)
      at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:238)
      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:724)
      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:445)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:555)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:489)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:335)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:205)
      at org.jboss.system.ServiceController.doChange(ServiceController.java:656)
      at org.jboss.system.ServiceController.start(ServiceController.java:431)
      at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:142)
      at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:103)
      at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
      at org.jboss.deployers.plugins.deployers.helpers.AbstractSimpleRealDeployer.deploy(AbstractSimpleRealDeployer.java:56)
      at org.jboss.deployers.plugins.deployer.AbstractSimpleDeployer.commitDeploy(AbstractSimpleDeployer.java:52)
      at org.jboss.deployers.plugins.deployer.DeployerWrapper.commitDeploy(DeployerWrapper.java:170)
      at org.jboss.deployers.plugins.deployment.MainDeployerImpl.commitDeploy(MainDeployerImpl.java:592)
      at org.jboss.deployers.plugins.deployment.MainDeployerImpl.commitDeploy(MainDeployerImpl.java:603)
      at org.jboss.deployers.plugins.deployment.MainDeployerImpl.process(MainDeployerImpl.java:476)
      at org.jboss.deployers.plugins.deployment.MainDeployerImpl.process(MainDeployerImpl.java:406)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:121)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:110)
      at org.jboss.profileservice.aop.MainDeployerAspect.process(MainDeployerAspect.java:53)
      at org.jboss.aop.advice.org.jboss.profileservice.aop.MainDeployerAspect_z_process_32961174.invoke(MainDeployerAspect_z_process_32961174.java)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at AOPContainerProxy$0.process(AOPContainerProxy$0.java)
      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:371)
      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.bootstrap(ProfileServiceBootstrap.java:247)
      at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:89)
      at org.jboss.system.server.profileservice.ServerImpl.doStart(ServerImpl.java:403)
      at org.jboss.system.server.profileservice.ServerImpl.start(ServerImpl.java:342)
      at org.jboss.Main.boot(Main.java:210)
      at org.jboss.Main$1.run(Main.java:522)
      at java.lang.Thread.run(Unknown Source)
      Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with the name xwork has already been loaded by bean - jar:vfsfile:/C:/lm/tools/jboss-5.0.0.Beta2/server/default/deploy/templateWAR.war/WEB-INF/lib/struts2-core-2.0.11.jar!/struts-default.xml:30:72 - bean - jar:file:/C:/lm/tools/jboss-5.0.0.Beta2/server/default/tmp/deploy/templateWAR17243-exp.war/WEB-INF/lib/struts2-core-2.0.11.jar!/struts-default.xml:30:72
      at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:193)
      ... 68 more
      10:58:54,593 ERROR [StandardContext] Error filterStart
      10:58:54,593 ERROR [StandardContext] Context [/templateWAR] startup failed due to previous errors

      Of course, if I remove the following filter definition from my web.xml, it deploys fine, and when I add it in, it fails.

      Here is the web.xml content:

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
      version="2.5">


      <filter-name>struts2</filter-name>
      <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>


      <filter-mapping>
      <filter-name>struts2</filter-name>
      <url-pattern>/*</url-pattern>
      </filter-mapping>

      <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      </welcome-file-list>
      </web-app>

      Any thoughts/insight would be greatly appreciated.

      /Kevin