アプリにJPA2.0を実装する際に問題が発生します。Criteriaクエリを使用しており、EntityManagerからセッションを取得する必要があります。私は次の方法でそれを行います(これによると) Session ses = entityManager.unwrap(Session.class);
Tomcat 7.0.8上で実行した後、次のようになります。
Struts has detected an unhandled exception:
# Messages: org.hibernate.ejb.EntityManagerImpl.unwrap(Ljava/lang/Class;)Ljava/lang/Object;
Stacktraces
java.lang.reflect.InvocationTargetException
java.lang.AbstractMethodError: org.hibernate.ejb.EntityManagerImpl.unwrap(Ljava/lang/Class;)Ljava/lang/Object; sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
また、次のHibernate関連の依存関係を参照しています(問題があると思われる場合)。
hibernate-3.2.5.ga.jar
hibernate-annotations-3.4.0.GA.jar
hibernate-commons-annotations-3.1.0.GA.jar
hibernate-core-3.3.0.GA.jar
hibernate-entitymanager-3.4.0.GA.jar
hibernate-jpa-2.0-api-1.0.0.Final.jar
これについて何か考えはありますか?