Re: SchemaTypeLoader problems in Equinox (OSGi): A solution

Jacob Danner <[email protected]>
Newsgroups gmane.text.xml.xmlbeans.user
Message-ID <[email protected]>
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 <[email protected]> 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
> [email protected]%3E
>
> 3)
> http://grepcode.com/file/[email protected]$xmlb
> [email protected]@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: [email protected]
> For additional commands, e-mail: [email protected]
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.