Hi All,
I want to call an EJB deployed on JBoss Server 3.2.3. I am using a java claine to call it from another machine on the network using this code:
try {
prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
prop.put(Context.PROVIDER_URL, "jnp://135.131.147.120:1099");
prop.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
prop.put("jnp.disableDiscovery", "true");
ctx = new javax.naming.InitialContext(prop);
} catch (NamingException ex) {
ex.printStackTrace();
}
try {
String JNDIHomeName = "com.teradata.tap.ava.ejb.AVATestBean";
Object HomeObj = ctx.lookup(JNDIHomeName);
AVATestRemoteHome Home = (AVATestRemoteHome ) PortableRemoteObject.narrow(HomeObj,AVATestRemoteHome.class);
remote = (AVATestRemote) PortableRemoteObject.narrow(Home.create(), AVATestRemote.class);
} catch (Exception ex) {
ex.printStackTrace();
}
I am able to run this client successfully from the same machine where my server is running but when i try that from another machine it gives me this exception:
javax.naming.CommunicationException: Could not obtain connection to any of these urls: 135.131.147.120:1098
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1194)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:514)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at com.teradata.tap.ava.client.AVATestBeanClient.execute(AVATestBeanClient.java:103)
at com.teradata.tap.ava.client.AVATestBeanClient.main(AVATestBeanClient.java:295)
..............
Can anybody help me on this, thanks in advance.
Note: i am using JBoss 3.2.3 and JDK 1.4.2_08
Tanveer