Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can't we have more than 1 @Resource annotation specified on bean class ?

 
gurpeet singh
Ranch Hand
Posts: 924
1
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i specified 2 @Resource annotations on a bean class. the name attribute of both the resource were different but still eclipse gave an error that duplicate Resource annotation exists.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2343
90
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Yes you can have more resources of a class. Just like defining more @EJB's on a class is done with @EJBs, multiple resource can be declared bij using @Resources, for example (from: Oracle EE5 tutorial):

Regards,
Frits
 
gurpeet singh
Ranch Hand
Posts: 924
1
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a tonne Frits
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic