I would rather put the shared class files into both WAR and EJB-JAR files.  The major 
reason is potentially the WAR may be deployed in a different app server for 
scalibility reason.  In this way you are not sharing the code but packaging the output 
class files into both JAR files.  A simple makefile can do it.  A separate common JAR 
file can do the same thing but why makes thing complicated.

Conrad

-----Original Message-----
From: Mike Cannon-Brookes [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 10, 2000 8:30 AM
To: Orion-Interest
Cc: Robin Rosenberg
Subject: RE: Sharing code between web-app and ejbs


If you just put all your classes in the EJB-JAR file, they can be 'seen' from the WAR 
(no need to worry about the classes dir)

That's the way I do it. Probably not the best way, but it works.

Mike

 -----Original Message-----
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]]On Behalf Of August Linnman
Sent: Thursday, 10 August 2000 9:37
To: Orion-Interest
Cc: Robin Rosenberg
Subject: Sharing code between web-app and ejbs


Hello everyone!

This is maybe not orion-specific (off-topic) but may be relevant anyway.

How can you in a manageable way include "library" code, i e common code in an EAR 
which should be accessible from both the WAR and the EJB-JAR, and also preferably be 
put in the same EAR. The only way I can think of now is to duplicate code between the 
EJB-JAR part and the WEB-INF/classes directory, which is not a very nice solution. 

Another way would be to link the external code through another JAR-file, and tie 
together using a Manifest, but I cannot resolve exactly which Manifest should be used 
(the EAR or the JAR?) and how this should be done. I have read the Sun specs about the 
Jar-manifest format but either they are very unclear, or I have not found the right 
information. 

Any clarity in this matter would be greatly appreciated. 

/August

Reply via email to