Classpaths and OSGi spell tricky when on the same sentence.

How do you *search *for classes in your class loading mechanism?

Rodrigo

On Fri, Feb 22, 2008 at 2:58 AM, Mike Smoot <[EMAIL PROTECTED]> wrote:

> I'm not sure I understand the question, but once we get a Class object
> from
> the ClassLoader given a name, we call newInstance() on it.  Then it's up
> to
> the plugin to do it's thing.
>
> Or are you asking how we get the ClassLoader in the first place?  We do
> that
> by creating a URLClassLoader with a list of urls that point to the plugin
> jar files.
>
> Or are you asking something else?
>
> thanks,
> Mike
>
> On Thu, Feb 21, 2008 at 6:45 PM, Rodrigo Madera <[EMAIL PROTECTED]>
> wrote:
>
> > What algorithm does your class loading use?
> >
> > Regards,
> > Rodrigo
> >
> > On Fri, Feb 22, 2008 at 2:40 AM, Mike Smoot <[EMAIL PROTECTED]>
> wrote:
> >
> > > Hi,
> > >
> > > I'm working on migrating an existing swing application (
> > > http://cytoscape.org)
> > > to OSGi using Felix.  With the help of bnd, I've gotten everything
> > running
> > > about how it should, with the exception of our legacy plugin
> mechanism.
> > >  The
> > > way the old plugin mechanism works is that a plugin jar file (but not
> a
> > > bundle) is read and we then call ClassLoader.loadClass() on a class
> > found
> > > in
> > > the jar file.  The problem is that with Felix I get a
> > NoClassDefFoundError
> > > when I try to load the class.   I'm assuming this is because none of
> the
> > > packages defined in the plugin jar are found by Felix since the plugin
> > > jars
> > > aren't bundles or loaded as such.
> > >
> > > Now, I've managed to work around this problem in two cases.  First is
> > > using
> > > Equinox, which I'm not terribly keen on using.  Second is by running
> bnd
> > > on
> > > each plugin jar, loading them as bundles, jumping through a few hoops
> to
> > > get
> > > the correct ClassLoader, and then loading the class.  The problem with
> > the
> > > second approach is that I have to wrap all plugins before anything
> will
> > > work.  I'd very much like to avoid this requirement (for now) because
> > this
> > > will only work with plugins that I have and not those developed by
> > users.
> > >
> > > Can anyone provide any guidance on loading classes that aren't part of
> > > bundles?  Is this possible with Felix?  I apologize if this is a bit
> > > vague,
> > > but I'm still very new to OSGi.
> > >
> > > thanks,
> > > Mike
> > >
> > > --
> > > ____________________________________________________________
> > > Michael Smoot, Ph.D. Bioengineering Department
> > > tel: 858-822-4756 University of California San Diego
> > >
> >
>
>
>
> --
> ____________________________________________________________
> Michael Smoot, Ph.D. Bioengineering Department
> tel: 858-822-4756 University of California San Diego
>

Reply via email to