learn java
The moose likes EJB and other Java EE Technologies and the fly likes java:comp/env - required? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "java:comp/env - required?" Watch "java:comp/env - required?" New topic

java:comp/env - required?

Neil Rapley

Joined: Jun 22, 2001
Posts: 1
Is the prefix java:comp/env required when assigning a JNDI name to an EJB? I have named mine without any prefix and it seems to work fine. Are there any consequences of not using it?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16542

Using java:comp/env/ejb makes it portable, as well as declaring that the object is question "is" an EJB. On the other hand, I have several legacy beans that are setup the way you mentioned. All that's really necessary is that however you refer to it, that the process of resolving the JNDI name returns the home of the item in question.

Customer surveys are for companies who didn't pay proper attention to begin with.
I agree. Here's the link: http://aspose.com/file-tools
subject: java:comp/env - required?