AW: AW: Using a Java Space from an OSGi bundle
"Wellmann, Harald" <[email protected]> Fri, 14 Sep 2007 10:10:23 +0200
| Newsgroups | gmane.comp.java.sun.javaspaces |
|---|---|
| Message-ID | <FCCE9B33F9DEDF41B2C7797D6D0D12F3017BB32A@oehhw2ex03.hbi.ad.harman.com> |
Great, setting the context class loader did solve my problem. It's a bit
awkward, but if wrap my space in an adapter class that handles the class
loader twiddling in each method, then it's an adequate workaround.
I found an article about the ContextFinder in Eclipse/Equinox, which
you'd expect to do something of this sort behind the scenes, but
unfortunately it doesn't...
Regards,
Harald
>looking at the stack trace, it appears that you need to do
>
>ClassLoader ld =3D Thread.currentThread().getContextClassLoader();
>try {
> Thread.currentThread.setContextClassLoader(
> getClass().getClassLoader() );
>
> // Do work that starts in Activator.run() here=09
>} finally {
> Thread.currentThread.setContextClassLoader( ld ); }
>
>to make sure that the Thread which is running the code in=20
>Activator.run() can find a ClassLoader which can load the=20
>classes from the codebase of the object which can from the Javaspace.
>=20
=20
*******************************************
innovative systems GmbH Navigation-Multimedia
Geschaeftsfuehrung: Dr. Peter Geiselhart - Kevin Brown - Edwin Summers - =
Regis Baudot=20
Sitz der Gesellschaft: Hamburg - Registergericht: Hamburg HRB 59980=20
=20
*******************************************
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte =
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese =
E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den =
Absender und loeschen Sie diese Mail. Das unerlaubte Kopieren sowie die =
unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If =
you are not the intended recipient (or have received this e-mail in =
error) please notify the sender immediately and delete this e-mail. Any =
unauthorized copying, disclosure or distribution of the contents in this =
e-mail is strictly forbidden.
*******************************************
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff JAVASPACES-USERS". For general help, send email to
[email protected] and include in the body of the message "help".
To view past JAVASPACES-USERS postings, please see:
http://archives.java.sun.com/archives/javaspaces-users.html