Hibernate: Unable to access TransactionManager or UserTransaction to make physical transaction delegate

后端 未结 3 1984
-上瘾入骨i
-上瘾入骨i 2021-01-02 15:43

I was using Servlets, PostgreSQL and Hibernate with EntityManager to build a Web app and everything was working ok until I moved the project to a Maven based project. Now I\

相关标签:
3条回答
  • 2021-01-02 16:01

    ok... this was just an error on the persistance unit xml configuration, I removed transaction-type="JTA" from the persistence-unit tag. It seems that it was added automatically by the IDE.

    0 讨论(0)
  • 2021-01-02 16:06

    Just add the property to your persistence.xml

    <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.SunOneJtaPlatform"/>
    
    0 讨论(0)
  • 2021-01-02 16:21

    Add @Transactional to your DAO and the class accessing your DAO class.

    Refer: http://spring.io/guides/gs/managing-transactions/

    0 讨论(0)
提交回复
热议问题