Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » ClassLoading/Security issue
ClassLoading/Security issue [message #32540] Sun, 11 January 2004 20:18 Go to next message
Sten Ernerot is currently offline Sten ErnerotFriend
Messages: 26
Registered: July 2009
Junior Member
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 #32575 is a reply to message #32540] Sun, 11 January 2004 20:47 Go to previous messageGo to next message
Sten Ernerot is currently offline Sten ErnerotFriend
Messages: 26
Registered: July 2009
Junior Member
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 #32644 is a reply to message #32575] Mon, 12 January 2004 01:59 Go to previous messageGo to next message
Eclipse UserFriend
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 #32714 is a reply to message #32644] Mon, 12 January 2004 09:23 Go to previous messageGo to next message
Sten Ernerot is currently offline Sten ErnerotFriend
Messages: 26
Registered: July 2009
Junior Member
Hi

Thanks for your replay.

Actually I cannot confirm it worket in earlier version.
I think it worked due to the fact that I earlier added the classes
with -Djava.endorsed.dirs

I will try your suggestions, and get back.

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
Re: ClassLoading/Security issue [message #32768 is a reply to message #32644] Mon, 12 January 2004 15:56 Go to previous messageGo to next message
Sten Ernerot is currently offline Sten ErnerotFriend
Messages: 26
Registered: July 2009
Junior Member
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
Re: ClassLoading/Security issue [message #33242 is a reply to message #32768] Wed, 14 January 2004 16:32 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: ClassLoading/Security issue [message #33956 is a reply to message #33242] Fri, 16 January 2004 16:33 Go to previous message
Sten Ernerot is currently offline Sten ErnerotFriend
Messages: 26
Registered: July 2009
Junior Member
Actually I found that the actual problem was something else. (Log4J was not
on the classpath and that causes another unloadable and then and then...

Thanks for your input.
Regards
Sten

"Jeff McAffer" <jeff_mcaffer_REMOVE@ca.ibm.com> wrote in message
news:bu3qtt$upg$1@eclipse.org...
> 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
Previous Topic:Importing existing Bundles
Next Topic:Wich OSGi services are planned
Goto Forum:
  


Current Time: Thu Apr 25 16:34:29 GMT 2024

Powered by FUDForum. Page generated in 0.03282 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top