Glassfish 4 - 集群设置 - DAS上的数据库连接池

时间:2014-08-28 07:56:24

标签: java glassfish glassfish-4

我安装了glassfish 4(DAS)。一个远程(SSH)节点和一个在该节点上具有一个实例的集群。 我也为它定义了一个连接池和数据源。

我的测试应用程序非常简单 - 它是一个带有一个servlet的Web应用程序,我以下列方式加载数据源:

@Resource(lookup = "jdbc/vadsacRootSource")
private Datasource datasource;

什么不起作用 - 集群实例(远程)上的数据源无法实例化,因为无法找到基础池 - stacktrace在消息的末尾看到。

工作原理:

  • 本地DAS节点(默认节点)上的相同应用程序
  • 在远程和本地
  • 上加载保存为自定义JNDI资源的字符串
  • glassfish 3.1上的整个应用程序(数据源) - 远程和本地

因此,当前的glassfish 4版本有问题 - 在某些远程SSH实例上,数据源(或其池)没有实例化(或根据JNDI找到?)。 我测试了官方版本4.0和每晚构建版本4.1-bl3 - 同样的问题

你有什么想法吗?

  

GlassFish Server   开源版4.0 - 错误报告

HTTP   状态500 - 内部服务器错误


类型异常   报告

消息内部服务器   错误

描述服务器遇到内部错误   这阻止了它完成此请求。

异常

javax.servlet.ServletException: Error instantiating servlet class
com.sedo.webtesty.HelloWorld

根本原因

com.sun.enterprise.container.common.spi.util.InjectionException:
Error creating managed object for class: class
com.sedo.webtesty.HelloWorld

根本原因

com.sun.enterprise.container.common.spi.util.InjectionException:
Exception attempting to inject Res-Ref-Env-Property:
com.sedo.webtesty.HelloWorld/datasource@javax.sql.DataSource@ resolved
as: jndi: jdbc/vadsacRootSource@res principal: null@mail: null No
Runtime properties Database Vendor : null Create Tables at Deploy :
false Delete Tables at Undeploy : false into class
com.sedo.webtesty.HelloWorld: Lookup failed for
'java:comp/env/com.sedo.webtesty.HelloWorld/datasource' in
SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory,
java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl,
java.naming.factory.url.pkgs=com.sun.enterprise.naming}

根   原因

javax.naming.NamingException: Lookup failed for
'java:comp/env/com.sedo.webtesty.HelloWorld/datasource' in
SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory,
java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl,
java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root
exception is javax.naming.NamingException: Lookup failed for
'jdbc/vadsacRootSource' in
SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory,
java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl,
java.naming.factory.url.pkgs=com.sun.enterprise.naming,
com.sun.enterprise.naming.logicalName=java:comp/env/com.sedo.webtesty.HelloWorld/datasource}
[Root exception is javax.naming.NamingException: Unable to lookup
resource : jdbc/vadsacRootSource [Root exception is
com.sun.appserv.connectors.internal.api.ConnectorRuntimeException:
Lookup failed for '__SYSTEM/pools/mysqlRootVadsacPool' in
SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory,
java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl,
java.naming.factory.url.pkgs=com.sun.enterprise.naming,
com.sun.enterprise.naming.logicalName=java:comp/env/com.sedo.webtesty.HelloWorld/datasource}]]]

root   原因

javax.naming.NamingException: Lookup failed for
'jdbc/vadsacRootSource' in
SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory,
java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl,
java.naming.factory.url.pkgs=com.sun.enterprise.naming,
com.sun.enterprise.naming.logicalName=java:comp/env/com.sedo.webtesty.HelloWorld/datasource}
[Root exception is javax.naming.NamingException: Unable to lookup
resource : jdbc/vadsacRootSource [Root exception is
com.sun.appserv.connectors.internal.api.ConnectorRuntimeException:
Lookup failed for '__SYSTEM/pools/mysqlRootVadsacPool' in
SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory,
java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl,
java.naming.factory.url.pkgs=com.sun.enterprise.naming,
com.sun.enterprise.naming.logicalName=java:comp/env/com.sedo.webtesty.HelloWorld/datasource}]]

root   原因

javax.naming.NamingException: Unable to lookup resource
: jdbc/vadsacRootSource [Root exception is
com.sun.appserv.connectors.internal.api.ConnectorRuntimeException:
Lookup failed for '__SYSTEM/pools/mysqlRootVadsacPool' in
SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory,
java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl,
java.naming.factory.url.pkgs=com.sun.enterprise.naming,
com.sun.enterprise.naming.logicalName=java:comp/env/com.sedo.webtesty.HelloWorld/datasource}]

root   引起

com.sun.appserv.connectors.internal.api.ConnectorRuntimeException:
Lookup failed for '__SYSTEM/pools/mysqlRootVadsacPool' in
SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory,
java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl,
java.naming.factory.url.pkgs=com.sun.enterprise.naming,
com.sun.enterprise.naming.logicalName=java:comp/env/com.sedo.webtesty.HelloWorld/datasource}

根   原因

javax.naming.NamingException: Lookup failed for
'__SYSTEM/pools/mysqlRootVadsacPool' in
SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory,
java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl,
java.naming.factory.url.pkgs=com.sun.enterprise.naming,
com.sun.enterprise.naming.logicalName=java:comp/env/com.sedo.webtesty.HelloWorld/datasource}
[Root exception is javax.naming.NameNotFoundException:
pools]

根本原因

javax.naming.NameNotFoundException: pools

注意的   异常的完整堆栈跟踪及其根本原因是   可在GlassFish Server Open Source Edition 4.0中获得   日志。


GlassFish Server开源版4.0   

1 个答案:

答案 0 :(得分:0)

问题在当前的4.1版本中得到修复 - 现在一切正常