I have a EJB module in remote Glassfish server and application client in my computer. I want to connect from the application client to the remote EJB.
Here is the my EJB interface:
@Remote
public interface BookEJBRemote
{
public String getTitle();
}
Here is the my ejb:
@Stateless
public class BookEJB implements BookEJBRemote
{
@Override
public String getTitle()
{
return "Twenty Thousand Leagues Under the Sea";
}
}
I have several questions :
No matter how i try i never manage to run application client ? Can you guys put some working example? And thank you for every advises and examples?
When you call a server-side EJB from a client application, you must use a network protocol that involves an ORB, such as RMI over IIOP. However, calling out from the servlet to an external object that is in the same session as the servlet can be much simpler and faster than calling from a client.
javax.ejbDeclares the remote business interface(s) for a session bean. The Remote annotation is applied to the session bean class or remote business interface to designate a remote business interface of the bean.
Check this tutorial Creating a Java Stand-Alone Client. Basically you need to
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With