Thanks Mike!
I'll add this to the FAQs when I get a chance.
-jacobd

On Tue, Oct 6, 2009 at 12:33 PM, Michael Furtak <mfur...@cra.com> wrote:

> Hi, all. This is my first message to the mailing list, so I apologize if
> I am stating some very old news.
>
>
> Recently I have been encountering some classloading problems when using
> XMLBeans in an OSGi environment (Equinox), and I have seen some other
> users with similar issues [1, 2]. The common symptom was that xsi:type
> information could neither be generated, nor interpreted while running in
> an OSGi environment.
>
> To my understanding, the use of the Thread Context ClassLoader, within
> the SchemaTypeLoader [3] needs some extra help to work properly within
> an OSGi environment. Equinox provides this help in the form of "Buddy
> Class Loading" (unfortunately, this is *not* part of the OSGi spec,
> making it an Equinox specific fix) [4].
>
> By marking the XMLBeans bundle with an Eclipse-BuddyPolicy header in its
> manifest, and the compiled schema bundle with an Eclipse-RegisterBuddy
> header in its manifest, Equinox is able to bridge the classloading gap
> between the core XMLBeans jar and your compiled schema classes.
>
>
> Assuming that my XMLBeans bundle has:
>
> Bundle-SymbolicName: org.apache.xmlbeans
>
>
> I would include in that XMLBeans bundle manifest the line:
>
> Eclipse-BuddyPolicy: registered
>
>
> I would then alter my scomp'd schema classes bundle manifest to include:
>
> Eclipse-RegisterBuddy: org.apache.xmlbeans
>
>
> After doing this, my problems are resolved. I hope this can help someone
> else, and was not incredibly old news.
>
>
> Regards,
> -Mike Furtak
>
>
> 1)
> http://markmail.org/message/vx2vdg7yhb4l3ej6#query:+page:1+mid:vx2vdg7yh
> b4l3ej6+state:results<http://markmail.org/message/vx2vdg7yhb4l3ej6#query:+page:1+mid:vx2vdg7yh%0Ab4l3ej6+state:results>
>
> 2)
> http://mail-archives.apache.org/mod_mbox/ws-axis-user/200701.mbox/%3C8d2
> a81130701171341p55f95b70o7f144ea7d9416...@mail.gmail.com%3e
>
> 3)
> http://grepcode.com/file/repo1.maven.org$mav...@org.apache.xmlbeans$xmlb
> e...@2.4.0@org$apache$xmlbeans$impl$schema$SchemaTypeLoaderImpl.java#Sch
> emaTypeLoaderImpl.getContextTypeLoader%28%29
>
> 4)
> http://wiki.eclipse.org/index.php/Context_Class_Loader_Enhancements#Ecli
> pse-BuddyPolicy_Header<http://wiki.eclipse.org/index.php/Context_Class_Loader_Enhancements#Ecli%0Apse-BuddyPolicy_Header>
>
>
>
>
> 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.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
> For additional commands, e-mail: user-h...@xmlbeans.apache.org
>
>

Reply via email to