Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » M6 bundles problems
M6 bundles problems [message #31639] Tue, 23 December 2003 17:14 Go to next message
Eclipse UserFriend
Originally posted by: alexsmr.NOJUNK.sympatico.ca

This is a repost from platform newsgroup.

Just wondering. Anybody have problems similar I have? I believe this
info will be useful.

> I'm trying to experiment with M6 but still stuck in very simple (or not?)
> things. Help will be greatly appreciated.

no help so far, but it looks like the problem are specific to my purpose:
playing with OSGi framework. If you just want to run your plugins
with M6 compatability layer - it will work fine.

> 1)As far as I understang using compatability layer I cannot access the the
> Bundle using getBundle on my plugin class because of:
> "java.lang.LinkageError: Class org/osgi/framework/Bundle violates loader
> constraints"

I still have no answer for this. It looks like compatability problem , but
could be a bug.

> 2)When converting the same plugin to bundle I'm getting MANIFEST.MF and
> extensions.xml but there is another problem:
> java.lang.InstantiationException:
> com.trillint.facelet.registry.RegistryPlugin
> at java.lang.Class.newInstance0(Unknown Source)
> at java.lang.Class.newInstance(Unknown Source)
> at
>
org.eclipse.osgi.framework.internal.core.Bundle.loadBundleAc tivator(Bundle.j
> ava:178)
> It is very simple plugin. What I did wrong?

The problem I guess was that I did not had default empty constructor. When
extending my plugin from AbstractUIPlugin I had to provide one. But this
create incompatability with AbstractUIPlugin (it has only one implicit
constructor AbstractUIPlugin(IPluginDescriptor descriptor)). It is not
possiblejust set it to "null" in super() call because you'll fail on
assertion.
I guess it is possible to mock it, but I didn't go further. Instead I just
extended my plugin from Plugin class. Now I was able to run the plugin
as a bundle, but again as soon as I was trying to get the bundle
( Plugin.getBundle ) I fall back to question 1) with

LinkageError: Class org/osgi/framework/Bundle violates loader constrains

If anybody knows what is it about, please help.

Thanks,
Alex.
Re: M6 bundles problems [message #31675 is a reply to message #31639] Tue, 23 December 2003 18:14 Go to previous message
Eclipse UserFriend
Originally posted by: alexsmr.NOJUNK.sympatico.ca

>
> LinkageError: Class org/osgi/framework/Bundle violates loader constrains
>

This was a trivial problem: one must define "Import-Package:
org.osgi.framework"
in manifest file. Otherwise framework will prohibit the use of any class in
this
package. So it is not enough to have Require-Bundle, it is also necessary to
specify the packages that are to be used. somehow I missed this... Sorry.

That is actually means that I cannot access bundles using compatability
layer.

Alex.
Previous Topic:another class loader possible ???
Next Topic:cant Debug using eclipse 2.1
Goto Forum:
  


Current Time: Sat Apr 27 04:00:38 GMT 2024

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

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

Back to the top