4 Replies Latest reply on Jul 12, 2006 1:38 PM by javidjamae

    Configure class loading application wide?  EJB cannot find w

    lpmon

      I have an ear with a web module and an EJB3 module. When my first EJB3 MBean tries to load it cannot find the classes in my web module's WEB-INF\classes folder nor in the WEB-INF\lib folder.

      I suspect the secret maybe in jboss-app.xml but the docs are NOT CLEAR AT ALL or I have just not found the best docs.

      This should be simple!

        • 1. Re: Configure class loading application wide?  EJB cannot fi
          javidjamae

          The servlet spec calls for isolated classloading. So by default, Web apps in JBoss do not share the same classloading cache as EJBs do. You'll have to modify this file:

          [JBoss]/server/[configuration]/jboss-tomcat55.sar/META-INF/jboss-service.xml

          and change to the following values:

          true
          true

          Yes, the documentation on JBoss classloading is a bit esoteric.

          • 2. Re: Configure class loading application wide?  EJB cannot fi
            javidjamae

            Sorry, it cut out my XML. Here are the values you need to set.

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


            • 3. SOLVED: Configure class loading application wide?  EJB canno
              lpmon

              Well, partly solved. It was a Tomcat class loading methodology issue.

              The change below did the trick for me with the exception of loading order. The scheduler is still loading before my classes

              Thanks to: Javid Jamae

              THE FIX:

              In file: [JBoss]/server/[configuration]/jboss-tomcat55.sar/META-INF/jboss-service.xml

              Add or change these attributes to true:

              true
              true

              • 4. Re: Configure class loading application wide?  EJB cannot fi
                javidjamae

                I'm not sure which scheduler you are talking about, but you could try to use the PrefixedDeploymentSorter setting on the URLDeploymentScanner in the following file:

                [JBoss]/server/[configuration]/conf/jboss-service.xml

                Just use a numeric prefix on your application.

                Or, using the regular deployment sorter you can put ".last" on your application to make sure that it is deployed last.