[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] Use of Thread Context ClassLoader considered harmful?

Hi all,

I am using Apache XMLBeans 2.4 within Equinox 3.5, and am running into
problems. Specifically, I (and others [1,2] - references at bottom) have
noticed that a specific part of the type resolution process breaks when
run in an OSGi environment.

After some investigation, I have found that XMLBeans is creating its
SchemaTypeLoader objects with the current thread's context
classloader[3]. My experience has been that any time a library does this
and then needs to load classes that are in a different OSGi bundle, the
classes can not be resolved.

So I suppose my questions are: Could Equinox do more to prevent this
kind of use-case from breaking down? Alternatively, for compatibility
with an OSGi environment, is using a TCCL considered harmful? If so,
what should I suggest in my XMLBeans ticket as an OSGi-compatible
alternative?


Thanks,
-Mike Furtak
 

1)
http://markmail.org/message/vx2vdg7yhb4l3ej6#query:+page:1+mid:vx2vdg7yh
b4l3ej6+state:results

2)
http://mail-archives.apache.org/mod_mbox/ws-axis-user/200701.mbox/%3C8d2
a81130701171341p55f95b70o7f144ea7d941639a@xxxxxxxxxxxxxx%3E

3)
http://grepcode.com/file/repo1.maven.org$maven2@xxxxxxxxxxxxxxxxxxx$xmlb
eans@xxxxx@org$apache$xmlbeans$impl$schema$SchemaTypeLoaderImpl.java#Sch
emaTypeLoaderImpl.getContextTypeLoader%28%29 (Line 131)
 
 
 
 
THIS MESSAGE IS INTENDED FOR THE USE OF THE PERSON TO WHOM IT IS ADDRESSED. IT MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW. If you are not the intended recipient, your use of this message for any purpose is strictly prohibited. If you have received this communication in error, please delete the message and notify the sender so that we may correct our records.