Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

EJB client application getting errors

843829Dec 4 2002 — edited Dec 5 2002
Hi

I deployed a session bean in Websphere. I have written a client program too. Client is unable to connect to the server.
If anybody knows those steps please help me.

I'm pasting the Client code below.

package naveen;

import java.io.*;
import java.util.*;
import javax.naming.*;

public class HelloClient{


public static void main(String a[]) throws Exception{

System.out.println("Hello Client Main Method Called...");

Hashtable h=new Hashtable();

h.put(Context.PROVIDER_URL,"iiop://localhost:900");

h.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");

System.out.println("Hello Client before context intialization...");

Context ctxt=new InitialContext(h);

System.out.println("Hello Client after context initialization...");

Object o=ctxt.lookup("HelloJndi");

System.out.println("Hello Client LookUP Initialize.....");

HelloHome hh=(HelloHome)o;

HelloRemote hr=hh.create();

System.out.println(hr.sayHello());
}
}

This program's output is it's printing "After context intialization"
After that error message

I am giving that error message also:

WSCL0100E: Exception received: java.lang.reflect.InvocationTargetException: java
x.naming.NameNotFoundException: HelloJndi
at com.ibm.ejs.ns.jndi.CNContextImpl.doLookup(CNContextImpl.java:1435)
at com.ibm.ejs.ns.jndi.CNContextImpl.lookup(CNContextImpl.java:1115)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at naveen.HelloClient.main(HelloClient.java:25)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.websphere.client.applicationclient.launchClient.createContain
erAndLaunchApp(launchClient.java:430)
at com.ibm.websphere.client.applicationclient.launchClient.main(launchCl
ient.java:288)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:158)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 2 2003
Added on Dec 4 2002
4 comments
202 views