Hi,
There might be a few changes that expose the issue:
1) I recently added some code to create a "gateway" bundle that uses the
"Require-Bundle" to aggregate split packages including "META-INF.services".
2) The bundle class loader for tuscany-extensibility-equinox (which has
DynamicImport-Package: *) is used as the parent classloader of the non-OSGi
contributions.
3) The org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceProvider now uses
the following classloaders in order:
* The tuscany-binding-ws-axis2 bundle classloader
* The axis2 bundle classloader
* The tuscany-extensibility-equinox bundle classloader
* The TCCL
I could see the OSGi launcher failure for otest that complains about
ClassNotFoundException for SOAP11Factory and SOAP12Factory. This is a known
issue and we override the MF in producing the distribution.
I just added the same customization for the launcher under [1]. With this
change, I can run the otests under OSGi.
What led you to believe that the classloader is the application classloader?
Is it the output message as follows?
SCA Node API ClassLoader: sun.misc.launcher$appclassloa...@11b86e7
This is a false alarm as the printout is on a proxy of the Node in the
application classloader. The real node is loaded by OSGi as we can see from
the debugger.
Can you point to me the failing test cases you ran into? If the fix in [1]
doesn't help, I can further debug.
[1] http://svn.apache.org/viewvc?rev=800929&view=rev
Thanks,
Raymond
--------------------------------------------------
From: "Mike Edwards" <[email protected]>
Sent: Tuesday, August 04, 2009 5:59 AM
To: "tuscany-dev" <[email protected]>
Subject: [2.x] Classloading Failures running under OSGi with recent code
Folks,
In the past 2 days, I have run into classloading failures with both the
BPEL runtime module and with the Axis2 WS Binding module.
Since these failures did not occur in code previously, I assume that there
has been some significant change in the handling of classloaders in the
2.x stream recently. I'd be grateful if someone could explain what
changes have been made. I'd also like to pose the question as to why the
failures have not been picked up by any testcases?
The problem appears to be with 3rd party code that use the Thread Context
ClassLoader to load classes. The symptom is that we get class not found
errors since under OSGi the bulk of our code is loaded with OSGi
classloaders and the TCCL in the recent builds seems to be the app class
loader.
I fixed the BPEL code by forcing the TCCL to be the OSGI Bundle
ClassLoader used for loading the BPEL runtime module classes, in
EmbeddedODEServer.init().
I fixed the Axis client code by a similar means of forcing the TCCL to be
the OSGi Bundle ClassLoader, in Axis2ServiceClient.createServiceClient().
Yours, Mike.