[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [eclipselink-users] EclipseLink Buddy Policy in OSGi
- From: Shaun Smith <shaun.smith@xxxxxxxxxx>
- Date: Fri, 10 Oct 2008 14:43:13 +0000 (GMT)
- Delivered-to: firstname.lastname@example.org
You're right. You need to provide the JAXBContext with a classloader that can see the model classes. If your utility bundle creates the context then you're going to have to pass it a classloader. "thisClass" could be a model class.
----- Original Message -----
From: "Polly C Chang" <polly.c.chang@xxxxxxxxx>
To: "Eclipselink-Users" <eclipselink-users@xxxxxxxxxxx>
Sent: Thursday, October 9, 2008 8:49:15 PM (GMT-0500) America/New_York
Subject: Re: [eclipselink-users] EclipseLink Buddy Policy in OSGi
Can you clarify this a little? What is "thisClass"? Is that the model
object class? My setup is that I have one bundle for the model classes and
one bundle for some helper code that calls EclipseLink. I don't think that
I can pass the helper bundle's classloader into EclipseLink and have
EclipseLink be able to see my domain classes.
Shaun Smith wrote:
> Hi Polly,
> You need to give MOXy a classloader that can see your domain
> classes. Try something like:
> ClassLoader classLoader = thisClass.getClassLoader();
> JAXBContext jaxbContext = JAXBContext
> .newInstance("examples.jaxb.model", classLoader);
> amphoras wrote:
>> We've been trying to get EclipseLink MOXy to work in an OSGi environment
>> Equinox, and we found that in order to allow EclipseLink to instantiate
>> model objects, we need to set up a Buddy Policy.
>> We had to modify the EclipseLink manifest to say:
>> Eclipse-BuddyPolicy: registered
>> Then we edited the bundle containing our model objects to say:
>> Eclipse-RegisterBuddy: org.eclipse.persistence.core
>> This works, but I don't like tweaking files that belong to a third-party
>> library. It seems like everyone that uses Equinox would need the
>> BuddyPolicy. So will you be willing to add the "Eclipse-BuddyPolicy"
>> to the EclipseLink manifest? Or are we doing something wrong? If
>> there's a
>> better way to solve this problem, please let me know.
> Oracle <http://www.oracle.com>
> Shaun Smith | Principal Product Manager, TopLink | +1.905.502.3094
> Oracle Fusion Middleware
> 110 Matheson Boulevard West, Suite 100
> Mississauga, Ontario, Canada L5R 3P4
> eclipselink-users mailing list
View this message in context: http://www.nabble.com/EclipseLink-Buddy-Policy-in-OSGi-tp19579730p19906443.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.
eclipselink-users mailing list