ejb@glassfish.java.net

Sun Webserver can't bind to EJB on Sun App Server?

From: Orest Guran <Orest.Guran_at_Sun.COM>
Date: Wed, 18 Apr 2007 11:41:44 -0600

Hi,

I seem to be having a problem accessing EJB's (EJB3.0) from a servlet
running on a remote Sun Java Systems Webserver (6.1). I am using the Sun
App Server (sun-appserver-pe9.0). Although the webserver connects to
the JNDI service on the Sun App Server, if fails to bind to the ejb. I
followed the directions from the EJB FAQ as shown on
"https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html"

I tried the same code running as a standalone class and had no problems
accessing the bean. For kicks, I deployed the same EJB on a JBOSS App
Server (4.0.5) and was able to bind to the EJB without any problems
using the same servlet running on the remote Sun Java Systems Webserver!

It appears to be some kind of interaction between the Sun App Server/Sun
Webserver and the JNDI lookup. The only difference between the servlet
code used to access the bean on the Sun App Server and the JBOSS
Appserver is in the properties settings used to instantiate the
InitialContext object in the servlet:

SunAppServer Props:
     props.put("java.naming.provider.url", "iiop://localhost:3700");
     props.put("java.naming.factory.initial",
"com.sun.enterprise.naming.SerialInitContextFactory");
     props.put("java.naming.factory.url.pkgs","com.sun.enterprise.naming");

JBOSS Props:
     props.put("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
     props.put("java.naming.provider.url", "jnp://localhost:1099");
     props.put("java.naming.factory.url.pkgs","org.jboss.naming.client");

Also, I had to use a different lookup string. The JBOSS App Server found
the bean using the following naming format (
ic.lookup("CalculateBean/remote") ). The standalone class was only able
to access the bean running on the Sun App Server using the fully
qualified Remote Interface path (
ic.lookup("entapp1.ejb.CalculateRemote") ).


Any ideas what I may be doing wrong when I try to access a bean running
on the Sun App Server from the Sun Web Server? Any help you can give
would be appreciated.

Thanks,
Orest