Anybody got a snippet of code that needs to be used in Java client to lookup a EJB 3 stateless session bean using RMI or application client context ?
You can find such examples in the
in particular, you can find some injection or some jndi lookup in the core or adapted client examples.
Hope this helps.
Thanks for the helpful tip.
I got the client working using simple InitialContext and looking up the bean, but when I tried to use @EJB annotation in the client, I was getting NPE, when the client was trying to get a handle.
Is @EJB annotaion support in command line clients or the injection would only work when the client is also in the same VM (JSP, JSF, Servlet ....) ??
I think injection is supported in the app client container.
You can read about it in this document.
If you want to use injection, you may want to use the Java Web Start support for application clients, that is discussed in the same document. It makes the app deployment across your enterprise much easier.
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.