2 Replies Latest reply on Aug 24, 2005 5:11 PM by jdestef

    EJB3 Deployment Problem

    jdestef

      Hi,

      I have a .ejb3 jar file deployed in an ear. There are some additional jar files in the ear. Those files contain support classes for the ejb's in the ejb3 jar. When I invoke a method on one of the beans in the ejb3 jar I get a ClassNotFound exception. The class that's not found is in one of the jar files deployed in the ear. That jar file is found no where else in the classpath of the server.

      If I put the support jars in the deploy/lib directory of the server then everything works fine.

      I though by putting the jars in the ear file they would also be visible to the beans in the ejb3 jar. They are both in the same ear. This doesn't appear to be happening?

      Any thoughts. I would preferr to package everything in a single ear.

      Thanks

        • 1. Re: EJB3 Deployment Problem
          michael_c_small

          Are you including those files in your ear's META-INF/application.xml? It would be something like:

          <application>
           <display-name>some name</display-name>
           <java>someutil1.jar</java>
           <java>someutil2.jar</java>
           <ejb>someentities.ejb3</ejb>
          </application>
          


          In the above, someutil1.jar and someutil2.jar are your supporting jars.

          • 2. Re: EJB3 Deployment Problem
            jdestef

            Hi,

            Thanks for the suggesstion.

            This seems to work:

            <?xml version="1.0" encoding="UTF-8"?>
            <application version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
             <display-name>hhseebeyondmonitor</display-name>
             <module>
             <java>sample1.jar</java>
             </module>
             <module>
             <java>sample2.jar</java>
             </module>
             <module>
             <java>mx4j.jar</java>
             </module>
             <module>
             <java>mx4j-tools.jar</java>
             </module>
             <module>
             <ejb>myejb.ejb3</ejb>
             </module>
            </application>