Reputation: 1374
I am trying to install EJBCA 6.15.2.1 on JBOSS 7.2, basically following the installation information on the ejbca.org website. I am using Mysql as the database.
I am able to do the deploy step (https://www.ejbca.org/docs/Deploying_EJBCA.html) - "ant -q clean deployear" successfully. However, when I try to run the install step (https://www.ejbca.org/docs/Installing_EJBCA_as_a_CA_with_a_Management_CA.html) - "ant runinstall", I am getting some errors, e.g.:
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"}}
So, I was checking the database in Mysql, and it looks like that database is completely empty!
Does anyone know what is suppose to populate that "ejbca" database? Is there supposed to be some tool or script that populates the schema, etc. that I might be missing?
Thanks, Jim
EDIT 1: I think I may have found at least part of my problem. In the logs, I found this:
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)
So I tried that "create table" in mysql, and got an error. Then I tried the "create table", but using "ENGINE=MyISAM" instead of "type=MyISAM", and it worked.
So, from googling (e.g. GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement), I think that it is a problem with the "dialect" that hibernate is configured to use, and it seems like I should modify that in some hibernate configuration file, but I am not sure where that might be. Can someone who is familiar with Hibernate and dialects and ejbca/jboss tell me which file I should change that dialect in?
EDIT 2: BTW, it looks like the Mysql I am using is 5.7.26.
Upvotes: 0
Views: 767
Reputation: 3547
Looking at https://docs.jboss.org/hibernate/orm/5.3/javadocs/org/hibernate/dialect/package-summary.html it seems that you should be using org.hibernate.dialect.MySQL57Dialect. You should configure this dialect.
Upvotes: 0