有没有人能够让容器管理事务的EclipseLink JPA povider在in Profile中工作?我已经使用JPA Container设置配置了我的server.xml文件,以覆盖默认的OpenJPA实现,但是这会导致一个副作用,即当通过具有事务传播注释的EntityManager进行访问时,EntityManager不再参与容器事务。
我还尝试将"eclipselink.target-server“属性设置为"WebSpeher_7”,但是当我这样做时,我在eclipselink.target-server类上得到了一个ClassNotFoundException。
发布于 2014-01-04 03:33:14
下午好。这看起来像是你遇到了错误407279 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=407279)。
您可以通过使用以下更改修改org.eclipse.persistence.transaction.was.WebSphereTransactionController来解决此问题:
public class WebSphereTransactionController extends JTATransactionController {
// Class and method to execute to obtain the TransactionManager
protected final static String TX_MANAGER_FACTORY_CLASS = "com.ibm.tx.jta.TransactionManagerFactory";
// OLD VALUE --> "com.ibm.ws.Transaction.TransactionManagerFactory";希望这能有所帮助!一定要抓住EclipseLink 2.5.2,因为它有另一个重要的变化(错误412627),以便与自由一起工作!
发布于 2016-08-08 23:22:47
我不得不用liberty 16.0.0.2、Spring4.X和EclipseLink 5.2.X来改变很多东西
我删除了persistence.xml文件,并将spring xml配置更改为:
<bean id="transactionManager"
class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="datasource" />
<property name="persistenceUnitName" value="PERSISTENCE_UNIT"></property>
<property name="jpaVendorAdapter" ref="jpaVendorAdapter" />
<property name="packagesToScan">
<list>
<value>ENTITIES_PACKAGE</value>
</list>
</property>
<property name="jpaPropertyMap">
<map>
<entry key="eclipselink.weaving" value="false"/>
</map>
</property>
</bean>而对于server.xml
<jpa defaultPersistenceProvider="org.eclipse.persistence.jpa.PersistenceProvider"/>
<featureManager>
<feature>servlet-3.0</feature>
<feature>jdbc-4.0</feature>
<feature>jpa-2.0</feature>
<feature>localConnector-1.0</feature>
<feature>jsp-2.2</feature>
</featureManager>https://stackoverflow.com/questions/20868851
复制相似问题