1 Reply Latest reply on Jul 5, 2011 3:28 AM by Stuart Douglas

    Missing log4j Dependency RESTeasy

    Bernhard Günter Newbie

      Hi,

      I tried to migrate our server app from as 4 to 7. I came into the problem that resteasy could not deploy. Without full understanding of the new as7 architecture and structure I tried to fix it in the dependency section of the modules.xml of org.jboss.resteasy.resteasy-jaxrs using: <module name="org.apache.log4j"/>.

      It worked. See the stacktrace (without the fix):

       

      08:56:35,011 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/ServiceGateway]] (MSC service thread 1-2) Exception sending context initialized event to listener instance of class org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap: java.lang.ExceptionInInitializerError

          at org.jboss.resteasy.plugins.server.servlet.ConfigurationBootstrap.<init>(ConfigurationBootstrap.java:28) [resteasy-jaxrs-2.2.1.GA.jar:]

          at org.jboss.resteasy.plugins.server.servlet.ListenerBootstrap.<init>(ListenerBootstrap.java:24) [resteasy-jaxrs-2.2.1.GA.jar:]

          at org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap.contextInitialized(ResteasyBootstrap.java:26) [resteasy-jaxrs-2.2.1.GA.jar:]

          at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3368) [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]

          at org.apache.catalina.core.StandardContext.start(StandardContext.java:3821) [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]

          at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.0.CR1.jar:7.0.0.CR1]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)

          at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [:1.6.0_21]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [:1.6.0_21]

          at java.lang.Thread.run(Unknown Source) [:1.6.0_21]

      Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

          at org.jboss.resteasy.logging.Logger.getLogger(Logger.java:104) [resteasy-jaxrs-2.2.1.GA.jar:]

          at org.jboss.resteasy.spi.ResteasyDeployment.<clinit>(ResteasyDeployment.java:70) [resteasy-jaxrs-2.2.1.GA.jar:]

          ... 11 more

      Caused by: java.lang.reflect.InvocationTargetException

          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_21]

          at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) [:1.6.0_21]

          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [:1.6.0_21]

          at java.lang.reflect.Constructor.newInstance(Unknown Source) [:1.6.0_21]

          at org.jboss.resteasy.logging.Logger.getLogger(Logger.java:92) [resteasy-jaxrs-2.2.1.GA.jar:]

          ... 12 more

      Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger

          at org.jboss.resteasy.logging.impl.Log4jLogger.<init>(Log4jLogger.java:19) [resteasy-jaxrs-2.2.1.GA.jar:]

          ... 17 more

      Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger from [Module "org.jboss.resteasy.resteasy-jaxrs:main" from local module loader @33bfc93a (roots: C:\dev\apps\jBoss\jboss-7.0.0.CR1\modules)]

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)

          ... 18 more

       

      08:56:35,432 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Error listenerStart

      08:56:35,432 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Context [/ServiceGateway] startup failed due to previous errors

      08:56:35,480 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/ServiceGateway]] (MSC service thread 1-2) Exception sending context destroyed event to listener instance of class org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap: java.lang.NullPointerException

          at org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap.contextDestroyed(ResteasyBootstrap.java:37) [resteasy-jaxrs-2.2.1.GA.jar:]

          at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3465) [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]

          at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3970) [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]

          at org.apache.catalina.core.StandardContext.start(StandardContext.java:3888) [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]

          at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.0.CR1.jar:7.0.0.CR1]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)

          at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [:1.6.0_21]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [:1.6.0_21]

          at java.lang.Thread.run(Unknown Source) [:1.6.0_21]