|
|
Re: ClassLoading/Security issue [message #32644 is a reply to message #32575] |
Mon, 12 January 2004 01:59 |
Eclipse User |
|
|
|
Originally posted by: jeff_mcaffer.ca.ibm.com
Sten,
That's what I was thinking. I noted something curious in your code
ClassLoader sysloader = ClassLoader.getSystemClassLoader();
Class loaded = sysloader.loadClass( Cryptix.class.getName());
You should look carefully at the error that results. I suspect you are
actually getting the classload error on the Cryptix.class.getName() not on
the loadClass(). While it is possible that the compiler optimizes this out
(theoretically it knows the name of the class since it found it at compile
time) I don't think they worry about that as an optimization.
So what you are doing is trying to load Cryptix with the classloader that
loaded your method just to get the name and then trying to load it again
using the SystemClassLoader. As noted in bug 30919, only the Boot
classloader is available to plugins. In this case you should just be able
to put in the actual full name for Cryptix and be happy.
One thing confuses me. You say that this works in older versions of Eclipse
and not M6. Can you confirm that the exact same code runs in say M5 but
does not run in M6? (OSGi was introduced after M5).
Jeff
"Sten Ernerot" <ernerot@attglobal.net> wrote in message
news:btsclr$8v1$1@eclipse.org...
> I think my problem is related to this:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=30919
>
> Cheers
> Sten
>
> "Sten Ernerot" <ernerot@attglobal.net> wrote in message
> news:btsau4$78b$1@eclipse.org...
> > Hi
> >
> > I have converted some of my plugins to OSGi bundles and it works fine:-)
> >
> > But when coverting one using Jxta I got some trouble:
> >
> > Jxta is defining a java.security.Provider and it
|
|
|
|
|
Re: ClassLoading/Security issue [message #33242 is a reply to message #32768] |
Wed, 14 January 2004 16:32 |
Eclipse User |
|
|
|
Originally posted by: jeff_mcaffer_REMOVE.ca.ibm.com
Sorry, I was assuming that the Cryptix stuff was in the endorsed or
extensions dirs and so the challenge here was loading from the system vs the
boot classloader.
If you try to load the class from your plugin's classloader then it should
prereq the plugin containing the Cryptix code. Does that make sense?
Jeff
"Sten Ernerot" <ernerot@attglobal.net> wrote in message
news:btufui$gs7$1@eclipse.org...
> After some further checking...
>
> I does not matter if I change
> Class loaded = sysloader.loadClass( Cryptix.class.getName());
> to
> Class loaded = sysloader.loadClass( "cryptix.provider.Cryptix");
> since the SystemClassLoader does not have any knowlegde of my classpath
> entries only the launcher startup classes.
>
> Jxta tries to load the classes on system level, if not it loads it using
the
> class classloader.
> The class gets loaded but then it doesnt work. I guess this is a question
> for the Jxta list to avoid when classpath doesnt get set during the
"normal"
> vm startup.
>
> Any input appreciated
>
> Regards
> Sten
>
>
> "Jeff McAffer" <jeff_mcaffer@ca.ibm.com> wrote in message
> news:btsv0b$ol4$1@eclipse.org...
> > Sten,
> >
> > That's what I was thinking. I noted something curious in your code
> > ClassLoader sysloader = ClassLoader.getSystemClassLoader();
> > Class loaded = sysloader.loadClass( Cryptix.class.getName());
> > You should look carefully at the error that results. I suspect you are
> > actually getting the classload error on the Cryptix.class.getName() not
on
> > the loadClass(). While it is possible that the compiler optimizes this
> out
> > (theoretically it knows the name of the class since it found it at
compile
> > time) I don't think they worry about that as an optimization.
> >
> > So what you are doing is trying to load Cryptix with the classloader
that
> > loaded your method just to get the name and then trying to load it again
> > using the SystemClassLoader. As noted in bug 30919, only the Boot
> > classloader is available to plugins. In this case you should just be
able
> > to put in the actual full name for Cryptix and be happy.
> >
> > One thing confuses me. You say that this works in older versions of
> Eclipse
> > and not M6. Can you confirm that the exact same code runs in say M5 but
> > does not run in M6? (OSGi was introduced after M5).
> >
> > Jeff
> >
> > "Sten Ernerot" <ernerot@attglobal.net> wrote in message
> > news:btsclr$8v1$1@eclipse.org...
> > > I think my problem is related to this:
> > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=30919
> > >
> > > Cheers
> > > Sten
> > >
> > > "Sten Ernerot" <ernerot@attglobal.net> wrote in message
> > > news:btsau4$78b$1@eclipse.org...
> > > > Hi
> > > >
> > > > I have converted some of my plugins to OSGi bundles and it works
> fine:-)
> > > >
> > > > But when coverting one using Jxta I got some trouble:
> > > >
> > > > Jxta is defining a java.security.Provider and it
|
|
|
|
Powered by
FUDForum. Page generated in 0.03282 seconds