Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Call the ejb deployed in Websphere 6.0 from a standalone client.

26 views
Skip to first unread message

ls_...@hotmail.com

unread,
Oct 3, 2006, 3:54:57 AM10/3/06
to
I have problem calling a session bean deployed in Websphere 6.0 from a standalone client. Following is the code of the client:

public class TestClient {

public static void main(String[] args) {

TestSession sessionRef=null;
try{

Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL, "iiop://localhost:2809");
Context initC = new javax.naming.InitialContext(env);
Object remote = initC.lookup("ejb/com/hkcsl/ejb/TestSessionHome");

TestSessionHome rv = (TestSessionHome)
javax.rmi.PortableRemoteObject.narrow(remote,
TestSessionHome.class);
sessionRef = (TestSession)rv.create();
sessionRef.execute("From TestClient");

}
catch(Exception e)
{
e.printStackTrace();
}
}
}


The following exception was caught

Oct 3, 2006 3:46:50 PM com.ibm.ws.naming.util.Helpers
WARNING: jndiNamingException
javax.naming.NamingException: The JNDI operation "lookupExt"on the context "PC00788745aNode01Cell/nodes/PC00788745aNode01/servers/server1" with the name "ejb/com/hkcsl/ejb/TestSessionHome" failed. Please get the root cause Throwable contained in this NamingException for more information. Root exception is java.lang.NoSuchMethodError: com.ibm.websphere.pmi.reqmetrics.PmiReqMetrics: method isComponentEnabled(II)Z not found
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1501)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1354)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:172)
at javax.naming.InitialContext.lookup(InitialContext.java:361)
at com.hkcsl.ejb.TestClient.main(TestClient.java:48)

It worked fine when I used the RAD's Universal Test Client to browse the JNDI name. But it failed when looking up the same JNDI name with a standalone java client.

I have included the following JAR in the classpath:
com.ibm.ws.admin.client_6.1.0.jar
j2ee.jar
lmproxy.jar

Anyone gots any idea?

Randy Schnier

unread,
Oct 3, 2006, 1:16:27 PM10/3/06
to
There is a "WAS thin client install" that you need to perform on your
client machine. That sets up your classpath with the necessary jars.
I'm pretty sure the list is longer than the three you've listed below.

adw...@pulpjava.com

unread,
Oct 4, 2006, 12:09:52 AM10/4/06
to
A regular JVM is insufficient to access the J2EE application server.
There will be all sorts of jar files missing.

This is a J2EE client install that will allow you to run J2EE clients
once it is run.

Cheers!

-Cameron McKenzie

www.pulpjava.com
www.scja.com
www.examscam.com

ls_...@hotmail.com

unread,
Oct 4, 2006, 9:34:38 PM10/4/06
to
Cannot find any resource about installing a WAS client for WAS 6.0. All I can find is about version 5.1. Can anyone help?

Paul Ilechko

unread,
Oct 4, 2006, 9:44:58 PM10/4/06
to
ls_...@hotmail.com wrote:
> Cannot find any resource about installing a WAS client for WAS 6.0. All I can find is about version 5.1. Can anyone help?

Did you look in the WAS 6 infocenter ?

ls_...@hotmail.com

unread,
Oct 6, 2006, 12:18:47 AM10/6/06
to
I've downloaded the WAS 6.0 application client and it works now. Thanks.
0 new messages