Glassfish / Payara:无法创建连接池 - 实体

时间:2017-03-24 19:40:23

标签: mysql glassfish datasource payara

我正在使用Payara 4.1.1完整版。 (我尝试了4.1.1.171和4.1.1.164)
我想创建Mysql连接池。 (试过5.1.39和6.0.6)
这是我用来创建连接池的示例脚本(用于提高可读性的换行符):

asadmin create-jdbc-connection-pool 
--datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlDataSource 
--restype javax.sql.DataSource 
--property user=username:password=password:DatabaseName=testDB:ServerName=localhost:port=3306 testDBPool

但我得到了这个错误:

remote failure: JDBC connection pool testDBPool creation failed.
java.lang.IllegalArgumentException: HV000039: Invalid property path. 
There is no property isIsolationLevelGuaranteed in entity org.glassfish.jdbc.config.JdbcConnectionPool.
Command create-jdbc-connection-pool failed.

我在Glassfish 4.1.1上尝试了完全相同的脚本,我得到了同样的错误。 但是当我在Glassfish 4.0上试用它时,它可以正常工作。

如何在Payara / Glassfish 4.1.1上创建mysql连接池? (我尝试过管理控制台,但我得到了同样的错误。)

2 个答案:

答案 0 :(得分:2)

我以前遇到过这个问题。为此,您需要添加两个属性作为JVM选项。

-Duser.language=en
-Duser.region=US

我也告诉过你here

答案 1 :(得分:0)

这适用于GlassFish 4.1.1:

asadmin create-jdbc-connection-pool 
--datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlDataSource 
--restype javax.sql.DataSource
--description "Connection pool for MySQL"
--isconnectvalidatereq=true
--validationmethod=table
--validationtable=DUAL
--property user=ghi-java:password="yourpassword":databaseName=dbname:serverName=localhost:port=3306:url="jdbc\:mysql\://\:3306/dbname" ghiDBPool

然后:

asadmin create-jdbc-resource --connectionpoolid ghiDBPool jdbc/ghiDbConnector.

请务必在domain-dir / lib中复制mysql-connector-java-5.1.40-bin.jar并重启服务器。

相关问题