【问题标题】:Glassfish/Payara: can not create connection pool - There is no property isIsolationLevelGuaranteed in entityGlassfish/Payara:无法创建连接池 - 实体中没有属性 isIsolationLevelGuaranteed
【发布时间】:2017-08-17 21:15:09
【问题描述】:

我正在使用 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 连接池? (我尝试了管理控制台,但我得到了同样的错误。)

【问题讨论】:

  • 您应该添加您正在使用的实际 Payara 构建版本(它可能非常重要,当前是 171)和 mysql jdbc 连接器的版本。
  • 好的,现在编辑。

标签: mysql glassfish datasource payara


【解决方案1】:

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

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

我也告诉过你here

【讨论】:

    【解决方案2】:

    这适用于 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并重启服务器。

    【讨论】:

      猜你喜欢
      • 2016-10-21
      • 1970-01-01
      • 2019-06-27
      • 1970-01-01
      • 1970-01-01
      • 2012-12-18
      • 1970-01-01
      • 2013-07-13
      • 1970-01-01
      相关资源
      最近更新 更多