Glassfish's Undeploying Grails app gets class invariant violation

I have a Grails application that works in Glassfish, but when I deploy it, it gets

Class invariant violation

Quick view of stacktrace and search in web reports that this is a problem with Log4j

I use the last log4j during log4j-1.2.16.jar

Any suggestions to fix this error.

[Mon, 22-Aug-2011 @ 09:23:32.494] [admin-thread-pool-4848(64)] ERROR javax.enterprise.system.std.com.sun.enterprise.server.logging - java.lang.IllegalStateException: Class invariant violation at org.apache.log4j.LogManager.getLoggerRepository(LogManager.java:199) at org.apache.log4j.LogManager.getLogger(LogManager.java:228) at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:243) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:255)

[Change 1]

I just found this in the original spring forum, which is interesting:

To prevent this problem, the following is recommended:

  • Set the system property org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES to false.
  • Apply the fix for error 40212 or upgrade the version in which this patch is applied.
  • Update your log4j 1.2.16 or later file to better defend against the class loader attack or provide a better diagnostic message when it occurs.

[Solution] Setting the property

 org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES = false 

in domain.xml in Glassfish resolves the issue

+4
grails glassfish log4j
source share

No one has answered this question yet.

See similar questions:

8
Why does Tomcat throw a "java.lang.IllegalStateException: class invariant violation" during undeployment?

or similar:

5
Undeploy all applications from Glassfish
3
Introducing Grails in Glassfish and slf4j
2
Grails: Undeploy on Glassfish forces the pool to no longer be used
one
Slow web app deployment on Glassfish with redisson
one
Built-in GlassFish inside Grails
0
Deploying a Grails Application on Glassfish 4 Error
0
Conditional Glass Fish Removal
0
How to Create Glass Grail Grail Corn Components
0
Error deploying grails 3 application for Glassfish server
0
EJB calls from grail to glass

All Articles