ejb@glassfish.java.net

Re: Access to EJB's from Tomcat

From: Kenneth Saks <Kenneth.Saks_at_Sun.COM>
Date: Wed, 16 Aug 2006 10:06:00 -0400

Daniel Cavalcanti wrote:

> Ken,
>
> I'm trying to do that too using the latest (Linux) build but still get
> the NameNotFoundException...

Hi Daniel,

Is it the last main(v2) Promoted or the latest main(v2) Nightly? The next
promoted is scheduled for today so you'd need a nightly until that
happens.

My code is the same as Glenn's except that I didn't set the host/port
properties,
which shouldn't matter since his host/port properties are set to the
defaults anyway.

> Properties props = new Properties();
> props.setProperty("java.naming.factory.initial",
>
> "com.sun.enterprise.naming.SerialInitContextFactory");
> props.setProperty("java.naming.factory.url.pkgs",
> "com.sun.enterprise.naming");
> props.setProperty("java.naming.factory.state",
>
> "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
>
> try {
>
> InitialContext ic = new InitialContext(props);
> Sless sless = (Sless) ic.lookup(Sless.class.getName());
> Object returnValue = sless.hello();
> out.println(returnValue);
>
If the lookup is failing and you have the build with the bug fix, it's
possible
the global jndi name used in the client code does not match the target
Remote EJB. Try double-checking that. We have more details on how
the global ejb JNDI names work in our faq :

https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html

If you're still seeing problems, please post the stack trace and the
client code.

 --ken

 

>
>