Mantis - Resin
Viewing Issue Advanced Details
5277 minor always 11-14-12 10:55 01-15-13 18:16
cowan  
ferg  
normal  
closed 4.0.32  
fixed  
none    
none 4.0.34  
0005277: IllegalArgumentException during loadClass
There appears to be a race condition where 2 servlets initializing are attempting to call definePackage on the same package.

definePackage throws IllegalArgumentException if the package is already defined.

We're synchronized on the ClassEntry but not the package.

There is a check for the package in DynamicClassLoader.loadClassEntry using getPackage, but it looks like a race condition is possible.

java.lang.IllegalArgumentException: foo.bar
  at java.lang.ClassLoader.definePackage(ClassLoader.java:1418)
  at com.caucho.loader.DynamicClassLoader.definePackage(DynamicClassLoader.java:1151)
  at com.caucho.loader.DynamicClassLoader.loadClass(DynamicClassLoader.java:1449)
  at com.caucho.loader.DynamicClassLoader.findClassImpl(DynamicClassLoader.java:1390)
  at com.caucho.loader.DynamicClassLoader.loadClassImpl(DynamicClassLoader.java:1289)
  at com.caucho.loader.DynamicClassLoader.loadClass(DynamicClassLoader.java:1219)
  at com.caucho.loader.DynamicClassLoader.loadClass(DynamicClassLoader.java:1203)
Rep by S. Nobuaki

There are no notes attached to this issue.