users@glassfish.java.net

Re: Interop with Glassfish and other application servers

From: <glassfish_at_javadesktop.org>
Date: Thu, 20 Dec 2007 02:12:28 PST

Hi again,

after some cleanup in my project in tried to solve my injection problems again, but this time starting with a more simpler set up, but i still encounter problems, maybe someone can point out what i am missing here.

When deploying the EJB and the calling servlet within a single ear file i can inject the EJB in the servlet using the plan @EJB annotation without any problems. When i split the ear into a war containing the servlet and a jar containing the EJB i can inject the EJB when i use the corbaname in the @EJB mappedName attribute and use the global JNDI name i specified with the @Stateless annotation's mappedName attribute in the EJB and deploy both archives on the same server instance. The injection on glassfish looks like this: @EJB(mappedName="corbaname:iiop:1.2_at_localhost:3700#NamedSecurityBean") private SecurityTest secTest;

But when i deploy the archives on different instances, even when they are of the same appserver type, the lookup fails. I am not using any ejb related tags in the web.xml and no deployment descriptors at all in the .jar file. The EJB interface is annotated as @Remote and the implementing bean as @Stateless(mappedName="NamedSecurityBean"). When listing all JNDI entries from a stand alone client i can see the NamedSecurityBean being displayed with exactly this name.

Can anyone tell me, why this is only working within the same application server instance? I am really puzzled here, the JNDI name should be correct in my opinion since it was explicitly set in the @Stateless annotation.

Thanks in advance, Chris
[Message sent by forum member 'candlejack' (candlejack)]

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