5 Replies Latest reply on Nov 9, 2007 4:33 AM by franckl

    Issue with JBoss 4.2.1

    j_lalith

      Hi,

      I download the JBoss 4.2.1 zip and extracted it to a local folder,

      Plat form - Fedora Core 5

      Java - Java 5

      As instructed I executed the run.sh (JAVA_HOME set).

      but it gives the following exeception, then I thought it is something to do with the existing log4j libraries in my system, then I removed all the log4j references and executed the run.sh but still It gives the following error.

      I see lot of questions like this with no answer, can some one let me know how to solve the following


      13:11:37,798 WARN [BasicMBeanRegistry] preRegister() failed for JMImplementation:type=MBeanServerDelegate:
      java.lang.NoSuchFieldError: TRACE
      at org.jboss.logging.Log4jLoggerPlugin.isTraceEnabled(Log4jLoggerPlugin.java:85)
      at org.jboss.logging.Logger.isTraceEnabled(Logger.java:122)
      at org.jboss.mx.server.AbstractMBeanInvoker.initAttributeContexts(AbstractMBeanInvoker.java:1009)
      at org.jboss.mx.modelmbean.ModelMBeanInvoker.initAttributeContexts(ModelMBeanInvoker.java:597)
      at org.jboss.mx.server.AbstractMBeanInvoker.preRegister(AbstractMBeanInvoker.java:647)
      at org.jboss.mx.server.registry.BasicMBeanRegistry.invokePreRegister(BasicMBeanRegistry.java:697)
      at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:211)
      at org.jboss.mx.server.MBeanServerImpl.(MBeanServerImpl.java:215)
      at org.jboss.mx.server.MBeanServerBuilderImpl.newMBeanServer(MBeanServerBuilderImpl.java:71)
      at javax.management.MBeanServerFactory.newMBeanServer(MBeanServerFactory.java:316)
      at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:219)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:420)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
      at org.jboss.Main.boot(Main.java:200)
      at org.jboss.Main$1.run(Main.java:508)
      at java.lang.Thread.run(Thread.java:595)
      Failed to boot JBoss:
      java.lang.RuntimeException: Cannot create MBeanServer
      at org.jboss.mx.server.MBeanServerImpl.(MBeanServerImpl.java:239)
      at org.jboss.mx.server.MBeanServerBuilderImpl.newMBeanServer(MBeanServerBuilderImpl.java:71)
      at javax.management.MBeanServerFactory.newMBeanServer(MBeanServerFactory.java:316)
      at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:219)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:420)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
      at org.jboss.Main.boot(Main.java:200)
      at org.jboss.Main$1.run(Main.java:508)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: javax.management.NotCompliantMBeanException: Cannot register MBean: JMImplementation:type=MBeanS erverDelegate
      at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:314)
      at org.jboss.mx.server.MBeanServerImpl.(MBeanServerImpl.java:215)
      ... 8 more
      Caused by: javax.management.RuntimeErrorException
      at org.jboss.mx.server.registry.BasicMBeanRegistry.invokePreRegister(BasicMBeanRegistry.java:725)
      at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:211)
      ... 9 more
      Caused by: java.lang.NoSuchFieldError: TRACE
      at org.jboss.logging.Log4jLoggerPlugin.isTraceEnabled(Log4jLoggerPlugin.java:85)
      at org.jboss.logging.Logger.isTraceEnabled(Logger.java:122)
      at org.jboss.mx.server.AbstractMBeanInvoker.initAttributeContexts(AbstractMBeanInvoker.java:1009)
      at org.jboss.mx.modelmbean.ModelMBeanInvoker.initAttributeContexts(ModelMBeanInvoker.java:597)
      at org.jboss.mx.server.AbstractMBeanInvoker.preRegister(AbstractMBeanInvoker.java:647)
      at org.jboss.mx.server.registry.BasicMBeanRegistry.invokePreRegister(BasicMBeanRegistry.java:697)
      ... 10 more

        • 1. Re: Issue with JBoss 4.2.1
          peterj

          It does appear that there is an older version of Log4J hanging around. Do two things:

          1) Post the results from entering: $JAVA_HOME/bin/java

          2) Change the OPTS env var in run.conf, adding the option '-verbose:class'. Then start the app server again, redirecting the output to a file (you will get a lot of output). Then grep the file for 'log4j'. This should tell you which JAR file the log4j classes are in. When I did this, I saw (among many other lines of grep results):

          [Loaded org.apache.log4j.spi.AppenderAttachable from file:/opt/jboss-4.2.0.GA/lib/log4j-boot.jar]
          [Loaded org.apache.log4j.Category from file:/opt/jboss-4.2.0.GA/lib/log4j-boot.jar]
          [Loaded org.apache.log4j.Logger from file:/opt/jboss-4.2.0.GA/lib/log4j-boot.jar]
          [Loaded org.apache.log4j.Priority from file:/opt/jboss-4.2.0.GA/lib/log4j-boot.jar]
          [Loaded org.apache.log4j.Level from file:/opt/jboss-4.2.0.GA/lib/log4j-boot.jar]
          [Loaded org.apache.log4j.LogManager from file:/opt/jboss-4.2.0.GA/lib/log4j-boot.jar]

          • 2. Re: Issue with JBoss 4.2.1
            j_lalith

            Yes you are correct, old log4j file was in one of my applications, I had to upgrade it to the new one, now I could get the application server up.

            Isn't there a better way to achieve the log4j class loading in isolation instead of impacting the other running applications.

            Thanks

            • 3. Re: Issue with JBoss 4.2.1
              peterj

              If you scan through the forums you will see that log4j issues with classloading is a headache frequently encountered by users of JBoss AS. The best solution appears to be to banish log4j.jar from any deployed apps.

              By the way, I hope that you do not have the CLASSPATH env var set.

              • 4. Re: Issue with JBoss 4.2.1
                j_lalith

                I do not have CLASSPATH env variable set up,

                I think this is something to do with the classloading

                Yes you are correct, we got two options

                1) delete the log4j from the other projects

                2) update the jboss log4j with other projects

                even though above works, It doent look nice, the best way is how you manage the log4j classloading in a isolated way, I believe jboss will work on this, so that
                the installation is straight forward without any impacts from the other loaded jars.

                Thanks

                • 5. Re: Issue with JBoss 4.2.1
                  franckl

                  This is just a problem with LOG4J class.
                  With version higher than 1.2.8, the TRACE field is added.
                  You probably forgot a reference to an older version of LOG4J.
                  check all your LOG4J references in your project.