facebook

Runtime Dependencies (Missing from EAR)

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #269835 Reply

    jcorbin4607
    Member

    Hello,

    I have basic J2EE application that is being deployed on JBOSS 4.0.4. It consists of a EJB and WEB Application. The Web Application uses Struts.

    The EJB layer has a dependency to Hibernate 3.1. When I run the application I get ClassNotFoundExceptions on the Hibernate EHCache classes. I know this is because the hibernate libraries aren’t visible at runtime.

    What I am wondering is how best to tell MyEclipseIDE to deploy the dependent hibernate jar files.

    I would like to keep the Hibernate details deployed as part of the EAR, so I do not have to copy libraries into the JBOSS installation.

    I know this problem has been solved already. I would appreciate a solution so I can get these runtime depency problems resolved for the hibernate libraries.

    Regards,
    J

    #269861 Reply

    Loyal Water
    Member

    Have you maually added the Hibernate jars? If you have added the JARs yourself the default deployment policies will deploy the file, but you should double-check what deployment policy is set. You can go to Windows > Preferences > MyEclipse > Web Projects > Depolyment tab and check the policy.

    Read Section 10.1 *Dependent Java Project Setup and Deployment Policy Configuration* to get a better understanding of the deployment policies.
    http://myeclipseide.com/enterpriseworkbench/help/index.jsp?topic=/com.genuitec.myeclipse.doc/html/quickstarts/webprojects/index.html

    #269862 Reply

    jcorbin4607
    Member

    @support-nipun wrote:

    Have you maually added the Hibernate jars? If you have added the JARs yourself the default deployment policies will deploy the file, but you should double-check what deployment policy is set. You can go to Windows > Preferences > MyEclipse > Web Projects > Depolyment tab and check the policy.

    Read Section 10.1 *Dependent Java Project Setup and Deployment Policy Configuration* to get a better understanding of the deployment policies.
    http://myeclipseide.com/enterpriseworkbench/help/index.jsp?topic=/com.genuitec.myeclipse.doc/html/quickstarts/webprojects/index.html

    Manually adding the jars to the lib directory under my JBOSS server will indeed solve the problem. To me that is a workaround. I want to deploy the hibernate dependencies within the EAR if that makes sense. I’ve read the section you mentioned above. That seems to work for dependent projects but not 3rd Party Library components like Hibernate.

    Seems like my only solution at this point is to replace the hibernate jars that are in my servers lib directory with the ones that are bundled with MyEclipseIDE.

    J.D.

    #269869 Reply

    Loyal Water
    Member

    Hi J.D.
    Sorry, I should have been more clear with my words. By *Manually Added* I meant have you added Hibernate Capabilities to your project or have you added the jars to your project manually before deployment? Can you see the Hibernate jars in your package explorer?

    #269870 Reply

    jcorbin4607
    Member

    @support-nipun wrote:

    Hi J.D.
    Sorry, I should have been more clear with my words. By *Manually Added* I meant have you added Hibernate Capabilities to your project or have you added the jars to your project manually before deployment? Can you see the Hibernate jars in your package explorer?

    No worries. I added the Hibernate Capabilities to the EJB Project from the MyEclipse menu as is standard practice in MyEclipseIDE.

    J

    #269872 Reply

    Loyal Water
    Member

    Can you create a test EAR with a EJB/Web module, add Hibernate to the EJB and deploy to see if this happens? And then try playing with deployment setting to see if you can get it to deploy those libs?

    For example, try exporting them from the EJB?

    #269875 Reply

    jcorbin4607
    Member

    @support-nipun wrote:

    Can you create a test EAR with a EJB/Web module, add Hibernate to the EJB and deploy to see if this happens? And then try playing with deployment setting to see if you can get it to deploy those libs?

    For example, try exporting them from the EJB?

    I have an EAR with an EJB/Web Module and t he EJB module does have the Hibernate Capabilities added. I deployed the EAR to JBOSS and started getting ClassNotFoundExceptions on the EhCache stuff. I went ahead and found the EhCache (v1.1) jar in the MyEclipseIDE installation and copied it to the <server>/lib directory on JBOSS which I knew would solve the runtime dependency.

    If have some experience with the deployment settings in MyEclipseIDE but not so much with dependent libs only dependent projects. How can I export the libs?

    Regards

    #270042 Reply

    Loyal Water
    Member

    You can create new java project and add the hibernate libraries to that project. Add this Java project as a dependency to the J2EE app. This will add the hibernate libraries when you deploy the J2EE app.

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: Runtime Dependencies (Missing from EAR)

You must be logged in to post in the forum log in