Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Upgrade error #821

Open
benoiton opened this issue Feb 27, 2025 · 2 comments
Open

[BUG] Upgrade error #821

benoiton opened this issue Feb 27, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@benoiton
Copy link

When I try to upgrade a 6.10 database to 9.0 (either from WebUI or from ant), I get an error.

ERROR org.ejbca.ui.cli.UpgradeCommand - Post Upgrade not performed, see server log for details.

In server.log, the stack trace begins with:

 ERROR [org.ejbca.core.ejb.upgrade.UpgradeSessionBean] (default task-2) Unexpected error from post-upgrade: java.lang.ClassCastException: class org.jboss.logmanager.log4j.JBossLogger cannot be cast to class org.apache.logging.log4j.core.Logger (org.jboss.logmanager.log4j.JBossLogger is in unnamed module of loader '[email protected]' @56d4bd5b; org.apache.logging.log4j.core.Logger is in unnamed module of loader 'deployment.ejbca.ear' @71231573): jakarta.ejb.EJBException: java.lang.ClassCastException: class org.jboss.logmanager.log4j.JBossLogger cannot be cast to class org.apache.logging.log4j.core.Logger (org.jboss.logmanager.log4j.JBossLogger is in unnamed module of loader '[email protected]' @56d4bd5b; org.apache.logging.log4j.core.Logger is in unnamed module of loader 'deployment.ejbca.ear' @71231573)

Searching the web, I found there was some change in logging (l4j) in recent WildFly versions. Following hints, I tried to exclude org.apache.logging.log4j.api in src/deploy/ear/META-INF/jboss-deployment-structure.xml:

<exclusions>
    <module name="org.apache.logging.log4j.api" />
</exclusions>

After ant build deployear + restart, ant upgrade succeed, and the application seems to be still OK.

Tech stack:

  • EJBCA r9.0 CE
  • WildFly 32
  • PostgreSQL 16
  • Rocky Linux 9.5
@benoiton benoiton added the bug Something isn't working label Feb 27, 2025
@dknight-bg
Copy link

Same problem with EJBCA v9.2.1 .
Excluding org.apache.logging.log4j.api is OK for database upgrade.

Then the should be removed + rebuild + redeploy because there is a problem with the logs (no logs).

EJBCA EE 9.2.1
WildFly 35
PostgreSQL 17
Alma Linux 9.5
OpenJDK 17

@primetomas
Copy link
Collaborator

primetomas commented Mar 3, 2025

For EE I believe you have posted a ticket to Support as well? This has been noted and will be fixed.
Many thanks for the code snippet @benoiton

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants