JPAを使用して単純なDB接続を作成しようとしています。正常に動作しますが、クライアントに例外をスローしようとすると、エラーが発生します。
[ERROR] [browsereditor] - Line 210: No source code is available for type javax.persistence.EntityExistsException; did you forget to inherit a required module?
[ERROR] [browsereditor] - Line 212: No source code is available for type javax.persistence.EntityNotFoundException; did you forget to inherit a required module?
開発モードではエラーは発生せず、正常にコンパイルされますが、アプリモジュールがロードされると、エラーが発生する場所があります。
サーバー/作曲家とクライアント/プレゼンターのクラスに必要なインポートがあります
import javax.persistence.EntityExistsException;
import javax.persistence.EntityNotFoundException;
また、クラスパスとビルドパスに次のjarファイルを追加しました。
javax.persistence.jar
jpa-annotations-source.jar(http://code.google.com/p/google-web-toolkit/issues/detail?id=1830#c14)
gwt.xmlにも追加してみました
<source path='client'/>
<source path='shared'/>
<source path='server'/>
Eclipseにソースコードの場所を教える方法について何かアイデアはありますか?
ありがとう
コードは次のとおりです。
//サーバーのComposer.classからcomposerを作成します
public static Composer createComposer(String name)
throws EntityExistsException {
Composer comp = new Composer();
comp.setName(name);
comp.setId(1);
EntityManager entityManager = entityManager();
entityManager.getTransaction().begin();
entityManager.persist(comp);
entityManager.getTransaction().commit();
entityManager.close();
return comp;
}
/// Presenter.classのcreateComposer(上記)からのリクエストを起動します
req.fire(new Receiver<ComposerProxy>() {
public void onSuccess(ComposerProxy arg0) {
ComposerProxy comp;
comp = arg0;
}
public void onFailure(Throwable caught)
throws Throwable {
// Convenient way to find out which exception
// was thrown.
try {
throw caught;
} catch (EntityExistsException e) {
} catch (EntityNotFoundException e) {
}
}});
}});
[ERROR] [browsereditor] - Line 210: No source code is available for type javax.persistence.EntityExistsException; did you forget to inherit a required module?
[ERROR] [browsereditor] - Line 212: No source code is available for type javax.persistence.EntityNotFoundException; did you forget to inherit a required module?