users@glassfish.java.net

How to connect to Remote EJB within a EJB Application

From: <glassfish_at_javadesktop.org>
Date: Wed, 27 Jan 2010 10:24:49 PST

Hello all,

Environment:

[b][i]Sun GlassFish Enterprise Server v2.1 (9.1.1) (build b60e-fcs)
Windows XP Pro & Linux
Java SE 1.5
Java EE Version 5[/i][/b]

Issue:
Connect from a GF 2.1 to a remote EJB (runs on Websphere 6.1 EJB 2.1)

I read the GF Ejb Faq and found some ways to connect remote ejb. I can't use it within a webcontainer (solution with sun-web.xml) and i can't use it as programmatic way implements in ejb or something else. Why? we have to use a addiontional jar file to use a internal ejb lookup with a jndi alias ("ejb/MyService").

So i have to configure a jndi entry for a "external jndi resource" like this: corbaname:iiop:<host>:<port>#<global_jndi_name> e.g. corbaname::myhost:1500/NameServiceServerRoot#ejb/MailerService (that is WAS 6.1 corba url!)

But i can't use the jndi lookup with follow parameters inside web admin gui for external jndi resources:

[i][b]ejb/MailerService

foo.mypackage.MailerServiceRemote

com.sun.jndi.cosnaming.CNCtxFactory

corbaname::myhost:1500/NameServiceServerRoot#ejb/MailerService_2_3 [/b] [/i]

Stacktrace:

[b]javax.naming.NameNotFoundException: No object bound to name java:comp/env/ejb/MailerService
        at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:856)
        at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:173)
        at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:407)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)[/b]

If check this jndi enty with the admin console, the server will found it .. but i can't connect to the remote ejb ...

$ ./asadmin.bat list-jndi-resources
ejb/MailerService

Any Ideas or Tips?

Thx in advance
Hootch
[Message sent by forum member 'hootch' (geramaya_at_gmail.com)]

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