@Local annotation in EJB 3.

Posted by stratwine on Stack Overflow See other posts from Stack Overflow or by stratwine
Published on 2010-05-19T11:05:48Z Indexed on 2010/05/19 11:10 UTC
Read the original article Hit count: 249

Filed under:

Hi,

I have a stateless session bean and a standalone-java-program acting as a client. The bean method executes just fine when the interface is marked @Remote. However,when I mark that interface with @Local instead of @Remote, I get the following Exception.

 [java] javax.naming.NamingException: Could not dereference object [Root exception is java.lang.RuntimeException: Could not find InvokerLocator URL at JNDIaddress "chapter1/HelloUserBean/local"; looking up local Proxy from Remote JVM?]

But I expected even the latter to work, since it is the same computer that the code executes in.

Seeing this behavior, I am assuming that, the Application-Server and the Standalone-Java-Program use different JVM instances and not a single JVM instance and so this client can access only through a remote interface.

Is that assumption correct ?

Thanks !

© Stack Overflow or respective owner

Related posts about ejb3