0 Replies Latest reply on May 11, 2007 9:24 AM by al ferguson

    no hot redeploy with per webapp logging

    al ferguson Newbie

      Hi,

      Regarding the per webapp logging, when we use the http://wiki.jboss.org/wiki/Wiki.jsp?page=Log4jRepositorySelector approach
      it is not possible any more to do hot ear redeployments.

      Steps to reproduce :
      1. start JBoss with the ear deployed
      2. undeployed the ear
      3. redeploy the ear ==> the application cannot be deployed and the whole app server is blocked.


      I don't understand why, when redeploying the ear, the Log4jLoggerPlugin tries to use the per webapp RepositorySelector. Of course it has not been initialized yet and it fails.

      See the stacktrace below. We got a NPE because the RepositorySelector was not initialized yet. However, I don't think the repository of the Log4jLoggerPlugin should have been modified.

      ****************stacktrace begins****************


      java.lang.NullPointerException
      at org.jboss.repositoryselectorexample.MyRepositorySelector.getLoggerRepo
      sitory(MyRepositorySelector.java:87)
      at org.apache.log4j.LogManager.getLogger(LogManager.java:179)
      at org.apache.log4j.Logger.getLogger(Logger.java:85)
      at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
      Impl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at
      org.apache.commons.logging.impl.Log4jProxy.(Log4jProxy.java:132)
      at
      org.apache.commons.logging.impl.Log4JLogger.(Log4JLogger.java:39)
      at
      sun.reflect.GeneratedConstructorAccessor23.newInstance(Unknown Source)
      at
      sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
      tructorAccessorImpl.java:27)
      at
      java.lang.reflect.Constructor.newInstance(Constructor.java:494)
      at
      org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImp
      l.java:529)
      at
      org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImp
      l.java:235)
      at
      org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImp
      l.java:209)
      at
      org.apache.commons.logging.LogFactory.getLog(LogFactory.java:353)
      at
      org.apache.commons.httpclient.HttpMethodBase.(HttpMethodBase.jav
      a:102)
      at sun.misc.Unsafe.ensureClassInitialized(Native Method)
      at
      sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAcces
      sorFactory.java:25)
      at
      sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:12
      2)
      at java.lang.reflect.Field.acquireFieldAccessor(Field.java:917)
      at java.lang.reflect.Field.getFieldAccessor(Field.java:898)
      at java.lang.reflect.Field.get(Field.java:357)
      at
      org.apache.catalina.loader.WebappClassLoader.clearReferences(WebappClass
      Loader.java:1608)
      at
      org.apache.catalina.loader.WebappClassLoader.stop(WebappClassLoader.java
      :1492)
      at
      org.apache.catalina.loader.WebappLoader.stop(WebappLoader.java:736)
      at
      org.apache.catalina.core.StandardContext.stop(StandardContext.java:4393)
      at
      org.apache.catalina.core.ContainerBase.destroy(ContainerBase.java:1132)
      at
      org.apache.catalina.core.StandardContext.destroy(StandardContext.java:44
      49)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
      a:39)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
      Impl.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(TomcatDe
      ployer.java:450)
      at
      org.jboss.web.tomcat.tc5.TomcatDeployer.performUndeploy(TomcatDeployer.j
      ava:421)
      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(ServiceMBeanSuppo
      rt.java:315)
      at
      org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBean
      Support.java:247)
      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
      Impl.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.jav
      a: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.jav
      a:39)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
      Impl.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.jav
      a:264)
      at
      org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at
      org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy38.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.jav
      a:39)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
      Impl.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(ModelMBea
      nOperationInterceptor.java:142)
      at
      org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.ja
      va:97)
      at
      org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorSe
      rviceMBeanSupport.java:238)
      at
      org.jboss.ws.integration.jboss.DeployerInterceptor.stop(DeployerIntercep
      tor.java:122)
      at
      org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.sto
      p(SubDeployerInterceptorSupport.java:196)
      at
      org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerIntercepto
      r.java:99)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at
      org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.jav
      a:264)
      at
      org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at
      org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy39.stop(Unknown Source)
      at org.jboss.deployment.MainDeployer.stop(MainDeployer.java:667)
      at org.jboss.deployment.MainDeployer.stop(MainDeployer.java:659)
      at
      org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:638)
      at
      org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:632)
      at
      org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:615)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
      a:39)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
      Impl.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(ModelMBea
      nOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at
      org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.jav
      a: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(URLDeployment
      Scanner.java:450)
      at
      org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScan
      ner.java:570)
      at
      org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doS
      can(AbstractDeploymentScanner.java:263)
      at
      org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loo
      p(AbstractDeploymentScanner.java:274)
      at
      org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run
      (AbstractDeploymentScanner.java:225)

      ****************stacktrace ends****************


      I also tried to copy the log4j.jar in the ./WEB-INF/lib/ of my webapp. Instead of getting a NPE, I got a ClassCastException.

      Is anybody succeeded in carrying out hot redeployments while having by per webapp logging? I look at all the forums and I don't think JBoss can do this. We are running JBoss 4.0.5.

      TIA
      Al