java.lang.ClassNotFoundException: org.hibernate.service.jta.platform.spi.JtaPlatform
Spring 3.2.x + Hibernate 4.3.x統合、JtaPlatform
ClassNotFoundExceptionにヒットし、プロジェクトクラスパスを検索し、JtaPlatform
が別のパッケージにあることを確認しますか?
hibernate-core.4.3.5.Final.jar
org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform
エラーメッセージはorg.hibernate.service.jta.platform.spi.JtaPlatform
を示しています
Caused by: java.lang.NoClassDefFoundError: org/hibernate/service/jta/platform/spi/JtaPlatform at org.springframework.orm.hibernate4.SpringSessionContext.(SpringSessionContext.java:56) ~[spring-orm-3.2.8.RELEASE.jar:3.2.8.RELEASE] ... 40 common frames omitted Caused by: java.lang.ClassNotFoundException: org.hibernate.service.jta.platform.spi.JtaPlatform //...
pom.xml
org.hibernate hibernate-core 4.3.5.Final org.springframework spring-core 3.2.8.RELEASE org.springframework spring-orm 3.2.8.RELEASE
溶液
Hibernate 4.3.x以降、JtaPlatform
クラスは新しいパッケージにリファクタリングされています。 To fix it、Hibernateを4.2.x以前にダウングレードするか、Springフレームワークをアップグレードします。
私の開発環境でテストした結果、動作するバージョンは次のとおりです。
-
Spring 3.2.8.RELEASE
-
Hibernate 4.2.11。最終
pom.xml
org.hibernate hibernate-core 4.2.11.Final org.springframework spring-core 3.2.8.RELEASE