1

I am deploying my MDBs (EJB3.1) on JBoss7.1.1 application server. When I use @Resource for Datasource injection, I use global JNDI reference name (ENC + local JNDI reference name) and it works just fine. But, from page 147 of this book I can see the below statement.

EJB 3 essentially assumes that all JNDI names used in code are local references and automatically prepends names with the java: comp/env/ prefix.

Does this actually say first it looks for global JNDI reference and if not found, then prepend ENC assuming it is a local JNDI reference? Or Is this completely application server implementation specific? Global JNDI name has to be specified with mappedName property of @Resource but it works with name!

IndoKnight
  • 1,846
  • 1
  • 21
  • 29

1 Answers1

0

My interpretation of that vague statement is that in code you don't need to add the comp/env/ part, the AS will add it for you. Saves some repetitive typing.

Gimby
  • 5,095
  • 2
  • 35
  • 47
  • Thanks for your reply. But, I can make out what you said. I'm looking for an elaborate answer to my questions. – IndoKnight Feb 08 '14 at 21:02
  • Firstly, I would normally spend some time googling before posting here. Secondly, my question was quite clear about knowing how actually JNDI look up in JBoss7.1 EJB3.1 works. – IndoKnight Feb 10 '14 at 09:07