users@glassfish.java.net

How deploy a session ejb more then once?

From: <glassfish_at_javadesktop.org>
Date: Wed, 18 Jul 2007 06:28:28 PDT

Hi,

we have the following deployment problem using EJB 3.0 with Annotations on Glassfish.
We implement a Entity EJB (FormEntry) and a Session EJB (Form).
The Session EJB uses the Entity EJB to save the data into a derby database.
The Session EJB also publish a Web Service with the business methods of our Forum Bean.
Our forum Application consists of an Web Module and a EJB Module bundled into a EAR File.
So far everything works well.

Now we try to deploy the Application more then once on one glassfish domain. Every Forum should connect to a different Database and run independent from each other.
As we annotate the Session EJB as a @local EJB the applications working well.
But if we need to annotate the Session EJB as @remote (for example to run external JUnit Tests, or to deploy the WebService) we run into problems. Only one instance of the EAR could be deployed successfully as the next EAR will create a jndi name conflict with the @Remote EJB.
Our idea was now to annotate the Session EJB with @Local and add a additional Deployment Descriptor (ejb-jar.xml) into the EJB Module. In the ejb-jar.xml we try to create the remote EJBs. But we failed. We also found no example for such a additional deployment descriptor.
Is it possible to declare additional Remote EJB Names in a ejb-jar.xml when the EJB is still annotated with @Local Annotation ?
Also our Web Service is annotated in the source code and so also conflicts because after the deployment all applications have the same web service Name. :-(

Thanks for your help or any hints.
Ralph
[Message sent by forum member 'rsoika' (rsoika)]

http://forums.java.net/jive/thread.jspa?messageID=227101