[ 
https://issues.apache.org/jira/browse/TUSCANY-2343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12602292#action_12602292
 ] 

Rajini Sivaram commented on TUSCANY-2343:
-----------------------------------------

Daniel,

The latest stack trace looks like a problem with thread context classloading. 
For XML parsing, the classes from third party bundles should be visible from 
TCCL. Tuscany's bundle activator sets up a TCCL which includes all 3rd party 
bundles. If this bundle activator is run from a different thread from the one 
starting the Tuscany runtime (or if you want to modify TCCL), you have to 
ensure that TCCL has access to classes from 3rd party libs. The TCCL set by 
Tuscany can be obtained using 
o.a.t.s.osgi.runtime.OSGiRuntime.getContextClassLoader(). In your test bundle 
activator, could you try calling
      
Thread.currentThread().setContextClassLoader(OSGiRuntime.getContextClassLoader());

before starting the Tuscany runtime? This should really be fixed properly in 
Tuscany (at least for straightforward usecases), but for now, could you try 
this fix?

- Rajini

> 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