10 Replies Latest reply on May 23, 2003 7:48 AM by adrian.brock

    MBean under JBoss 3.0.7 vs 3.2.0

    javant

      Hi,

      I had created an independent MBean service that runs
      fine under the JBoss 3.0.x release, but under JBoss
      3.2.0 I am getting numerous errors they all fall under
      :

      java.lang.LinkageErrors

      duplicate class

      Has any one seen similar problems? Has the classloader for 3.2 changed?

      thanks

        • 1. Re: MBean under JBoss 3.0.7 vs 3.2.0

          Can you post the full stacktrace and details
          about how what relevent classes are deployed where.

          Regards,
          Adrian

          • 2. Re: MBean under JBoss 3.0.7 vs 3.2.0
            javant

            The web page shows the following:

            HTTP ERROR: 500 Error in MBean operation 'startServer()'
            RequestURI=/jmx-console/HtmlAdaptor

            Under JBoss 3.0.7, everything starts up fine and
            my test apps are okay.

            Under JBoss 3.2 - The stack trace:

            14:01:12,745 WARN [ClassLoadingTask] Duplicate class found: com.avaya.eventserv
            ice.EventServiceManager
            Current CS: (file:/E:/jboss-3.2.0/server/default/tmp/deploy/server/default/deplo
            y/mvcsmx.jar/32.mvcsmx.jar <no certificates>)
            Duplicate CS: (file:/E:/jboss-3.2.0/server/default/deploy/mvcsmx.jar <no certifi
            cates>)
            14:01:12,765 WARN [jbossweb] WARNING: Exception for /jmx-console/HtmlAdaptor
            RuntimeErrorException: Error in MBean operation 'startServer()'
            Cause: java.lang.LinkageError: duplicate class definition: com/avaya/eventservic
            e/EventServiceManager
            at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
            nDispatcher.java:307)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
            at org.jboss.jmx.adaptor.control.Server.invokeOpByName(Server.java:240)
            at org.jboss.jmx.adaptor.control.Server.invokeOp(Server.java:209)
            at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.invokeOp(HtmlAdaptorSer
            vlet.java:172)
            at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.processRequest(HtmlAdap
            torServlet.java:78)
            at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.doPost(HtmlAdaptorServl
            et.java:60)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
            at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360
            )
            at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicati
            onHandler.java:294)
            at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:5
            58)
            at org.mortbay.http.HttpContext.handle(HttpContext.java:1714)
            at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplication
            Context.java:507)
            at org.mortbay.http.HttpContext.handle(HttpContext.java:1664)
            at org.mortbay.http.HttpServer.service(HttpServer.java:863)
            at org.jboss.jetty.Jetty.service(Jetty.java:460)
            at org.mortbay.http.HttpConnection.service(HttpConnection.java:775)
            at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:939)
            at org.mortbay.http.HttpConnection.handle(HttpConnection.java:792)
            at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:
            201)
            at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
            at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)
            getTargetError():
            java.lang.LinkageError: duplicate class definition: com/avaya/eventservice/Event
            ServiceManager
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:140)
            at com.avaya.mvcs.MVCSServer.startServer(MVCSServer.java:556)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
            java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
            sorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
            nDispatcher.java:284)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
            at org.jboss.jmx.adaptor.control.Server.invokeOpByName(Server.java:240)
            at org.jboss.jmx.adaptor.control.Server.invokeOp(Server.java:209)
            at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.invokeOp(HtmlAdaptorSer
            vlet.java:172)
            at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.processRequest(HtmlAdap
            torServlet.java:78)
            at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.doPost(HtmlAdaptorServl
            et.java:60)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
            at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360
            )
            at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicati
            onHandler.java:294)
            at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:5
            58)
            at org.mortbay.http.HttpContext.handle(HttpContext.java:1714)
            at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplication
            Context.java:507)
            at org.mortbay.http.HttpContext.handle(HttpContext.java:1664)
            at org.mortbay.http.HttpServer.service(HttpServer.java:863)
            at org.jboss.jetty.Jetty.service(Jetty.java:460)
            at org.mortbay.http.HttpConnection.service(HttpConnection.java:775)
            at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:939)
            at org.mortbay.http.HttpConnection.handle(HttpConnection.java:792)
            at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:
            201)
            at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
            at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)

            • 3. Re: MBean under JBoss 3.0.7 vs 3.2.0
              javant

              Hi,

              Forgot to add. I am deploying under server/default
              for JBoss 3.0.7 and 3.2 . I am deploying exact JAR
              files and user-service.xml file. The only difference
              is JBoss version.

              thanks

              • 4. Re: MBean under JBoss 3.0.7 vs 3.2.0
                javant

                Adrian,

                I like to add more information to the above problem
                that I am having. In looking over the server.log for 3.0.7 and 3.2.x, I am seeing extra active in 3.2.X.

                In JBoss 3.2.X, I am seeing lines that state that
                org.jboss.system.ServiceController is starting my
                custom MBean as well "starting dependent components".

                In JBoss 3.0.7, there are no such lines present.

                I am only guessing, but if ServiceController is really
                loading/starting my MBeans and dependent components then I will have problems unless I can
                turn off ServiceController as it relates to my MBeans???

                Do you have any thoughts on why I may be seeing
                these differences in the server.log

                thanks

                • 5. Re: MBean under JBoss 3.0.7 vs 3.2.0

                  Hi,

                  Ignore the logging, it is just a difference in
                  logging levels between the two versions.

                  Can you post a simple example that reproduces
                  the problem you are seeing as a bug.

                  www.sf.net/projects/jboss

                  You might also try enabling classloader tracing
                  as described in the classloader pdf on the
                  files download page.

                  Regards,
                  Adrian

                  • 6. Re: MBean under JBoss 3.0.7 vs 3.2.0
                    javant

                    Hi Adrian,

                    Thank you. I will work on putting together an
                    example to reproduce the messages. I will also
                    turn on the classloader trace as you suggest.

                    All I am doing is just trying to port the MBeans
                    from 3.0.7 (which works great) to 3.2...

                    Logging level ... I think I had explicitly set them to
                    be the same - I will recheck.

                    thanks again for your help. will be in touch.

                    • 7. Re: MBean under JBoss 3.0.7 vs 3.2.0
                      javant

                      Hi Adrian

                      I managed to solve my duplicate class loading problem
                      by moving all my JARs to the lib directory under
                      JBoss 3.2.X. So the only change I made was
                      moving my JARs from the deploy directory to
                      the lib directory. Can you tell me what is the
                      difference between the "lib" and "deploy"
                      when it comes to classloading?

                      thanks

                      • 8. Re: MBean under JBoss 3.0.7 vs 3.2.0

                        The main difference between lib and deploy
                        is that all the jars in lib are in one classloader,
                        whereas each jar in deploy gets its own classloader.

                        Regards,
                        Adrian

                        • 9. Re: MBean under JBoss 3.0.7 vs 3.2.0
                          javant

                          Hi Adrian

                          Thanks for your patience in working through this
                          with me. The classloader explanation is very helpful.
                          I will have to try a couple of things to better
                          understand what is happening between 3.0.7
                          and 3.2.x ... the only thing that I am doing is just
                          moving my JAR files from "deploy" to "lib" in 3.2.x
                          and all my test apps are happy...

                          If the classloader and classloader scheme has not
                          changed between 3.0.7 and 3.2.x then there must
                          be something funny with my jar packaging ... strange
                          hmmm

                          thanks

                          • 10. Re: MBean under JBoss 3.0.7 vs 3.2.0

                            Hi,

                            Scott who does the classloading,
                            is currently working on making the classloading
                            more intuitive and flexible.

                            If you post your example as a bug at
                            www.sf.net/projects/jboss
                            He might be able to give you more insight.

                            Regards,
                            Adrian