| Author |
How to deploy 2 EJB's in separate jars
|
le taylom
Ranch Hand
Joined: Dec 01, 2000
Posts: 44
|
|
Hi, I have successfully deployed 2 session ejb's in the same jar file, i.e. with one ejb-jar.xml and one weblog-ejb-jar.xml. And get get the ejb's to communicate with each other. Now I want to be able to compile and deploy the 2 ejb's in separate jar files as part of an ear file. My method so far is this: I have split the ejb-jar.xml file into two, for each ejb, and also the weblogic-ejb-jar.xml file into two for each ejb. I then compiled the ejb source files and packaged each ejb up with its respective deployment descriptors into two separate .jar files. I then want to run weblogics ejbc on each .jar file in turn so that the resultant .jar files (with newly created stubs/skels) can be packaged into an .ear to be easily deployed into weblogic. I try and run the ejbc command on the first of the .jar files and i get the error: ERROR: Error from ejbc: In ejb-jar.xml, the EJB 'SessClient' contains an invalid ejb-link in ejb -ref 'ejb/SessLogHome'. No EJB with ejb-name 'IntellectStateless.jar#SessLog' co uld be found. ERROR: ejbc found errors My ejb-jar.xml file for this ejb is: and both of my .jar files are in the same directory when I run the ejbc command. I'm sure this can be done but I just think i'm not doing it in the right order maybe?? Anyway pointers will be gr8ly appreciated. Cheers T
|
 |
Marcos Maia
Ranch Hand
Joined: Jan 06, 2001
Posts: 977
|
|
HI, take out the ejb-ref tag, you�re not required to provide it.
|
 |
le taylom
Ranch Hand
Joined: Dec 01, 2000
Posts: 44
|
|
Okay here is the solution to how to achieve the problem I encountered above: I am compiling my ejb.jar files using the weblogic.ejbc compiler, obviously I am deploying on weblogic here. This section: must have JUST the <ejb-link/> tag removed from the ejb-jar.xml file. And then the weblogic-ejb-jar.xml file MUST look like this: Note the <refererence-descriptor> tag as the important part. After these changes, the 2 ejb.jar files can be compiled using the weblogic.ejbc tool, thus supplying the stubs/skels, and then the resultant two ejb.jar files can be added to the EAR file and deployed to weblogic. Result: 2 ejb's in separate jars, in one EAR file, talking to each other. T
|
 |
Karl Laird
Ranch Hand
Joined: Jul 14, 2001
Posts: 67
|
|
|
The reason for this is because the specification specifies <ejb-link> as only being able to be used when the EJB's are part of the same Jar. Otherwise you must use the <ejb-ref> if you want this explicit linking between ejbs to be performed
|
The Eagle sneers at the Peacock<p>Systems Administrator<br />OrderWare Solutions Ltd<br /><a href="http://www.orderware.net" target="_blank" rel="nofollow">http://www.orderware.net</a>
|
 |
 |
|
|
subject: How to deploy 2 EJB's in separate jars
|
|
|