3 Replies Latest reply on Sep 25, 2006 5:44 AM by Wim van Berkel

    Log4jRepositorySelector undeployment problem

    Paolo Perrucci Newbie

      Hi all,

      I'm trying to separate log4j logs of my web application running inside jboss 4.0.4GA and I tried to use the Log4jRepositorySelector found here

      http://wiki.jboss.org/wiki/Wiki.jsp?page=Log4jRepositorySelector

      It seems that it works like a charm until the webapp undeployment.
      At this point I get a lot of exception starting with:

      19:37:22,093 ERROR [BaseModelMBean] Exception invoking method destroy
      java.lang.ExceptionInInitializerError
      at org.apache.catalina.startup.ContextConfig.destroy(ContextConfig.java:1246)
      at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:280)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
      at org.apache.catalina.core.StandardContext.destroy(StandardContext.java:4446)
      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:585)
      at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
      at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.web.tomcat.tc5.TomcatDeployer.performUndeployInternal(TomcatDeployer.java:440)
      at org.jboss.web.tomcat.tc5.TomcatDeployer.performUndeploy(TomcatDeployer.java:411)
      at org.jboss.web.AbstractWebDeployer.stop(AbstractWebDeployer.java:418)
      at org.jboss.web.WebModule.stopModule(WebModule.java:100)
      at org.jboss.web.WebModule.stopService(WebModule.java:66)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStop(ServiceMBeanSupport.java:315)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:247)
      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy0.stop(Unknown Source)
      at org.jboss.system.ServiceController.stop(ServiceController.java:508)
      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:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy30.stop(Unknown Source)
      at org.jboss.web.AbstractWebContainer.stop(AbstractWebContainer.java:498)
      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:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
      at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
      at org.jboss.ws.server.WebServiceDeployer.stop(WebServiceDeployer.java:148)
      at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.stop(SubDeployerInterceptorSupport.java:196)
      at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:99)
      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:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy31.stop(Unknown Source)
      at org.jboss.deployment.MainDeployer.stop(MainDeployer.java:658)
      at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:631)
      at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:626)
      at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:609)
      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:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      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:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy8.undeploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.undeploy(URLDeploymentScanner.java:450)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:570)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
      Caused by: org.apache.commons.logging.LogConfigurationException: java.lang.reflect.UndeclaredThrowableException: [levelClass,
      org.jboss.logging.XLevel(1df59bd).ClassLoader=org.jboss.system.server.NoAnnotationURLClassLoader@ab95e6
      ..org.jboss.system.server.NoAnnotationURLClassLoader@ab95e6
      ..sun.misc.Launcher$AppClassLoader@e39a3e
      ....file:/C:/Programmi/jdk1.5.0/lib/tools.jar
      ....file:/D:/jboss/jboss-4.0.4.GA/bin/run.jar
      ..sun.misc.Launcher$ExtClassLoader@a39137
      ....file:/C:/Programmi/jdk1.5.0/jre/lib/ext/dnsns.jar
      ....file:/C:/Programmi/jdk1.5.0/jre/lib/ext/jmf.jar
      ....file:/C:/Programmi/jdk1.5.0/jre/lib/ext/localedata.jar
      ....file:/C:/Programmi/jdk1.5.0/jre/lib/ext/sound.jar
      ....file:/C:/Programmi/jdk1.5.0/jre/lib/ext/sunjce_provider.jar
      ....file:/C:/Programmi/jdk1.5.0/jre/lib/ext/sunpkcs11.jar
      ++++CodeSource: (file:/D:/jboss/jboss-4.0.4.GA/lib/jboss-common.jar <no signer certificates>)
      Implemented Interfaces:]; [priorityClass, null]]; [loggerClass,
      org.apache.log4j.Logger(7cb66a).ClassLoader=org.jboss.system.server.NoAnnotationURLClassLoader@ab95e6
      ..org.jboss.system.server.NoAnnotationURLClassLoader@ab95e6
      .........
      .......
      ........
      .........


      and ending with


      at org.apache.commons.logging.impl.Log4jProxy.(Log4jProxy.java:189)
      at org.apache.commons.logging.impl.Log4JLogger.(Log4JLogger.java:39)
      at sun.reflect.GeneratedConstructorAccessor12.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
      at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
      ... 87 more
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.apache.commons.logging.impl.Log4jProxy.(Log4jProxy.java:132)
      ... 92 more
      Caused by: java.lang.NullPointerException
      at org.apache.log4j.LogManager.getLogger(LogManager.java:179)
      at org.apache.log4j.Logger.getLogger(Logger.java:85)
      ... 96 more

      Anyone is using succesfully Log4jRepositorySelector ?

      Bye
      Paolo