[ 
https://issues.apache.org/jira/browse/TUSCANY-2343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Stucky updated TUSCANY-2343:
-----------------------------------

    Attachment: test_bundles.zip

Hi Rajini,

I build the 3rd party bundles with the installer. I had to remove the activemq 
bundle (we also use one) because during pdebuild it generated a cycle. After 
that pdebuild works. However, suddenly our test bundles did not run anymore in 
eclipse.

Attached are 2 test bundles that simulate the usage in our project, without any 
additional 3rd party dependencies). One contains a DeclerativeService, the 
other starts a SCA Domain that uses this DS (via implementation.type osgi).

I provided 2 eclipse launch configurations. One uses the the osgi.installer 
bundle, the other does not use the installer but uses the required tuscany and 
3rd party bundles directly. (you will also need the bundles 
org.eclipse.equinox.ds and org.eclipse.equinox.util)

The launch with the installer works fine.
The launch using the bundles stops with the following exception:
java.lang.NullPointerException
        at 
org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntime.start(ReallySmallRuntime.java:124)
        at 
org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain.start(EmbeddedSCADomain.java:79)
        at 
org.eclipse.eilf.scatestdomain.ScaDomainActivator.initDomainByContribution(ScaDomainActivator.java:100)
        at 
org.eclipse.eilf.scatestdomain.ScaDomainActivator.start(ScaDomainActivator.java:56)
        at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:999)
        at java.security.AccessController.doPrivileged(Native Method)
        at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:993)
        at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:974)
        at 
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
        at 
org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:350)
        at 
org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1118)
        at 
org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:634)
        at 
org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:508)
        at 
org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:282)
        at 
org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:468)
        at 
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:195)
        at 
org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:297)


The problem ist that the ServiceDiscovery does not find 
"META-INF/services/org.apache.tuscany.sca.work.WorkScheduler". So in class 
ReallySmallRuntime the
- member variable workScheduler is null
- variable factories is null (wich leads to the NPE)

This is a classloading problem I was not able to solve.
BTW: is this a feasible way to create a SCADomain within OSGi ?

> OSGi bundle design leads to class loading issues
> ------------------------------------------------
>
>                 Key: TUSCANY-2343
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2343
>             Project: Tuscany
>          Issue Type: Bug
>            Reporter: Georg Schmidt
>         Attachments: Libary Versions.xls, test_bundles.zip
>
>
> Currently the design of the OSGi bundles leads to class loading exceptions. 
> There seem to be several reasons for this behavior:
> * reexporting of all libraries without version numbers
> * imports without version numbers
> Please use distinct bundles for 3rd party libraries. That would lead to 
> easier reusage of your bundles in a larger OSGi project.
> The current status leads to undefined system behaviour due to the OSGi class 
> loading concept.
> Please tell if you see a way, how we could support you by achieving this 
> goal. (If a solution is interesting for you)  We are willing to contribute 
> because its a critical project issue for us.
> The problems occur with the current snapshot release. Sorry, I do not know 
> which version to take.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to