JBoss Community

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

created by Amber Crawford in JBoss Web Services - View the full discussion

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

Start a new discussion in JBoss Web Services at Community