Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Classes missing in deployment environment(There are apparent differences between the OSGi environment supported by Eclipse and the Equinox environment. How do I compensate?)
Classes missing in deployment environment [message #633569] Mon, 18 October 2010 12:44 Go to next message
Robert Brown III is currently offline Robert Brown IIIFriend
Messages: 36
Registered: July 2009
Member
Greetings:

I have developed an OSGi application from within Eclipse and have sought to deploy it to an actual Equinox environment (using Equinox 3.6.1).

The application runs without problems in Eclipse, but when I try to install the exportable bundles into Equinox, I am getting NoClassDefFound exceptions (so far on my JAXB classes) and a really weird failure which says that I need the org.eclipse.core.runtime bundle.

Obviously, I need to include more "stuff" into my Equinox environment, but where are the bundles that I need to include? Where, for example, is the JAR file that contains the runtime bundle?

Can anyone help with these problems?
Re: Classes missing in deployment environment [message #633575 is a reply to message #633569] Mon, 18 October 2010 12:53 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Robert Brown III wrote:
>
> Obviously, I need to include more "stuff" into my Equinox environment,
> but where are the bundles that I need to include? Where, for example, is
> the JAR file that contains the runtime bundle?

You can find out which bundle supplies a given class from the Open Type
dialog. See
http://wiki.eclipse.org/FAQ_How_do_I_find_a_particular_class _from_an_Eclipse_plug-in%3F



--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: Classes missing in deployment environment [message #633582 is a reply to message #633569] Mon, 18 October 2010 13:02 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
My guess is that you are not specifying Import-Package in your bundle manfest for the jaxb packages. When launching the framework from eclipse there is a compatibility setting which does last resort boot delegation for any class lookup if it cannot be found through normal OSGi delegation:

osgi.compatibility.bootdelegation=true

Depending on how you launch Equinox outside of eclipse this setting may be disabled. For example, if you launch with:

java -jar org.eclipse.osgi.jar ...

Then this option is set to false. You can try the following to see if it helps:

java -Dosgi.compatibility.bootdelegation=true -jar org.eclipse.osgi.jar

In OSGi you must specify all your requirements on the packages you need. This includes packages supplied from the VM. The only exception to this rule is the java.* packages. So you should add the jaxb packages you need to your bundle's Import-Package header.

HTH

Tom.
Re: Classes missing in deployment environment [message #633615 is a reply to message #633582] Mon, 18 October 2010 14:48 Go to previous messageGo to next message
Robert Brown III is currently offline Robert Brown IIIFriend
Messages: 36
Registered: July 2009
Member
I found the problem(s).

Sorry to have bothered everyone with this. It turns out that there is a whole deployment system set up in Eclipse that automatically validates and includes all needed bundles. I didn't look too closely at it; I just thought I would simply dump all the bundles into a directory, install them, and everything would work. Once I started using the deployment system, I began seeing what I was missing.

It turned out I was only missing one bundle; once I set up everything properly my app runs OK outside the IDE.

Again: sorry to have bothered everyone...
Re: Classes missing in deployment environment [message #633627 is a reply to message #633615] Mon, 18 October 2010 15:06 Go to previous message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
But what is still confusing is why you got a NoClassDefFound error instead of a bundle resolution error. If you were simply missing a bundle I would have expected the bundle depending on jaxb to fail to resolve (assuming you specified a constraint on jaxb with Import-Package or Require-Bundle).

Are you using Dynamic-ImportPackage? or using optional dependencies?

Tom.
Previous Topic:Dynamic Service Discovery/Loading
Next Topic:Classloading issue for overwritten classes
Goto Forum:
  


Current Time: Thu Apr 25 12:59:04 GMT 2024

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

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

Back to the top