GlassFish 2.1で奇妙な問題が発生しています。私はこのコンテナの初心者であり、これを特定するのに問題があります。
testDerbyPoolと呼ばれるJDBC接続プールが定義されたGlassFish2.1の新規インストールがあります。次に、そのプールを指すjdbc/testDerbyPoolというリソースが定義されています。リソースタイプはjavax.sql.DataSourceであり、プールに正常にpingを実行できます。
次に、次の宣言を持つWebアプリケーションに単一のクラスがあります。
@Resource(name="jdbc/testDerbyPool")
private javax.sql.DataSource source;
私のweb.xmlでのこの宣言:
<resource-ref>
<res-ref-name>jdbc/testDerbyPool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
アプリケーションをデプロイしようとすると、次のエラーが発生します。
[#|2009-09-09T21:40:47.582+0100|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=24;_ThreadName=Thread-32;_RequestID=1ca4ab80-ae39-4920-be18-f535b025bb51;|WebModule[/cptest1]PWC1275: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
そして、巨大なスタックトレースが始まります:
java.lang.NoClassDefFoundError: LDataSource;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
根本的な原因:
Caused by: java.lang.ClassNotFoundException: DataSource
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1498)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
DataSourceが「見つからない」方法がわかりません!何か案は?