Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@Resource & mappedName

 
Benoît de Chateauvieux
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mappedName is container dependant, and should be avoided. There's an article here about injecting environment entries.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic