我正在尝试基本上按照ejbca.org网站上的安装信息在JBOSS 7.2上安装EJBCA 6.15.2.1。我正在使用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 encountered exception accepting command : Error executing DDL via JDBC Statement)开始,我认为将hibernate配置为使用“方言”是一个问题,似乎我应该在某些hibernate配置文件中对其进行修改,但是我不确定可能是这样。熟悉Hibernate,方言和ejbca / jboss的人可以告诉我应该在哪个文件中更改该方言吗?
编辑2:顺便说一句,看起来我正在使用的Mysql是5.7.26。
最佳答案
查看https://docs.jboss.org/hibernate/orm/5.3/javadocs/org/hibernate/dialect/package-summary.html似乎应该使用org.hibernate.dialect.MySQL57Dialect。您应该配置该方言。
关于mysql - 尝试在JBOSS上安装EJBCA时出现问题-为什么Mysql数据库(“ejbca”)为空,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/56719816/