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

Amber Crawford do-not-reply at jboss.com
Mon Oct 10 14:37:47 EDT 2011


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

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

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

--------------------------------------------------------------
I am building a ear project using maven and embed a webservice war in it ;

  the testDataSource is the jndi name defined like this under *JBOSS AS 6 deploy* directory:

<jndi-name>testDataSource</jndi-name>


The web service endpoint is defined as: 

@Stateless()

*@Resource(mappedName="testDataSource")*

@TransactionManagement(TransactionManagementType.BEAN)

@WebContext(contextRoot="/testMe")

@WebService(name="TestDataSourceService",
serviceName = "TestDataSourceServiceBeanService", 
portName = "TestDataSourceServicePort", 
targetNamespace = " http://testDataSource/ http://testDataSource/")

@SOAPBinding()
public class TestWSServiceBean extends TestServiceImpl {
....
}

the war(webservice) also has a dependency (so under *WEB-INF/lib/testDataSource.jar* with 
*@Resource(mappedName="testDataSource")*
*that is class TestServiceImpl  {*
@Resource(mappedName="java:tx_vantive")
          protected DataSource dataSource;
*
*
--------------------------------------------------------------

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

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/20111010/b2106f8e/attachment.html 


More information about the jboss-user mailing list