You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Barnhill, William [USA]" <ba...@bah.com> on 2009/03/25 13:21:12 UTC

Help with SDO and OSGI (specifically Apache Felix)

Hi All,
 
I am trying to use SDO from within an OSGI bundle and am having a hard time. I've gotten to the point of being able to install and resolve the following:
  tuscany-sdo-impl-1.1.1.jar
  tuscany-sdo-lib-1.1.1.jar
  tuscany-sdo-api-r2.1-1.1.1.jar
  my bundles (one is app, one is util lib)
but this is through hacking at the manifests.
 
The manifests for each are attached.
 
Import package for my util bundle contains:
org.apache.tuscany.sdo.helper,org.apache.tuscany.sdo.spi,commonj.sdo,commonj.sdo.helper,commonj.sdo.impl, org.apache.tuscany.sdo.api,.
 
Import package for app contains same.
 
When starting my app bundle after installing all the others, I get:
java.lang.NoClassDefFoundError: org/apache/tuscany/sdo/spi/HelperProviderBase
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1544)
        at org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:509)
        at org.apache.felix.framework.searchpolicy.ModuleImpl.access$100(ModuleImpl.java:59)
        at org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1434)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at org.apache.felix.framework.searchpolicy.ModuleImpl.getClassByDelegation(ModuleImpl.java:428)
        at org.apache.felix.framework.searchpolicy.R4Wire.getClass(R4Wire.java:108)
        at org.apache.felix.framework.searchpolicy.ModuleImpl.searchImports(ModuleImpl.java:1131)
        at org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:504)
        at org.apache.felix.framework.searchpolicy.ModuleImpl.access$100(ModuleImpl.java:59)
        at org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1434)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at mil.af.rl.rigc.sarm.nerve.sdk.AbstractNerve.onAuthenticated(AbstractNerve.java:65)
        at mil.af.rl.rigc.sarm.utils.AbstractXmppAgent.exec(AbstractXmppAgent.java:130)
        at mil.af.rl.rigc.sarm.nerve.winhost.DemoNerve.start(DemoNerve.java:57)
        at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:589)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1458)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:984)
        at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:263)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: org.apache.tuscany.sdo.spi.HelperProviderBase
        at org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:565)
        at org.apache.felix.framework.searchpolicy.ModuleImpl.access$100(ModuleImpl.java:59)
        at org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1434)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        ... 23 more
 
My environment is
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
Windows XP
org.apache.felix.main-1.5.0-20090317.125733-9.jar
Using bnd-0.0.249.jar to OSGI-ify jars after stripping them (could not get to work with given OSGI headers, due to missing spec bundle and other messages)
 
I've tried hand modifying with various versions of manifest, using require-bundle in one try, Bundle-Classpath with impl jar embedded in app jar in another try.
 
I found Issue 1293 from last year, but the fixes seem to have been applied and I'm still getting ClassNotFound error.
 
Any help is greatly appreciated,
Thanks,
Bill Barnhill
 
 

Re: Help with SDO and OSGI (specifically Apache Felix)

Posted by Raymond Feng <en...@gmail.com>.
Hi,

Can you try to add the org.apache.tuscany.sdo.spi package to the 
Import-Package header of your bundle?

I recently look into the sdo jars for Tuscany SCA Java 2.x databinding-sdo 
module in the OSGi environment. We'll author and test the MANIFEST.MF. Maybe 
we can work together to improve the sdo bundles and release them.

Thanks,
Raymond

From: Barnhill, William [USA]
Sent: Wednesday, March 25, 2009 5:21 AM
To: dev@tuscany.apache.org
Subject: Help with SDO and OSGI (specifically Apache Felix)


Hi All,

I am trying to use SDO from within an OSGI bundle and am having a hard time. 
I've gotten to the point of being able to install and resolve the following:
  tuscany-sdo-impl-1.1.1.jar
  tuscany-sdo-lib-1.1.1.jar
  tuscany-sdo-api-r2.1-1.1.1.jar
  my bundles (one is app, one is util lib)
but this is through hacking at the manifests.

The manifests for each are attached.

Import package for my util bundle contains:
org.apache.tuscany.sdo.helper,org.apache.tuscany.sdo.spi,commonj.sdo,commonj.sdo.helper,commonj.sdo.impl, 
org.apache.tuscany.sdo.api,.

Import package for app contains same.

When starting my app bundle after installing all the others, I get:
java.lang.NoClassDefFoundError: 
org/apache/tuscany/sdo/spi/HelperProviderBase
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at 
org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1544)
        at 
org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:509)
        at 
org.apache.felix.framework.searchpolicy.ModuleImpl.access$100(ModuleImpl.java:59)
        at 
org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1434)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at 
org.apache.felix.framework.searchpolicy.ModuleImpl.getClassByDelegation(ModuleImpl.java:428)
        at 
org.apache.felix.framework.searchpolicy.R4Wire.getClass(R4Wire.java:108)
        at 
org.apache.felix.framework.searchpolicy.ModuleImpl.searchImports(ModuleImpl.java:1131)
        at 
org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:504)
        at 
org.apache.felix.framework.searchpolicy.ModuleImpl.access$100(ModuleImpl.java:59)
        at 
org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1434)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at 
mil.af.rl.rigc.sarm.nerve.sdk.AbstractNerve.onAuthenticated(AbstractNerve.java:65)
        at 
mil.af.rl.rigc.sarm.utils.AbstractXmppAgent.exec(AbstractXmppAgent.java:130)
        at 
mil.af.rl.rigc.sarm.nerve.winhost.DemoNerve.start(DemoNerve.java:57)
        at 
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:589)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1458)
        at 
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:984)
        at 
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:263)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: 
org.apache.tuscany.sdo.spi.HelperProviderBase
        at 
org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:565)
        at 
org.apache.felix.framework.searchpolicy.ModuleImpl.access$100(ModuleImpl.java:59)
        at 
org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1434)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        ... 23 more

My environment is
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
Windows XP
org.apache.felix.main-1.5.0-20090317.125733-9.jar
Using bnd-0.0.249.jar to OSGI-ify jars after stripping them (could not get 
to work with given OSGI headers, due to missing spec bundle and other 
messages)

I've tried hand modifying with various versions of manifest, using 
require-bundle in one try, Bundle-Classpath with impl jar embedded in app 
jar in another try.

I found Issue 1293 from last year, but the fixes seem to have been applied 
and I'm still getting ClassNotFound error.

Any help is greatly appreciated,
Thanks,
Bill Barnhill