3 Replies Latest reply on Aug 19, 2008 11:09 AM by H. Hecate

    jboss && log4j

    H. Hecate Newbie

      I'm using jboss with log4j. I have remote application jmslistener, which uses jboss over network. When I try to start jmslistener, I get the following errors:

      log4j:ERROR Error while activating options for appender named [DefaultAppender].
      java.lang.NullPointerException
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1392)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:596)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at org.apache.log4j.net.JMSAppender.lookup(Unknown Source)
      at org.apache.log4j.net.JMSAppender.activateOptions(Unknown Source)
      at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:256)
      at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:132)
      at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:96)
      at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:654)
      at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:612)
      at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:509)
      at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:415)
      at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:441)
      at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:468)
      at org.apache.log4j.LogManager.(LogManager.java:122)
      at org.jboss.logging.Log4jLoggerPlugin.init(Log4jLoggerPlugin.java:63)
      at org.jboss.logging.Logger.getDelegatePlugin(Logger.java:338)
      at org.jboss.logging.Logger.(Logger.java:96)
      at org.jboss.logging.Logger.getLogger(Logger.java:309)
      at org.jnp.interfaces.NamingContext.(NamingContext.java:158)
      at org.jnp.interfaces.NamingContextFactory.getInitialContext(NamingContextFactory.java:56)
      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
      at javax.naming.InitialContext.init(InitialContext.java:223)
      at javax.naming.InitialContext.(InitialContext.java:175)
      at com.telcordia.xsm.jmslistener.SynchronousServer.createTopicSubscriber(SynchronousServer.java:70)
      at com.telcordia.xsm.jmslistener.SynchronousServer.receiveMessages(SynchronousServer.java:45)
      at com.telcordia.xsm.jmslistener.SynchronousServer.run(SynchronousServer.java:40)
      at java.lang.Thread.run(Thread.java:595)

      It looks like I missed some jar-files in CLASSPATH. Is this true?

      My CLASSPATH contains the following jars:
      jta20.jar
      log4j-1.2.13.jar
      oalnf.jar
      jbossall-client.jar
      jboss-j2ee.jar

      My jboss is:
      jboss-eap-4.3

      Thanks

        • 1. Re: jboss && log4j
          jaikiran pai Master

           


          log4j:ERROR Error while activating options for appender named [DefaultAppender].


          Post the contents of your log4j configuration file (log4j.xml or log4j.properties).


          P.S: While posting logs or xml content or code, remember to wrap it in a code block by using the Code button in the message editor window. Please hit the Preview button before posting to ensure your post is correctly formatted.

          • 2. Re: jboss && log4j
            H. Hecate Newbie

            $ cat log4j.properties

            log4j.rootLogger=INFO, DefaultAppender
            log4j.appender.DefaultAppender=org.apache.log4j.net.JMSAppender
            
            log4j.appender.DefaultAppender.TopicConnectionFactoryBindingName=systempilot/jms/topic/connection-factory
            log4j.appender.DefaultAppender.TopicBindingName=systempilot/jms/topic/log4jtopic
            
            log4j.appender.DefaultAppender.layout=org.apache.log4j.PatternLayout
            log4j.appender.DefaultAppender.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
            


            • 3. Re: jboss && log4j
              H. Hecate Newbie

              One thing I want to add. All worked with previous version of jboss (4.0.3). Are there any documents where changes between these versions are described? I suspect something in jboss was changed and that may be a cause of my errors