Lasernet Keep will fail to start if the configuration of the database connection is incorrect or the application cannot connect to the configured database. In both cases, an exception is thrown, which typically ends with the following message:
Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set.This article applies to standalone installations only and explains:
How to locate the database configuration, which may need updating.
How to diagnose and fix the root cause of the issue.
Database Configuration
The database configuration is in standalone.xml:
<datasource jndi-name="java:/PDM" pool-name="PDM" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>${dm.datasource.connection.url}</connection-url>
<driver>${dm.datasource.driver}</driver>
<pool>
<min-pool-size>${dm.datasource.pool.min}</min-pool-size>
<max-pool-size>${dm.datasource.pool.max}</max-pool-size>
<prefill>false</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>${dm.datasource.username}</user-name>
<password>${dm.datasource.password}</password>
</security>
<validation>
<check-valid-connection-sql>
${dm.datasource.connection.validator.sql}
</check-valid-connection-sql>
<validate-on-match>false</validate-on-match>
<background-validation>true</background-validation>
<background-validation-millis>20000</background-validation-millis>
</validation>
</datasource>The following sections are important:
connection-url: A connection string that includes the Keep database location.security: Authentication details for the database user in Keep.
The values for properties in the connection-url and security sections are specified in the node.properties file.
You can locate the standalone.xml and node.properties files in: <installation_directory>\Wildfly-<version>\standalone\configuration. Replace <installation_directory> and <version> as appropriate. The path to <installation directory> varies depending on whether you chose the default or a custom installation path.
General Symptoms
A database configuration error will cause Keep to fail to deploy correctly at startup and generate a large volume of error logs. Look for the following symptoms:
Keep fails to deploy on startup: Navigating to the web frontend results in a 404 - Not Found error message.
The server logs contain a deployment failure message: The server logs typically contain a large number of entries. Look for the following line to identify the deployment failure:
ERROR - WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "pdm_app_module.ear")])Just before the deployment failure errors (as above), there is a stack trace ending with the line:
Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
Identify the Root Cause
When you have confirmed that this is a database configuration error
Search for a log entry containing the following text:
IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: IJ031084: Unable to create connectionLook for associated errors in the logs, then review the relevant section to confirm the root cause and find a fix:
Oracle:
Fixes for Common Errors
Connection Refused
Typical errors in the logs include:
SQL Server
...
Caused by: java.sql.SQLException: Network error IOException: Connection refused
...
Caused by: java.net.ConnectException: Connection refusedOracle
...
Caused by: org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
...
Caused by: java.net.ConnectException: Connection refusedPostgreSQL
...
Caused by: org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
...
Caused by: java.net.ConnectException: Connection refusedCause: Keep was unable to connect to the database server due to a port or hostname issue.
Fix: Verify the database server is running and available on the configured port.
Invalid Credentials
Typical errors in the logs include:
SQL Server
...
Caused by: java.sql.SQLException: Login failed for user 'pdm'.Oracle
...
Caused by: java.sql.SQLException: ORA-01017: invalid username/password; logon deniedPostgreSQL
...
Caused by: org.postgresql.util.PSQLException: FATAL: password authentication failed for user "pdm"Cause: The specified credentials for connecting to the database are invalid.
Fix: Verify that the username and password are correct, and the user has the necessary permissions to read and use the database service.
Database Cannot Be Reached
Typical errors in the logs include:
SQL Server
...
Caused by: java.sql.SQLException: Cannot open database "AFPDM8DPP" requested by the login. The login failed.PostgreSQL
...
Caused by: org.postgresql.util.PSQLException: FATAL: database "AFPDM" does not existCause: The connection to the database server was successful, and the login credentials were valid, but the chosen database does not exist or cannot be accessed.
Fix: Check that the database name is correct and that the database user has the correct permissions to access and read the database tables.
Unknown Host
Typical errors in the logs include:
SQL Server
...
Caused by: java.sql.SQLException: Unknown server host name '<hostname>'
...
Caused by: java.net.UnknownHostException: <hostname>Oracle
...
Caused by: java.sql.SQLRecoverableException: IO Error: Unknown host specified
...
Caused by: oracle.net.ns.NetException: Unknown host specifiedCause: Keep was unable to resolve the host name of the database server.
Fix: Verify the host name by pinging it and confirming that it resolves correctly via DNS. Depending on the network setup, you may need to specify the fully qualified domain name (FQDN), for example,
databasehost.some.domain.com, rather than justdatabasehost.
Listener Refused the Connection — Oracle-Specific
Typical errors in the logs include:
...
Caused by: java.sql.SQLException: Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
...
Caused by: oracle.net.ns.NetException: Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptorCause: Keep was unable to locate the Oracle database service. The connection to the Oracle database server has been established, but the specified Oracle database service is not valid.
Fix: Verify the service name specified and then use another tool, such as SQL Developer, to connect to the database.
Destroying Connection That Is Not Valid — Oracle-Specific
Typical errors in the logs include:
...
WARN [org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory] (ServerService Thread Pool -- 65) IJ030027: Destroying connection that is not valid, due to the following exception: oracle.jdbc.driver.T4CConnection@351298af: java.sql.SQLSyntaxErrorException: ORA-00923: FROM keyword not found where expected
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:951)
...Cause: The SQL statement used to validate the connections in the connection pool is invalid. Keep was installed using a database type other than Oracle, so the wrong SQL has been configured.
Fix:
Open the Wildfly configuration file
node.properties.Search for the
dm.datasource.connection.validator.sqlproperty in the# Database Configsection and ensure it has the value: SELECT 1 FROM DUAL. For example:dm.datasource.connection.validator.sql=SELECT 1 FROM DUAL
