Hi,
I have to deploy 2 jar files in JBoss2.1 for my EJb based application - jar1 containing bean1 and jar2 containing bean2
 
In bean 2  I lookup bean1 using ctx.lookup("java:comp/env/bean1").
 
Using the jar tool ejx.jar i edit the xml's of jar2 and map the ejb-reference "bean1"  to bean1's JNDI name
 
I place both jars in the deploy directory and start the jboss server
 
When trying to invoke bean 2 methods from my application client
on the Server side i get the Exception :- 
        java.lang.NoClassDefFoundError:  bean1
 
So i placed jar1 containing bean1  in the lib/ext   directory.
 
This solved my problem and  my application works properly.
 
But the side-effect is  that since i have   jar1 containing bean1 files in lib/ext,
whenever i run the jar tool ejx.jar and whatever jar i open any jar for editing it always opens the xml's of jar1.
(My feeling is the META-INF/ejb-jar.xml  is loaded using ClassLoader.getResourceAsStream and since
lib/ext is the first thing in the CLASSPATH that xml will always be the one which is read).
 
 
So I need to remove the jar1  from  lib/ext when i want to run ejx.jar  but i need to put it back when i want
to run the jboss server.
 
I can try to have another copy of jar1 (minus the xml files) in lib/ext . But it is a big headache with multiple
copies of  jars with just the xml's  missing.
 
I reason there must be a better solution than this and moreover it is a big nightmare explaining installation
instructions to our clients which has to take care of these issues.
 
What is the cleanest way  to look up one bean in one jar from another bean in another jar
and where should the classpath be set?
  
I have looked at the archives and could not find a satisfactory solution.
 
 
Thanks in advance,
Munesh Gupta

Reply via email to