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?
This is a J2EE client install that will allow you to run J2EE clients
once it is run.
Cheers!
-Cameron McKenzie
Did you look in the WAS 6 infocenter ?