[jboss-user] [JBoss Web Services] - Re: Cannot inject field annotated with @Resource annotation in JBOSS 6

Amber Crawford do-not-reply at jboss.com
Tue Oct 11 11:24:11 EDT 2011


Amber Crawford [http://community.jboss.org/people/amberjboss1999] created the discussion

"Re: Cannot inject field annotated with @Resource annotation in JBOSS 6"

To view the discussion, visit: http://community.jboss.org/message/631187#631187

--------------------------------------------------------------
I built a Arqullian test case using <arquillian.version>1.0.0.Alpha5</arquillian.version> and <jboss.version>6.0.0.Final</jboss.version>, and annotate a 
*@Resource(mappedName = "java:testDataSource")*
   protected DataSource dataSource;

assert not null on dataSource.getConnection() and the test passed.  I am lost as to why when I deployed on JBoss 6 and ran my test using the web services stub that it fails with :

10:17:00,093 ERROR [org.jboss.wsf.common.injection.InjectionException] Resource 'testDataSource' not found: javax.naming.NameNotFoundException: testDataSource not bound
        at org.jnp.server.NamingServer.getBinding(NamingServer.java:771) [:5.0.5.Final]
        at org.jnp.server.NamingServer.getBinding(NamingServer.java:779) [:5.0.5.Final]

when server starts up, the jndi DS is bound:
10:16:19,865 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=testDataSource' to JNDI name 'java:testDataSource'

Can someone help, please?! What does it take to get a little help here?
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/631187#631187]

Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111011/afabcc1f/attachment.html 


More information about the jboss-user mailing list