3 Replies Latest reply on Sep 9, 2003 7:10 AM by meuh

    Problem with JMSAppender

    meuh Newbie

      Hello all

      I'm trying to log errors with log4j by a topic Message-Driven Bean. I'm working with JBoss 3.0.6.

      Here is a part from the log4j.xml :
      --------------------------------------------------------------





      [...]


      <appender-ref ref="JMS"/>

      ----------------------------------------------------------------

      When I start JBoss an error append, when it starts Log4JService :

      10:44:06,281 INFO [Log4jService] Starting
      10:44:06,281 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
      10:44:06,312 INFO [AbstractDeploymentScanner$ScannerThread] Running
      log4j:ERROR Error while activating options for appender named [JMS].
      javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:640)
      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
      at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:280)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      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:248)
      at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:210)
      at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:140)
      at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:153)
      at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:415)
      at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:335)
      at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:788)
      at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:673)
      at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:616)
      at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:602)



      What ca I do to solve this problem?

      Regards,
      meuh

        • 1. Re: Problem with JMSAppender
          Stephane Nicoll Master

          JMS is not deployed yet when you start configuring log4j. Even the error you have is because the Naming service is not available yet AFAIK.

          So you'lll have to start the naming service AND JMS (at least the connection factory)

          This seems a little bit weird to me however ...

          • 2. Re: Problem with JMSAppender
            meuh Newbie

            well, i'd love start the naming service and JMS but, i'm really newbie on the matter and... I don't know how to do this...

            • 3. Re: Problem with JMSAppender
              meuh Newbie

              well I managed to start the naming service before log4J but i've got another error (which I already found on a topic, but the solution was too confused for me) :

              14:45:56,312 INFO [NamingService] Starting
              14:45:56,312 INFO [NamingService] Starting jnp server
              14:45:56,406 INFO [NamingService] Started jnpPort=1099, rmiPort=0, backlog=50, bindAddress=null, Client SocketFactory=null, Server SocketFactory=org.jboss.net.sockets.DefaultSocketFactory@ad093076
              14:45:56,437 INFO [NamingService] Listening on port 1099
              14:45:56,453 INFO [NamingService] Started
              14:45:56,453 INFO [JNDIView] Starting
              14:45:56,453 INFO [JNDIView] Started
              14:45:56,453 INFO [Log4jService] Starting
              14:45:56,468 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
              log4j:ERROR Could not find name [java:/ConnectionFactory].
              log4j:ERROR Error while activating options for appender named [JMS].
              javax.naming.NameNotFoundException: ConnectionFactory not bound
              at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
              at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)

              Please, what can I do?

              regards,
              meuh