I want an EntityManager to be injected into my WebService but that does not work:
| @WebService
| @SOAPBinding(style = SOAPBinding.Style.RPC)
| @HandlerChain(file = "handler.xml")
| public class DocumentSign
| {
| @PersistenceContext(name = "EF")
| EntityManager em;
|
| @WebResult(name = "signedDocument")
| public byte[] signDocument(@WebParam(name = "document")byte[] data)
| {
| System.out.println("em = " + em);
| //TODO implement signing
| return null;
| }
| }
|
my web.xml:
| <web-app>
| <servlet>
| <servlet-name>DocumentSignService</servlet-name>
| <servlet-class>foo.DocumentSign</servlet-class>
| </servlet>
| <servlet-mapping>
| <servlet-name>DocumentSignService</servlet-name>
| <url-pattern>/sign/*</url-pattern>
| </servlet-mapping>
| </web-app>
|
my persistence.xml in WEB-INF/META-INF:
| <persistence-unit name="EF" transaction-type="JTA">
| <jta-data-source>java:/EfDb.tst</jta-data-source>
|
<class>at.oekb.wsportal.sapexportfinance.data.EFImportData</class>
| <properties>
| <property name="hibernate.archive.autodetection"
value="class"/>
| <property name="hibernate.session_factory_name"
value="java:/hibernate/EFSessionFactory"/>
| <property name="hibernate.show_sql"
value="true"/>
| <property name="hibernate.format_sql"
value="true"/>
| <property name="use_sql_comments"
value="true"/>
| <property name="hibernate.dialect"
value="org.hibernate.dialect.Oracle10gDialect"/>
| <property name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider"/>
| <property name="com.intellij.javaee.persistence.datasource"
value="Datasource"/>
| </properties>
| </persistence-unit>
|
I use jboss-4.2.1.GA.
The EntityManager is not injected.
Can anyone help me with this problem?
Best regards,
Wolf-Dietrich Rettensteiner
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115886#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...