-
Bug
-
Resolution: Obsolete
-
Major
-
JBossAS-4.2.3.GA
-
None
-
None
-
OpenJDK Runtime Environment (IcedTea6 1.4.1) (6b14-1.4.1-0ubuntu11), OpenJDK 64-Bit Server VM (build 14.0-b08, mixed mode)
After redeployment of one of two enterprise applications living on the server I get an "IllegalStateException: Can't overwrite cause" from the RepositoryClassLoader (see attached stacktrace) when a web module is being initialized. After some investigation I suspect the reason for an error could be that both applications shares some utility class and therefore both the enterprise applications has to be undeployed.
This however should not cause an illegal state exception. Looking in the source of RepositoryClassLoader indicates that the intended error message should be "Invalid use of destroyed classloader UCL destroyed" but the code tries to call Throwable.initCause() on an java.lang.ClassNotFoundException which is not allowed causing an IllegalStateException.
A simple fix would be to use the constructor that takes a cause instead of explicitly call initCause() (see attached patch (untested)).