3 Replies Latest reply on Apr 24, 2008 10:18 AM by jaikiran pai

    Getting Log4j configured for an EAR: DLQHandler NullPointerE

    sammy Jenkis Newbie

      I am interested in deploying an EAR which contains its own log4j.xml configuration. I've seen a lot of references which recommend class loader scoping to get this done.

      I followed the advice from http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4125552 which apparently has worked for some people. It worked in part for me.

      I was able to get log4j configured for my EAR by adding a jboss-app.xml to my ear:

      <jboss-app>
       <loader-repository>
       com.micros_retail:loader=XcenterLoader
       <loader-repository-config>
       java2ParentDelegation=false
       </loader-repository-config>
       </loader-repository>
      </jboss-app>


      However, once I define the loader-repository, my EJB 2.0 MDB fails to deploy:

      2008-04-18 13:18:16,592 TRACE [org.jboss.ejb.plugins.jms.DLQHandler] Constructing
      2008-04-18 13:18:16,592 DEBUG [org.jboss.ejb.plugins.jms.DLQHandler] Creating DLQHandler
      2008-04-18 13:18:16,592 DEBUG [org.jboss.ejb.plugins.jms.DLQHandler] Using factory: null
      2008-04-18 13:18:16,592 DEBUG [org.jboss.ejb.plugins.jms.DLQHandler] Initialization failed DLQHandler
      java.lang.NullPointerException
       at org.jboss.ejb.plugins.jms.DLQHandler.createService(DLQHandler.java:187)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:260)
       at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:188)
       at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerStartDelivery(JMSContainerInvoker.java:510)
       at org.jboss.ejb.plugins.jms.JMSContainerInvoker$ExceptionListenerImpl$ExceptionListenerRunnable.run(JMSContainerInvoker.java:1428)
       at java.lang.Thread.run(Thread.java:595)
      


      Apparently the QueryConnectionFactory lookup is failing. I don't know where to go from here. Any help or ideas would be appreciated. Thanks.

        • 1. Re: Getting Log4j configured for an EAR: DLQHandler NullPoin
          jaikiran pai Master

          Which version of JBoss and Java do you use?

          However, once I define the loader-repository, my EJB 2.0 MDB fails to deploy


          Are you sure that this is the reason why your EJB2.0 fails to deploy? The log message does not show any "ERROR" messages. Those are just "DEBUG" messages. Do you have any other exception stacktrace in the logs? If yes, then post them here. Also, what do you see on the console when you deploy the application? Any errors?


          • 2. Re: Getting Log4j configured for an EAR: DLQHandler NullPoin
            sammy Jenkis Newbie

            Thanks for the response. I am using JBoss AS 4.2.2 and Java 1.5 (update 15) on Win XP.

            Are you sure that this is the reason why your EJB2.0 fails to deploy


            As far as I know, yes. There aren't any other stack traces present. The stack I posted previously was from the EJBDeployer's attempt to re-deploy the failed application, with JBoss' logging cranked up. Now that I've put the logging levels back to normal, I'm seeing WARN's and ERROR's again. Here is the first stack trace I get when started up JBoss (at WARN level).

            14:42:34,352 WARN [JMSContainerInvoker] JMS provider failure detected for CfgEventLogConsumer
            java.lang.NullPointerException
             at org.jboss.ejb.plugins.jms.DLQHandler.createService(DLQHandler.java:187)
             at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:260)
             at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:188)
             at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerStartDelivery(JMSContainerInvoker.java:510)
             at org.jboss.ejb.plugins.jms.JMSContainerInvoker.startService(JMSContainerInvoker.java:839)
             at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
             at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
             at sun.reflect.GeneratedMethodAccessor3.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)
            . . .
            


            Then I get this at a regular interval (re-deployment attempts):

            14:46:05,963 INFO [JMSContainerInvoker] Waiting for reconnect internal 10000ms for CfgEventLogConsumer
            14:46:15,963 INFO [JMSContainerInvoker] Trying to reconnect to JMS provider for CfgEventLogConsumer
            14:46:15,963 ERROR [JMSContainerInvoker] Reconnect failed: JMS provider failure detected for CfgEventLogConsumer
            java.lang.NullPointerException
             at org.jboss.ejb.plugins.jms.DLQHandler.createService(DLQHandler.java:187)
             at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:260)
             at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:188)
             at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerStartDelivery(JMSContainerInvoker.java:510)
             at org.jboss.ejb.plugins.jms.JMSContainerInvoker$ExceptionListenerImpl$ExceptionListenerRunnable.run(JMSContainerInvoker.java:1428)
             at java.lang.Thread.run(Thread.java:595)
            


            • 3. Re: Getting Log4j configured for an EAR: DLQHandler NullPoin
              jaikiran pai Master

              I don't see any obvious reasons why this exception should be thrown. Can you tell us a bit more about your application? Its contents and how its packaged? And maybe a bit more DEBUG/TRACE logs from the server.log might help.