This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes @Resource only on @Target(value={TYPE,FIELD,METHOD}) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "@Resource only on @Target(value={TYPE,FIELD,METHOD})" Watch "@Resource only on @Target(value={TYPE,FIELD,METHOD})" New topic

@Resource only on @Target(value={TYPE,FIELD,METHOD})

Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 577

Again referring Enterprise Java Beans 3.pdf (by Frits, page number 2-16). There is a code block in which @Resource is used within a business method. But, it is not allowed according to @Resource annotation as the @Target can only be {TYPE,FIELD,METHOD}. You get compilation error if used. Has anybody noticed this?

(OCEEJBD6, SCWCD5, SCDJWS, SCJP1.4 and Oracle SQL 1Z0-051)
Frits Walraven
Creator of Enthuware JWS+ V6

Joined: Apr 07, 2010
Posts: 1877

Yes, that is a mistake. Thanks for pointing that out.

I will change that over the weekend.

Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 577

Thanks Frits, appreciate that.
I agree. Here's the link:
subject: @Resource only on @Target(value={TYPE,FIELD,METHOD})