If you take a simple unpackaged ejb jar and redeploy it by touching
the META-INF/ejb-jar.xml descriptor attempting to cast the home
to its home interface results in a ClassCastException. We saw this
early on because of the use of MarshalledObject and its calling
Class.forName(String, boolean, ClassLoader) and the vm cache.
Well, the Proxy.newInstance call also calls Class.forName(String,
boolean, ClassLoader). We have not seen a problem with this
because by default we deploy archives and these are translated into
copies with a unique localURL. UnifiedClassLoader#1 and
UnifiedClassLoader#2 for a redeploy will have different URLs and
so they will not compare as equal. However, a directory deployment
does not make a copy and so UnifiedClassLoader#1 and
UnifiedClassLoader#2 do compare as equal and this causes
Class.forName(String, boolean, ClassLoader) to return the interface
classes first seen when Proxy#1 was created. The same problem
would be seen if you run with the no jar copy option.
This caching behavior is just a nightmare.

The result is that UnifiedClassLoader can't override equals. To validate
that duplicate URLs are not placed into the UnifiedLoaderRepository
the UnifiedClassLoader URL must be used as the unique key.

xxxxxxxxxxxxxxxxxxxxxxxx
Scott Stark
Chief Technology Officer
JBoss Group, LLC
xxxxxxxxxxxxxxxxxxxxxxxx


_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to