File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Error in JNDI lookup (from Tomcat to Sun ONE Studio) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Error in JNDI lookup (from Tomcat to Sun ONE Studio)" Watch "Error in JNDI lookup (from Tomcat to Sun ONE Studio)" New topic
Author

Error in JNDI lookup (from Tomcat to Sun ONE Studio)

Y´┐Żako M.
Greenhorn

Joined: Feb 18, 2004
Posts: 1
Hi!
I'm trying to lookup a EJB from a web module. There's no problem when I use 'Sun ONE Application server' as both ejb and web container. Now, I want to use Tomcat as web container. The code for the lookup looks like this:
java.util.Properties env = new java.util.Properties();
env.setProperty("java.naming.factory.initial","com.sun.jndi.cosnaming.CNCtxFactory");
env.setProperty("java.naming.provider.url", "iiop://localhost:3700");
InitialContext ctx = new InitialContext(env);
beanHome = ctx.lookup("ejb/TestEJB");

In the first case (only 'Sun ONE App. server) the call to ctx.lookup() returns a reference to the bean's home interface, but the same call from Tomcat returns a CORBA class (com.sun.corba.se.internal.iiop.CDRInputStream_1_0$1).
Can someone help me?
Thanks in advance.
Balaji Thirnrayan
Greenhorn

Joined: Nov 13, 2003
Posts: 8
Did you solve this problem, If yes please let me know how you solved as I cannot get it working.
Mani Narayanan
Greenhorn

Joined: Feb 20, 2004
Posts: 5
Trying changing the initial context factory class, the context factory which you have provided may work with Sun ONE App server.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error in JNDI lookup (from Tomcat to Sun ONE Studio)
 
Similar Threads
EJB JNDI lookup problems from Tomcat Standalone
JNDI Lookup running on another Machine
Identity propagation from web-tier to ejb-tier
Closing The connection (Database)
Lookup strings question