cancel
Showing results for 
Search instead for 
Did you mean: 

Ear to Ear reference

Former Member
0 Kudos

Howdy folks, We have Ear1 and Ear2. In Ear1 we have a class that is used by Ear2. We make an API reference to it for compile time but at deploy time we get a ClassDefNotFound. We do have Ear1 being referenced in Ear2's application-j2ee-engine.xml.

Question: Is the Ear to Ear reference only used to share EJB's ONLY or can we refer to other classes in the package?

Thanks,

Brian

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Brian,

I guess your EAR project contains ony your EJB and Web module project references. You actual classes in EJB or Web Module project. So, take reference of relative project instead of taking reference of EAR project.

Regards.

Bhavik

Former Member
0 Kudos

Hi Bhavik, Thanks for replying. The class we are trying to use is in a Java Project contained in the Ear. We cannot refer to the Java Project directly in application-j2ee-engine.xml. We are only allowed to refer to J2ee libs/interfaces or Ears. We created a shell of an EJB to satisfy the Ear spec but we are trying to reach a simple class to see if it can be done.

Does this help clarify why we want to know if this is possible?

Thanks

Former Member
0 Kudos

HI Brian,

Where you want to use classes contained in that java project?

If you want to use in EJB prject then directly give reference in EJB project. Same thing for Web module project also.

Regards,

Bhavik

Former Member
0 Kudos

Hi, I don't understand. Let's say I wanted to refer to it in my EJB just to make life simple. How does one reference the project? I am already referring to it as a used DC and it compiles. When I deploy it fails saying class not found meaning the classloader does not know what I refering to. I am referencing the EAR file but that reference is not exposing ALL classes. This takes me back to the original question:

When one Ear refers to another EAR, what is exposed in that used EAR i.e. What can I "use" in the EAR, just EJB's or can I use more? and if more then how?

Does this help?

Thanks,

Brian

Former Member
0 Kudos

Hi Brian,

Remove your java project from the used dc.

Now add that java project once again.

When you have added your java project as used dc in your ejb, there are various checkboxes for dependency check.

There, uncheck deploy time and runtime check mark.

It is checked by default. So, when you deploy it will check its dependancy and it is giving such error.

Regards,

Bhavik

P.S. Don't forget to award points if it was helpful.