Greetings!
I am experiencing a strange condition when deploying my project on Wildfly 23.0.2. I have already tried to find an answer in all the blogs and pages that I have been able to without success so far. I am writing to this group in the hope that someone knows why this happens:
If I add my .ear from scratch through the HAL Management Console, it displays correctly, but if I try to upload a new version of the .ear file through the "Replace Deployment" option or if I undeploy the project and I try to upload it again without having restarted the wildfly, then the deployment fails and shows me the following message in the log:
Caused by: java.lang.ClassCastException: org.apache.logging.log4j.core.LoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext
This message refers to the following line of my code:
LoggerContext context = (LoggerContext) LogManager.getContext (false);
This is impractical for me because it forces me to:
- Undeploy the project in the wildfly.
- Turn off the wildfly.
- Reopen the wildfly.
- Deploy the .ear file again.
All this I have to do, every time I make a change in the project, and I want to deploy the corresponding .ear file generated to the wildfly.
So the question is: Why? Why does it work and it gives me no error message in the log if I add the .ear from scratch, but it doesn't work and it shows me the error message in the log if I want to update the .ear file with the wildfly already up?
Thanks in advance for any assistance.