cancel
Showing results for 
Search instead for 
Did you mean: 

EAR DC used DC's

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Marc,

>Assembly only works for DCs that produce some deployable result (like an EAR) and dependencies are not transitive.

Too bad. I was hoping to include my Java DC in my ejb's without the ear having any knowledge of it. Also, I didn't want to create a J2EE Server library because I may want to have several versions of the classes in the Java DC available at the same time on the server (exp : utility classes).

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

Thanks

Message was edited by: Thierry

Thierry Dagnino

Former Member
0 Kudos

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

Answers (0)