permaculture playing cards*
The moose likes Tomcat and the fly likes Tomcat 7 - resource injection using @Resource annotation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat 7 - resource injection using @Resource annotation" Watch "Tomcat 7 - resource injection using @Resource annotation" New topic
Author

Tomcat 7 - resource injection using @Resource annotation

lof fol
Greenhorn

Joined: Aug 17, 2011
Posts: 1
The problem is:
recover an entry in the Environment Context of a Tomcat 7 Application using @Resource annotation.

I defined in the context.xml of my application:


if I lookup directly the Jndi Context it's all ok, I retrieve correctly the URL variable:


if I try to use the resource injection using @Resource annotation:
(i'm using Struts2 framework)


in this case I obtain in the Tomcat console: pathFileconfig: null

what's wrong ?


Thanks

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Tomcat 7 - resource injection using @Resource annotation
 
Similar Threads
Problem with @Resource annotation (without web.xml)
@Resource injection not working for DataSource
How to develop a standalone swing application with ejb 3.1
Tomcat 7: Can I configure it so that I don't need to use “java:/comp/env” in the code?
Help: upgraded from tomcat 5.0 to 5.5.27 and getting Naming Exception