Skip to Content
author's profile photo Former Member
Former Member

EAR DC used DC's

Hi,

we have an EAR DC which contains a EJB jar (DC) . The EJB DC uses a Java DC which has common classes used by many DC's in different SC's. The EJB DC has a reference to a compilation and assembly public part of the Java DC so I assume this means when we build the EJB DC , the jar file for the Java DC should be packaged in the EJB jar. Why must I set an explicit reference from the EAR DC to the Java DC for deployment to work ? I would expect the EJB should have references to the DC's it needs to use but the ear should only need to know the modules that we add to it.

Thanks for your advice .

Thierry

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Mar 02, 2007 at 03:29 PM

    Hi Thierry,

    no, your assumption is not quite correct. A dependency from an EJB DC to an assembly public part of another DC does not have any effect unless you also have an entity reference in an assembly public part of the EJB DC which references the assembly public part of the other DC. Assembly only works for DCs that produce some deployable result (like an EAR) and dependencies are not transitive.

    The alternative is to create a J2EE Server component library, assemble that Java DC into that and have a runtime dependency from the EAR DC to the J2EE library DC (or an appropriate entry in the application-j2ee-engine.xml).

    Regards,

    Marc

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Thierry,

      > I was hoping to include my Java DC in my ejb's without the ear having any knowledge of it.

      I haven't tried that but from the theory behind it: If you add an "Entity Reference" that points to the assembly public part of your Java DC to the assembly public part of the EJB DC then that should produce what you want.

      > For the application-j2ee-engine.xml addition, I thought we shouldn't do this anymore in when using components.

      You are right, you should not. Unless it is the only solution for the codeline/SP you are using. Older 6.40 plugins don't support auto-creation of the application-j2ee-engine.xml during build, 7.00 plugins usually can create the file but don't if the file exists in sources. If you need to reference something at runtime that isn't available as a DC (which "should" not happen...) having the descriptor file is at least a working workaround even if you don't get deploy-dependencies that way....

      Regards,

      Marc

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.