Each persistence unit defined in the persistence.xml has an (WildFly) internal PersistenceUnitService that depends on other internal services like a DataSource service that is used to obtain database connections.
Are you seeing any deployment failures in the server.log when deploying the application with the DB down? Could you please show us the deployment failures that you see with WildFly 26 + 31 (if any). From the jboss-cli.sh command output below I don't expect to see deployment failures for WildFly 26 but would be good to know for sure.
Scott
--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/0970f2f1-ae62-4353-9795-71939d2448cen%40googlegroups.com.
There are no deployment failures for 26, but there are for 31 (as you see from the cli status provided:
$ ./wildfly-31.0.1.Final/bin/jboss-cli.sh -c deployment-info
NAME RUNTIME-NAME PERSISTENT ENABLED STATUS
sso-xxxx-dashboard-jakarta.war sso-xxxx-dashboard-jakarta.war false true FAILED
I think this is the relevant sever.log entry from 31 that you are requesting (of course it cannot determine the dialect because it cannot connect to the DB):
2024-04-24 09:25:15,856 INFO [org.jboss.as.server] (ServerService Thread Pool -- 45) WFLYSRV0010: Deployed "sso-xxxx-dashboard-jakarta.war" (runtime-name : "sso-xxxx-dashboard-jakarta.war")
2024-04-24 09:25:15,889 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186: Services which failed to start: service jboss.persistenceunit."sso-xxxx-dashboard-jakarta.war#oracledb".__FIRST_PHASE__: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to determine Dialect without JDBC metadata (please set 'jakarta.persistence.jdbc.url' for common cases or 'hibernate.dialect' when a custom Dialect implementation must be provided)
WFLYCTL0448: 34 additional services are down due to their dependencies being missing or failed
The "Unable to determine Dialect without JDBC metadata" failure is Hibernate ORM attempting to get a connection to the database to obtain information about the database server so that it can determine which Hibernate database dialect to use. So as per https://docs.jboss.org/hibernate/orm/6.4/dialect/dialect.html you should try adding:
<property name="hibernate.dialect" value="OracleDialect"/>
I think "OracleDialect" is a shorter form of the
org.hibernate.dialect.OracleDialect name. For more information
about the older Hibernate Dialects (like
org.hibernate.dialect.Oracle12cDialect), see
https://in.relation.to/2023/02/15/hibernate-orm-62-db-version-support/
Scott
This change caused the following error:
11:48:56,363 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "sso-xxxx-dashboard-jakarta.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.\"sso-xxxx-dashboard-jakarta.war#oracledb\".__FIRST_PHASE__" => "org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to resolve name [OracleDialect] as strategy [org.hibernate.dialect.Dialect]
Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to resolve name [OracleDialect] as strategy [org.hibernate.dialect.Dialect]
Caused by: org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [OracleDialect] as strategy [org.hibernate.dialect.Dialect]
Caused by: org.hibernate.boot.registry.classloading.spi.ClassLoadingException: Unable to load class [OracleDialect]
Caused by: java.lang.ClassNotFoundException: Could not load requested class : OracleDialect
Caused by: java.lang.Throwable"}}
So I tried this instead:
<property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
This gave the following warning, which made us assume it shouldn't be used:
11:55:24,467 WARN [org.hibernate.orm.deprecation] (ServerService Thread Pool -- 78) HHH90000025: OracleDialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
However, the deployment succeeded:
$ ./wildfly-31.0.1.Final/bin/jboss-cli.sh -c deployment-info
NAME RUNTIME-NAME PERSISTENT ENABLED STATUS
sso-xxxx-dashboard-jakarta.war sso-xxxx-dashboard-jakarta.war false true OK
So presumably we should go back to that setting and ignore the warning?
Yes, please do ignore the warning. I think the warning is wrong when the database server is not running as clearly that case will not work. The warning was added via the https://github.com/hibernate/hibernate-orm/commit/e5545492cc7#diff-0bcfaa7e5bdafe5e7631620b4e8596f4bbdb7cc5a4385c43e01850686034982dR225 change. If you have ideas for improving the warning, please consider creating a tracking https://hibernate.atlassian.net/browse/HHH issue and optionally a pull request.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/6be8b2ba-cc39-4a1b-802c-a0d3df14f65d%40redhat.com.
Thanks!On Wed, Apr 24, 2024 at 12:30 PM Scott Marlow <sma...@redhat.com> wrote:
On 4/24/24 1:58 PM, Everly, David W wrote:
This change caused the following error:
11:48:56,363 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "sso-xxxx-dashboard-jakarta.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.\"sso-xxxx-dashboard-jakarta.war#oracledb\".__FIRST_PHASE__" => "org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to resolve name [OracleDialect] as strategy [org.hibernate.dialect.Dialect]
Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to resolve name [OracleDialect] as strategy [org.hibernate.dialect.Dialect]
Caused by: org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [OracleDialect] as strategy [org.hibernate.dialect.Dialect]
Caused by: org.hibernate.boot.registry.classloading.spi.ClassLoadingException: Unable to load class [OracleDialect]