1

I have two ejb jars packaged into a ear. say EJb1.jar adn Ejb2.jar. I am deploying it in Webphere 7.0. Ejb1 is referencing to classes in Ejb2.jar. Unless I specify the Ejb2.jar in Manifest.Mf file of Ejb1.jar, the deployment of EAR file fails.

Throws error that build path is incomplete and that referenced class is not found.

Is there any way I can overcome this ? Through some settings in WebSphere console?

I have too many ejb's in this ear referencing each other. It makes things really difficult to update manifest file each time we make code changes.

Any ideas ?

Aviram Segal
  • 10,962
  • 3
  • 39
  • 52

1 Answers1

0

If you want to avoid that what you need to do is create and EJB Client Jar which holds the interfaces and put it in the EAR/lib directory.

For example if EJB1.jar got MyBean.java and MyBeanLocal.java you will now split it to 2 jars files:

EJB1.jar (EJB Module) holding MyBean.java and EJB1-Client.jar (Utility Jar) holding MyBeanLocal.java

Then you put EJB1-Client.jar in the EAR file lib directory and EJB2.jar will be able to find the interfaces in its classpath.

Aviram Segal
  • 10,962
  • 3
  • 39
  • 52
  • Thanks for the input. But I see the current EAR setup working fine with my other team members and other development environments. Is there any configurable change I can do ? at Websphere console ? To make it ignore the reference issues ? – ravi shankar Dec 19 '12 at 10:18
  • Not that I know of, the Manifest is something that you usually need to do when you need one module to see another module (jars in lib are automatically added to the classpath) – Aviram Segal Dec 19 '12 at 10:20