java ee - WildFly deploy: Unable to create EntityManager with SynchronizationType -
i trying migrate glassfish 4.0 webapp deploy on wildfly 8.1.0 final. app deploys correctly, after sendind request (e.g. typing localhost:8080/meanful/), strange error occurs:
2:57:15,493 error [org.jboss.as.ejb3.invocation] (default task-4) jbas014134: ejb invocation failed on component systemdaoimpl method public abstract boolean com.meanful.service.system.systemdao.contains(java.lang.string): javax.ejb.ejbexception: java.lang.illegalstateexception: unable create entitymanager synchronizationtype because persistenceunit configured resource-local transactions.
my persistence.xml looks , functional same version of eclipselink on glassfish 4 server.
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> <persistence-unit name="mysqlpersistenceunit" transaction-type="jta"> <provider>org.eclipse.persistence.jpa.persistenceprovider</provider> <jta-data-source>java:/jdbc/mysql</jta-data-source> <exclude-unlisted-classes>false</exclude-unlisted-classes> <shared-cache-mode>none</shared-cache-mode> <properties> </properties> </persistence-unit> </persistence>
the implementation class looks this:
@stateless public class systemdaoimpl implements systemdao { @persistencecontext private entitymanager entitymanager; @override public boolean contains(string infokey) { return entitymanager.find(systeminfo.class, infokey) != null; }
entity manager injected. error thrown when program reaches inside of contains() method (there 1 line).
the connection set properly, connection test shows ok.
please, check line:
<resource-root path="jipijapa-eclipselink-1.0.1.final.jar"/>
in modules/system/layers/base/org/eclipse/persistence/main/module.xml <resource>
element.
jipijapa-eclipselink-1.0.1.final.jar:
this library collection of utility classes aid integration of eclipselink jbossas7
there should two lines (an integration , eclipselink library) according to:
Comments
Post a Comment