[jboss-user] [EJB 3.0] - Re: Basic EJB - cant be invoked from client

r12345_2003 do-not-reply at jboss.com
Mon Apr 7 11:05:21 EDT 2008


Hi All, 

Thanks very much for the replies. As suggested by "jeff.rosen" I tried the following:




  |             InitialContext ic = new InitialContext();
  |         Context jndiRoot = (Context) ic.lookup("jnp://localhost:1099");
  |         CalculatorRemote calculator = (CalculatorRemote)jndiRoot.lookup("CalculatorBean/Remote");
  | 
  | 

i.e. I specified the jndiRoot and changed Local to Remote. However, now i get the following exception:


  | Exception in thread "main" 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:460)
  | 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
  | 	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:667)
  | 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
  | 	at javax.naming.InitialContext.lookup(InitialContext.java:351)
  | 	at uk.co.autotrader.ejb3.client.CalculatorClient.main(CalculatorClient.java:26)
  | 
  | 



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

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



More information about the jboss-user mailing list