4 Replies Latest reply on Dec 15, 2005 3:26 AM by mroosendaal

    Cannot load class from another deployed ear

    vanjo_83

      Hi there, I have the following problem with version 4.0.3SP1: I deploy two J2EE applications (ears) and from one of them I try to load through reflection a class, which is located into the other ear. I get ClassNotFoundException. I deployed the same applications on version 3.2.5 and it worked fine. I tried to change the setting in ear-deployer.xml like this

      <attribute name="Isolated">false</attribute>

      but I still didn't work.
      Can you help me with this issue please?

        • 1. Re: Cannot load class from another deployed ear
          vanjo_83

          Guys, this doen't work even if the two components are part of one EAR. The one is .WAR, and the other is .JAR, described if application.xml as:

           <module>
           <web>
           <web-uri>TransporterWAR.war</web-uri>
           <context-root>transporter</context-root>
           </web>
           </module>
           <module>
           <java>PMS_Servlet.jar</java>
           </module>
          

          Don't confuse, PMS_Servlet.jar is not a servlet, it's just the part of my application that should go to the servlet container

          • 2. Re: Cannot load class from another deployed ear

            have you tried the ClassLoadingConfiguration instructions from the wiki-site?

            Perhaps you can define a common loader-repository for both ears in their respective jboss-app.xml's

            • 3. Re: Cannot load class from another deployed ear
              vanjo_83

              I solved the problem, changing this property like that

              <attribute name="UseJBossWebLoader">true</attribute>

              in ...deploy\jbossweb-tomcat55.sar\META-INF\jboss-service.xml
              and it works at least when the two modiles are in one ear. I haven't tried it when in two ears yet. About the ClassLoadingConfiguration I'm not sure if I understood everything in that article, but I added the following tags in jboss-web.xml and jboss-app.xml
              <loader-repository>dot.com:loader=blablabla</loader-repository>

              This didn't help. :(
              I don't believe that this solution is the right one, so if anybody knows better it will be great to share it with me :)

              • 4. Re: Cannot load class from another deployed ear

                Same problem and solution here. I found the same setting yesterday and it worked. I have a ServiceLocator which holds a reference to the SpringAppContext and it works fine now.