Hi guys,
I have developed an EJB 2.x stateless session using netbeans, and I want to
write a very simple stand alone ejb client to access it in geronimo v2. The
code looks like below:
props.setProperty("java.naming.factory.initial",
"org.openejb.client.RemoteInitialContextFactory");
props.setProperty("java.naming.provider.url", "127.0.0.1:4201");
//props.setProperty("java.naming.security.principal", "testuser");
//props.setProperty("java.naming.security.credentials", "testpassword");
Context ic = new InitialContext(props);
System.out.println("ic = " + ic);
Object objRef = ic.lookup("MySessionRemoteHome");
I read the documentation and it looks like the only way to lookup in the remote
client is through jndi-name in openejb-jar.xml. And I have done that as below:
<?xml version="1.0"?>
<openejb-jar
xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1"
xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1"
xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
<enterprise-beans>
<session>
<ejb-name>MySessionBean</ejb-name>
<jndi-name>MySessionRemoteHome</jndi-name>
</session>
</enterprise-beans>
</openejb-jar>
After the ejb is deployed to geronimo, I ran the client and found below error:
ic = [EMAIL PROTECTED]
Exception in thread "main" javax.naming.NameNotFoundException:
/MySessionRemoteHome does not exist in the system. Check that the app was
successfully deployed.
at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:231)
at javax.naming.InitialContext.lookup(Unknown Source)
at apachegclient.TestClient.main(TestClient.java:43)
Anyone has any idea what's going on?
Thanks,
Chris
---------------------------------
Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV.
---------------------------------
Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.