aspose file tools
The moose likes Websphere and the fly likes WebSphere 5.0 EJB JNDI LOOKUP Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Websphere
Reply Bookmark "WebSphere 5.0 EJB JNDI LOOKUP" Watch "WebSphere 5.0 EJB JNDI LOOKUP" New topic
Author

WebSphere 5.0 EJB JNDI LOOKUP

Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
Hello All,


1. Can anybody tell me what are the path and classpath settings for running a standlone java client that does
jndi lookup of an EJB deployed inside WSAD 5.1.2's WebSphere 5.0 Test Environment. I would appreciate how the classpath
settings differ from using IBM JDK/JRE and Sun JDK/JRE


2. Also, I am trying to run a standlone java client that does jndi lookup of an EJB deployed inside
WSAD 5.1.2's WebSphere 5.0 Test Environment

set classpath=D:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v5\java\jre\lib\rt.jar;D:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v5\lib\j2ee.jar;D:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v5\lib\ivjejb35;D:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v5\lib\vaprt.jar;D:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v5\lib\utils.jar;D:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v5\lib\namingclient.jar;D:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v5\lib\namingserver.jar;


java program code snippet :

---------------------------------------------------------
java.util.Hashtable env = new java.util.Hashtable();

env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(javax.naming.Context.PROVIDER_URL, "iiop://localhost:2809/");

javax.naming.Context ctx = new javax.naming.InitialContext(env);

Object homeObject = ctx.lookup("ejb/Demo");
---------------------------------------------------------

However when I run my client program I am getting below error

Cannot use a 1.3.x ORB with a 1.4.x JDK
javax.naming.NamingException: Failed to initialize the ORB [Root exception is java.lang.reflect.InvocationTargetException]


Please suggest ...




Thanks & Regards,
Kumar.


RR Kumaran
SCJP 1.4
Roland Barcia
author
Ranch Hand

Joined: Apr 15, 2004
Posts: 177
Did you create an EJB client Jar for the client?


Roland Barcia<br />STSM - ISSW Lead Web 2.0 Architect
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26168
    
  66

Kumar,
Check the fourth post in this thread for the command line I ran with successfully for a JNDI lookup.
[ January 24, 2005: Message edited by: Jeanne Boyarsky ]

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
Hi Roland Barcia,

I am not using EJB Client jar developed using wsad but a standlone j2ee client program.



Hi Jeane,
The link you gave me in your post is not working. Can you please redirect me relevant link.
Roland Barcia
author
Ranch Hand

Joined: Apr 15, 2004
Posts: 177
The J2EE client needs the interfaces and generated client stubs in the classpath since your client code needs to use the EJB client interfaces. How does your client code see the EJB code?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26168
    
  66

Kumar,
I fixed the link.
Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
Hi Roland,

set classpath=D%WSAD_HOME%\runtimes\base_v5\java\jre\lib\rt.jar;D%WSAD_HOME%\runtimes\base_v5\lib\j2ee.jar;D%WSAD_HOME%\runtimes\base_v5\lib\ivjejb35;D%WSAD_HOME%\runtimes\base_v5\lib\vaprt.jar;D%WSAD_HOME%\runtimes\base_v5\lib\utils.jar;D%WSAD_HOME%\runtimes\base_v5\lib\namingclient.jar;D%WSAD_HOME%\runtimes\base_v5\lib\namingserver.jar;

Here is my complete code :
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: WebSphere 5.0 EJB JNDI LOOKUP
 
Similar Threads
Unable to connect to an EJB fom a standlone java ejb client
NamingException: Failed to initialize the ORB
Problem with JMS n WSAD
Help needed on Standlone EJB Client with WSAD-WebSphere5.0
WebSphere 5.0 EJB JNDI LOOKUP