what is the difference between deploying a stateless session bean with a remote and local interface.
This is my code :
I do the look up as
HelloUser user = (HelloUser)ctx.lookup("hhh/remote");
This works fine. But the same doesn't work for local interface.
If i do the lookup as
HelloUser user = (HelloUser)ctx.lookup("hhh/local");...i get the following exception
Exception in thread "main" javax.naming.NamingException: Could not dereference object [Root exception is java.lang.RuntimeException: Could not find InvokerLocator URL at JNDI address "hhh/local"; looking up local Proxy from Remote JVM?]
at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1472)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:818)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:682)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at HelloWorldClient.main(HelloWorldClient.java:11)
Caused by: java.lang.RuntimeException: Could not find InvokerLocator URL at JNDI address "hhh/local"; looking up local Proxy from Remote JVM?
at org.jboss.ejb3.proxy.objectfactory.ProxyObjectFactory.createProxyFactoryProxy(ProxyObjectFactory.java:185)
at org.jboss.ejb3.proxy.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:146)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1447)
at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1464)
... 4 more
If i do the look up as
HelloUser user = (HelloUser)ctx.lookup("hhh"); ...i get the exception as
Exception in thread "main" java.lang.ClassCastException: org.jnp.interfaces.NamingContext
at HelloWorldClient.main(HelloWorldClient.java:11)
I am using jdk1.5 and jboss-5.0.1.GA.