[
https://issues.jboss.org/browse/JBESB-3582?page=com.atlassian.jira.plugin...
]
Ales Justin commented on JBESB-3582:
------------------------------------
There is really nothing we can do to "fix" this.
We could hack around this, so it might actually "work",
but this would just be hiding the real problem == class-leak.
The jdk caches the class against the originating classloader.
http://download.oracle.com/javase/1.5.0/docs/api/java/lang/ClassLoader.ht...
So if you try to load the class from cl#2 and it actually loads it from cl#1,
the jdk will remember that for next time you invoke findLoadedClass() from #2
The classloaders have become linked. Thats why you need to redeploy
both to properly refresh the classloading space and avoid classloader leaks.
In our case cl#1 is the undeployed classloader,
which we then still hit, due to leaking ref.
But since we know it's undeployed, we ignore its result:
Class<?> result = findLoadedClass(name);
if (result != null)
{
// Has this classloader been undeployed?
ClassLoader otherClassLoader = getClassLoader(result);
if (otherClassLoader != null && otherClassLoader != this &&
otherClassLoader instanceof RealClassLoader)
{
RealClassLoader rcl = (RealClassLoader) otherClassLoader;
// Ignore when undeployed
if (rcl.isValid() == false)
{
if (trace)
log.trace(this + " ignoring already loaded class from undeployed
classloader " + ClassLoaderUtils.classToString(result));
result = null; // <--------------------------- HERE
Hence we re-try to define it on cl#2.
What I could do, is throw a better exception msg or at least add a warning instead of
trace.
SOA-P 5.1.0 classloader caching issues with embedded jar artifacts
------------------------------------------------------------------
Key: JBESB-3582
URL:
https://issues.jboss.org/browse/JBESB-3582
Project: JBoss ESB
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Deployment
Affects Versions: 5.0 Milestone Release 1
Environment: Windows 7, Fedora 14
Reporter: Dave Siracusa
Attachments: helloworld.daves.zip
An existing .ESB file with embedded jar artifact ends up being used for subsequently
deployed .ESB applications even if the second ESB contains a newer/different version of
the embedded jar artifact.
If you repeatly redeploy the first and the second, eventually the ESB file fails to
deploy due to duplicate class issues.
SOA-P 5.0.0/1/2 does not behave this way as the VFSClassloader uniquely captures each
artifact in the tmp vsf folder.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira