Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Equinox command line vs Equinox Eclipse - Classpath issues.
Equinox command line vs Equinox Eclipse - Classpath issues. [message #120684] Tue, 04 November 2008 16:05 Go to next message
Shaun Galey is currently offline Shaun GaleyFriend
Messages: 16
Registered: July 2009
Junior Member
Gents,


I am having an issue running a packaged jar inside an equinox osgi prompt.
I have all of the dependencies solved and when checking the status of the
bundles, it says "Resolved", though when I run it I get a
NoClassDefFoundError.

When running the same project that the jar is based from inside Eclipse,
everything goes fine.


I have been through a few troubleshooting steps, like checking the
bundle-Classpath - making sure it matches the projects classpath before
jarring.

I would believe there is some quirky, simple thing I have missed in this
equation, an help is appreciated.

A link to the error, http://pastebin.com/m36b44de0

-Shaun
Re: Equinox command line vs Equinox Eclipse - Classpath issues. [message #120696 is a reply to message #120684] Tue, 04 November 2008 16:24 Go to previous messageGo to next message
Simon Kaegi is currently offline Simon KaegiFriend
Messages: 381
Registered: July 2009
Senior Member
Are you using Export --> Deployable plug-ins and fragments to create the
bundle?
I'd also crack open the jar and take a look.

If that's not it could you post your manifest and the rough layout of your
bundle.

-Simon

"Shaun Galey" <sgaley343gs@yahoo.com> wrote in message
news:95af702f3c3f5b93ddbb97ba385eafd7$1@www.eclipse.org...
> Gents,
>
>
> I am having an issue running a packaged jar inside an equinox osgi prompt.
> I have all of the dependencies solved and when checking the status of the
> bundles, it says "Resolved", though when I run it I get a
> NoClassDefFoundError.
>
> When running the same project that the jar is based from inside Eclipse,
> everything goes fine.
>
> I have been through a few troubleshooting steps, like checking the
> bundle-Classpath - making sure it matches the projects classpath before
> jarring.
>
> I would believe there is some quirky, simple thing I have missed in this
> equation, an help is appreciated.
>
> A link to the error, http://pastebin.com/m36b44de0
>
> -Shaun
>
Re: Equinox command line vs Equinox Eclipse - Classpath issues. [message #120704 is a reply to message #120696] Tue, 04 November 2008 16:36 Go to previous messageGo to next message
Shaun Galey is currently offline Shaun GaleyFriend
Messages: 16
Registered: July 2009
Junior Member
Simon,


I just tried exporting with your advice - Deployable Plugins and
Fragments, same issues.

I have cracked open the jar and the .class and .java files are inside of
it in the correct location.

Manifest.MF

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Db Plug-in
Bundle-SymbolicName: qq.mob.db;singleton:=true
Bundle-Version: 0.0.4
Bundle-Activator: qq.mob.db.Activator
Require-Bundle: Jama;bundle-version="1.0.0",
org.apache.log4j,
org.apache.collections;bundle-version="3.2.0",
org.eclipse.core.runtime,
org.eclipse.core.resources,
org.jfree.chart,
qq.mob.scenario,
qq.mob.common;bundle-version="1.0.0",
qq.mob.utility;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Export-Package: org.hibernate,
org.hibernate.criterion,
qq.epi.disease,
qq.epi.model,
qq.mob.db,
qq.mob.db.itrf,
qq.mob.model,
qq.mob.ref,
qq.mob.util
Bundle-ClassPath: .,
lib/antlr-2.7.6.jar,
lib/asm.jar,
lib/asm-attrs.jar,
lib/c3p0-0.9.1.jar,
lib/cglib-2.1.3.jar,
lib/commons-logging-1.0.4.jar,
lib/dom4j-1.6.1.jar,
lib/ejb3-persistence.jar,
lib/hibernate3.jar,
lib/hibernate-annotations.jar,
lib/hibernate-commons-annotations.jar,
lib/jta.jar,
lib/log4j-1.2.11.jar,
lib/mysql-connector-java-3.1.12-bin.jar,
conf/,
lib/Jama-1.0.2.jar
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.osgi.framework;version="1.3.0"



Photo of the project structure.
http://img261.imageshack.us/my.php?image=imageschackkc5.png


-Shaun
Re: Equinox command line vs Equinox Eclipse - Classpath issues. [message #120710 is a reply to message #120704] Tue, 04 November 2008 20:51 Go to previous messageGo to next message
Simon Kaegi is currently offline Simon KaegiFriend
Messages: 381
Registered: July 2009
Senior Member
Hmm... from what you describe structurally it sounds ok.
I suspect the CNF is a nested exception based on another class needed to
define your activator.

One difference when running stand-alone vs. in the IDE is the value of:
org.osgi.framework.bootdelegation
A bundle should import "all" non-java.* packages it uses and at a glance it
appears you're not.

To narrow down the problem try setting "org.osgi.framework.bootdelegation=*"

-Simon


"Shaun Galey" <sgaley343gs@yahoo.com> wrote in message
news:163a26380abed8b8b120213d009c1038$1@www.eclipse.org...
> Simon,
>
>
> I just tried exporting with your advice - Deployable Plugins and
> Fragments, same issues.
>
> I have cracked open the jar and the .class and .java files are inside of
> it in the correct location.
>
> Manifest.MF
>
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: Db Plug-in
> Bundle-SymbolicName: qq.mob.db;singleton:=true
> Bundle-Version: 0.0.4
> Bundle-Activator: qq.mob.db.Activator
> Require-Bundle: Jama;bundle-version="1.0.0",
> org.apache.log4j,
> org.apache.collections;bundle-version="3.2.0",
> org.eclipse.core.runtime,
> org.eclipse.core.resources,
> org.jfree.chart,
> qq.mob.scenario,
> qq.mob.common;bundle-version="1.0.0",
> qq.mob.utility;bundle-version="1.0.0"
> Bundle-ActivationPolicy: lazy
> Export-Package: org.hibernate,
> org.hibernate.criterion,
> qq.epi.disease,
> qq.epi.model,
> qq.mob.db,
> qq.mob.db.itrf,
> qq.mob.model,
> qq.mob.ref,
> qq.mob.util
> Bundle-ClassPath: .,
> lib/antlr-2.7.6.jar,
> lib/asm.jar,
> lib/asm-attrs.jar,
> lib/c3p0-0.9.1.jar,
> lib/cglib-2.1.3.jar,
> lib/commons-logging-1.0.4.jar,
> lib/dom4j-1.6.1.jar,
> lib/ejb3-persistence.jar,
> lib/hibernate3.jar,
> lib/hibernate-annotations.jar,
> lib/hibernate-commons-annotations.jar,
> lib/jta.jar,
> lib/log4j-1.2.11.jar,
> lib/mysql-connector-java-3.1.12-bin.jar,
> conf/,
> lib/Jama-1.0.2.jar
> Bundle-RequiredExecutionEnvironment: JavaSE-1.6
> Import-Package: org.osgi.framework;version="1.3.0"
>
>
>
> Photo of the project structure.
> http://img261.imageshack.us/my.php?image=imageschackkc5.png
>
>
> -Shaun
>
>
Re: Equinox command line vs Equinox Eclipse - Classpath issues. [message #120717 is a reply to message #120710] Tue, 04 November 2008 22:31 Go to previous messageGo to next message
Shaun Galey is currently offline Shaun GaleyFriend
Messages: 16
Registered: July 2009
Junior Member
Simon,


I inserted osgi.java.profile.bootdelegation=* into my config.ini file and
I see no difference.

I placed some System.outs into the Activator before and after the
DBServiceFactory call and also inside DBServiceFactory.

I receive the System.outs from before the Servicefactory call and not
after, as expected. I don't get any outs from within servicefactory though.

I am not sure of how to proceed, thank you for your help.

-Shaun
Re: Equinox command line vs Equinox Eclipse - Classpath issues. [message #120724 is a reply to message #120717] Tue, 04 November 2008 23:06 Go to previous messageGo to next message
Simon Kaegi is currently offline Simon KaegiFriend
Messages: 381
Registered: July 2009
Senior Member
Use org.osgi.framework.bootdelegation=*

osgi.java.profile.bootdelegation is a different property

"Shaun Galey" <sgaley343gs@yahoo.com> wrote in message
news:ee905c1024c3557ceab2609894400fde$1@www.eclipse.org...
> Simon,
>
>
> I inserted osgi.java.profile.bootdelegation=* into my config.ini file and
> I see no difference.
>
> I placed some System.outs into the Activator before and after the
> DBServiceFactory call and also inside DBServiceFactory.
>
> I receive the System.outs from before the Servicefactory call and not
> after, as expected. I don't get any outs from within servicefactory
> though.
>
> I am not sure of how to proceed, thank you for your help.
>
> -Shaun
>
Re: Equinox command line vs Equinox Eclipse - Classpath issues. [message #120730 is a reply to message #120724] Tue, 04 November 2008 23:23 Go to previous messageGo to next message
Shaun Galey is currently offline Shaun GaleyFriend
Messages: 16
Registered: July 2009
Junior Member
Thank you Simon, you are the man.


I appreciate all the help you gave me, bootdelegation fixed it.

-Shaum
Re: Equinox command line vs Equinox Eclipse - Classpath issues. [message #120736 is a reply to message #120730] Tue, 04 November 2008 23:57 Go to previous messageGo to next message
Simon Kaegi is currently offline Simon KaegiFriend
Messages: 381
Registered: July 2009
Senior Member
That's great.
Also see http://wiki.eclipse.org/Equinox_Boot_Delegation

What you have might work for you but it would be better to explicitly
declare your imports as it does impact performance and
modularity/portability.
-Simon

"Shaun Galey" <sgaley343gs@yahoo.com> wrote in message
news:5000a71041fff3dbb39612f3d6db14dc$1@www.eclipse.org...
> Thank you Simon, you are the man.
>
>
> I appreciate all the help you gave me, bootdelegation fixed it.
>
> -Shaum
>
Re: Equinox command line vs Equinox Eclipse - Classpath issues. [message #120747 is a reply to message #120736] Wed, 05 November 2008 17:48 Go to previous message
Shaun Galey is currently offline Shaun GaleyFriend
Messages: 16
Registered: July 2009
Junior Member
Simon,

I would like to explicitly declare them, but I don't know what imports the
bootdelegation is calling.

Could you give me a list or and idea of where to look to get those jars?

-Shaum

Simon Kaegi wrote:

> That's great.
> Also see http://wiki.eclipse.org/Equinox_Boot_Delegation

> What you have might work for you but it would be better to explicitly
> declare your imports as it does impact performance and
> modularity/portability.
> -Simon

> "Shaun Galey" <sgaley343gs@yahoo.com> wrote in message
> news:5000a71041fff3dbb39612f3d6db14dc$1@www.eclipse.org...
>> Thank you Simon, you are the man.
>>
>>
>> I appreciate all the help you gave me, bootdelegation fixed it.
>>
>> -Shaum
>>
Previous Topic:p2-self provisioning into emty folder or assembled product?
Next Topic:p2 works... the second time
Goto Forum:
  


Current Time: Wed Sep 18 23:55:54 GMT 2024

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

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

Back to the top