jsf - Eclipse Web Service auto generator is not injecting @Inject annotation -
my project web dynamic project using jsf 2.2 cdi in tomcat 7.0. cdi working beans, when try use @inject web service class returning null.
@named public class schooldataws { @inject private schooldatadao dao; public schooldataws() { system.out.println(dao); } public string save(string json) { string result = (dao != null ? dao.tostring() : "null"); return result; } }
to generate wsdl using eclipse resource new -> other -> web service. service implementation set start service , client type set no client. setting style , use document/literal.
i have the webcontent/web-inf/bean.xml
<?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd"> </beans>
i have webcontent/meta-inf/context.xml empty
my pom.xml this:
<!-- cdi --> <dependency> <groupid>javax.enterprise</groupid> <artifactid>cdi-api</artifactid> <version>1.2</version> </dependency> <dependency> <groupid>org.jboss.weld</groupid> <artifactid>weld-core</artifactid> <version>2.2.14.final</version> </dependency> <dependency> <groupid>org.jboss.weld.servlet</groupid> <artifactid>weld-servlet</artifactid> <version>2.2.14.final</version> </dependency> <dependency> <groupid>org.jboss.weld.se</groupid> <artifactid>weld-se-core</artifactid> <version>2.2.14.final</version> </dependency> <dependency> <groupid>org.jboss</groupid> <artifactid>jandex</artifactid> <version>1.2.2.final</version> </dependency>
Comments
Post a Comment