Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java:comp/env - required?

 
Neil Rapley
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
Thanks,
Neil.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18162
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic