0

我正在尝试在 JBOSS 7.2 上安装 EJBCA 6.15.2.1,基本上遵循 ejbca.org 网站上的安装信息。我使用 Mysql 作为数据库。

我能够成功执行部署步骤(https://www.ejbca.org/docs/Deploying_EJBCA.html)-“ant -q clean deployear”。但是,当我尝试运行安装步骤(https://www.ejbca.org/docs/Installing_EJBCA_as_a_CA_with_a_Management_CA.html) - “ant runinstall”时,我遇到了一些错误,例如:

18:48:18,338 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "ejbca.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.subunit.\"ejbca.ear\".\"ejbca-ejb.jar\".component.StartupSingletonBean.START" => "java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
    Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
    Caused by: javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
    Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
    Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
    Caused by: java.sql.SQLSyntaxErrorException: Table 'ejbca.RoleData' doesn't exist"}}

所以,我在Mysql中检查数据库,看起来那个数据库完全是空的!

有谁知道填充“ejbca”数据库的假设是什么?是否应该有一些工具或脚本来填充我可能会丢失的架构等?

谢谢,吉姆

编辑1:我想我可能至少发现了部分问题。在日志中,我发现了这个:

05:15:22,282 WARN  [org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl] (ServerService Thread Pool -- 56) GenerationTarget encountered exception accepting command : Error executing DDL "create table AccessRulesData (pK INT(11) not null, accessRule VARCHAR(250) BINARY not null, isRecursive TINYINT(4) not null, rowProtection LONGTEXT, rowVersion INT(11) not null, rule INT(11) not null, AdminGroupData_accessRules INT(11), primary key (pK)) type=MyISAM" via JDBC Statement: org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "create table AccessRulesData (pK INT(11) not null, accessRule VARCHAR(250) BINARY not null, isRecursive TINYINT(4) not null, rowProtection LONGTEXT, rowVersion INT(11) not null, rule INT(11) not null, AdminGroupData_accessRules INT(11), primary key (pK)) type=MyISAM" via JDBC Statement
    at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67)
    at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.applySqlString(AbstractSchemaMigrator.java:559)

所以我在mysql中尝试了“创建表”,但出现了错误。然后我尝试了“创建表”,但使用“ENGINE = MyISAM”而不是“type = MyISAM”,它起作用了。

因此,从谷歌搜索(例如GenerationTarget 遇到异常接受命令:通过 JDBC 语句执行 DDL 时出错),我认为这是配置 hibernate 使用的“方言”的问题,似乎我应该在某些 hibernate 中修改它配置文件,但我不确定它可能在哪里。熟悉 Hibernate 和方言以及 ejbca/jboss 的人可以告诉我应该在哪个文件中更改该方言吗?

编辑 2:顺便说一句,看起来我使用的 Mysql 是 5.7.26。

4

1 回答 1

0

查看https://docs.jboss.org/hibernate/orm/5.3/javadocs/org/hibernate/dialect/package-summary.html似乎您应该使用org.hibernate.dialect.MySQL57Dialect。您应该配置此方言。

于 2019-06-24T07:18:16.930 回答