Specifying javax.persistence.schema-generation.database.action in persistence.xml causes redeployment to fail due to "java.lang.IllegalStateException: This web container has not yet been started" on Payara

Description

Specifying `javax.persistence.schema-generation.database.action` in `persistence.xml` causes redeployment on Payara 5.182 to fail due to `java.lang.IllegalStateException: This web container has not yet been started`. This happens during the second deployment only in 100% of cases. Example stacktrace (with Derby):

I reported this issue to Payara at https://github.com/payara/Payara/issues/2894 with a PostgreSQL-based SSCCE and the assigned dev is sure that it's a Hibernate or PostgreSQL issue caused by incorrect reusage a classloader (see Payara issue for details). I ruled out PostgreSQL because the issue happens with Apache Derby as well.

An SSCCE is provided at https://gitlab.com/krichter/netbeans-java-ee-double-deployment (don't be confused by the name) with the reproductions of the issue on the branches master (PostgreSQL-based connection), hibernate-update (latest 6.0.0-SNAPSHOT), apache-derby (Apache Derby-based connection) and fix (showing that removal of the property from `persistence.xml` fixes the issue. The detailed logs can be investigated via the GitLab CI results available under CI/CD->Pipelines.

Environment

None

Assignee

Unassigned

Reporter

Karl-Philipp Richter

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major
Configure