4 Replies Latest reply on Dec 30, 2004 4:59 PM by Frank Langelage

    Major classloader issues with multiple ear files

    Sunondo Ghosh Newbie

      I have two ear files which I am trying to run in JBoss 3.2.3. Each one runs fine independently. When I run both together, one of the ear files uses a Class with the same package name from the other and gives a MethodNotFoundException. After I changed the package name of the Class, the ear file started using a properties file from the other.

      I have specified different jboss-app.xml files in each ear file under the meta-inf dir. I am including those below:

      Ear 1:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss-app PUBLIC "-//JBoss//DTD J2EE Application 1.3//EN" "http://www.jboss.org/j2ee/dtd/jboss-app_3_2.dtd">

      <jboss-app>
      <loader-repository>jboss.loader:loader=suppliernet</loader-repository>
      </jboss-app>

      Ear 2:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss-app PUBLIC "-//JBoss//DTD J2EE Application 1.3//EN" "http://www.jboss.org/j2ee/dtd/jboss-app_3_2.dtd">

      <jboss-app>
      <loader-repository>jboss.loader:loader=selfreg</loader-repository>
      </jboss-app>

      I will really appreciate any help!


      I am running JBoss on Linux.

      Thanks,

      Sunondo

        • 1. Re: Major classloader issues with multiple ear files
          Scott Stark Master

          Re-read:

          http://www.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration
          http://www.jboss.org/wiki/Wiki.jsp?page=JBossClassLoadingUseCases

          to understand why the jboss-app.xml should look like:

          <jboss-app>
           <loader-repository>
           jboss.loader:loader=suppliernet
           <loader-repository-config>
           java2ParentDelegation=false
           </loader-repository-config>
           </loader-repository>
          </jboss-app>
          



          • 2. Re: Major classloader issues with multiple ear files
            Scott Stark Master

            Also, meta-inf/jboss-app.xml is wrong. Jar files use case sensitive entries, so it may just be that the scoping is not being applies. The entry must be META-INF/jboss-app.xml.

            • 3. Re: Major classloader issues with multiple ear files
              anu katta Newbie

              Hi I am getting this error, when I deploy my core.ear file on Jboss 4.0 with tomcat webserver. But the same ear file when I deployed on jboss 3.0 with jetty webserver is working good.
              Can any body help what should I do to get rid of this error.

              15:52:51,041 ERROR [BaseModelMBean] Error creating class org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4JLogger does not implement Log
              15:52:51,054 ERROR [WebModule] Starting failed jboss.web.deployment:id=472513922,war=core.war
              org.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (ReflectionException: Cannot find setter method setDocBase null Cause: java.lang.NoSuchMethodException: org.apache.commons.modeler.BaseModelMBean.setDocBase(java.lang.String))
              at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:379)
              at org.jboss.web.WebModule.startModule(WebModule.java:62)
              at org.jboss.web.WebModule.startService(WebModule.java:40)
              at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
              at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
              at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:324)
              at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
              at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
              at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
              at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
              at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
              at $Proxy0.start(Unknown Source)
              ---
              Thank in advance.
              --Anu.

              • 4. Re: Major classloader issues with multiple ear files
                Frank Langelage Master

                The ear-file or one of the modules within it has included it's own commons-logging.jar.
                Remove this and you'll get rid of this error messages.
                JBoss already has commons-logging.jar on board.