[jboss-user] [EJB/JBoss] - Re: java.lang.ClassNotFoundException: org.jnp.interfaces.Nam

thomas2008ch do-not-reply at jboss.com
Thu May 8 04:00:24 EDT 2008


"jaikiran" wrote : You cannot use an Local interface from a remote client (the standalone java client, running in its own JVM).  You will require a remote interface for the bean. Use an interface with @Remote.

You are right. Now I change the Local to remote as follow:

MyBeanLocal.java 
**************** 
@Remote 
public interface MyBeanLocal { 
public String test(String text); 
} 

TestMyBean.java 
*************** 
@Stateless 
public class TestMyBean implements MyBeanLocal { 

public static final String LocalJNDIName = TestMyBean.class.getSimpleName() + "/remote"; 

public String test(String text) { 
return "Hello, " + text; 
} 

But I get a new exception as follow:
Caused by: javax.naming.NameNotFoundException: remote not bound
	at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
	at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
	at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
	at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
	at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
	at sun.rmi.transport.Transport$1.run(Transport.java:153)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
	at java.lang.Thread.run(Thread.java:595)
	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
	at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589)
	at javax.naming.InitialContext.lookup(InitialContext.java:351)
	at com.wei.chen.TestClient.main(TestClient.java:26)



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4149345#4149345

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4149345



More information about the jboss-user mailing list