学習目的のCRUDデモプロジェクトでstruts2-fullhibernatecore-plugin-2.2.2-GAに苦労しています。以下は私が得るエラーであり、さまざまな休止状態の依存関係がそれを機能させようとしました。下記参照
エラー
java.lang.NoSuchMethodError: org.hibernate.SessionFactory.openSession()Lorg/hibernate/classic/Session;
com.googlecode.s2hibernate.struts2.plugin.util.HibernateSessionFactory.createAndTestSessionFactory(HibernateSessionFactory.java:284)
com.googlecode.s2hibernate.struts2.plugin.util.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:227)
com.googlecode.s2hibernate.struts2.plugin.util.HibernateSessionFactory.getNewSession(HibernateSessionFactory.java:155)
このスレッドの回答からわかります ここをクリック
プラグインで動作する休止状態のバージョンを確認するために、さまざまなMaven依存関係を開始して、
以下のバージョンから機能しない
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.1.6.Final</version>
</dependency>
このバージョンまで動作します
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.6.10.Final</version>
</dependency>
質問:明らかにHibernate3を使用したくないので、struts2-fullhibernatecore-plugin-2.2.2-GAで最新のhibernate4 +を使用できる方法はありますか?
質問: struts2の休止状態で最も広く使用されているDIは何ですか。上記のプラグインが機能しない場合は、Springまたはgoogleジュースを使用する必要がありますか?ビューパターンを除いて、休止状態のセッションを管理するための他の実行可能なソリューションはありませんが、そのアンチパターンと言って、多くの欠点があります。