Accessing remote session beans

For accessing a remote Student EJB, we can use the following JNDI URLs:

URL

When to use

java:global/CourseManagement/ CourseManagementEJBs/Student!packt.jee.book.ch6.StudentRemote

The client can be in the same application or remote. In the case of a remote client, we need to set up proper InitialContext parameters.

java:global/CourseManagement/CourseManagementEJBs/Student

The client can be in the same application or remote. We skipped the interface name because the bean implements only one business interface.

java:app/CourseManagementEJBs/Student

Or

java:app/CourseManagementEJBs/Student!packt.jee.book.ch6.StudentRemote

The client can be anywhere in the EAR. We skipped the application ...

Get Java EE 8 Development with Eclipse now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.