It's not a secret anymore!
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes @Resource & mappedName Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "@Resource & mappedName" Watch "@Resource & mappedName" New topic

@Resource & mappedName

Benoît de Chateauvieux
Ranch Hand

Joined: Aug 10, 2007
Posts: 183
Hi all,

I try to test simples environment entries in my OC4J and I don't understand the difference between the attributes name and mappedName of the annotation @Resource.

I wrote the following ejb-jar:

And in my bean:

It works only with mappedName and no with name.
Any idea?
Thanks a lot for your help!

SCJP5 | SCBCD5 | SCEA5 Part 1
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

mappedName is container dependant, and should be avoided. There's an article here about injecting environment entries.

[My Blog]
All roads lead to JavaRanch
I agree. Here's the link:
subject: @Resource & mappedName
jQuery in Action, 3rd edition