Luciano, At the moment, Tuscany can only have one model resolver for resolution of classes - the ExtensibleModelResolver chooses ClassReferenceModelResolver when a ClassReference is resolved. If a contribution is an OSGi bundle contribution, OSGi bundle resolution should override the classloader based resolution. But I couldn't figure out a neat way to do this without forcing ClassReferenceModelResolver to check if OSGi can be used to resolve the class first.
Sebastien's proposed changes on contribution classloading ( http://www.mail-archive.com/tuscany-dev@ws.apache.org/msg28608.html) is expected to fix this. On 3/18/08, Luciano Resende <[EMAIL PROTECTED]> wrote: > > Thanks Rajini, it got me further. But I have a question related to > your fix, it looks like you are now handling when the OSGI Runtime is > not on the classpath. Should we even be triggering some of the OSGI > related code when the OSGi runtime is not in use ? I'm wondering how > this could affect the simple paths where no OSGI integration is > required (e.g default jar contributions and/or file system > contributions. Thoughts ? > > On Mon, Mar 17, 2008 at 2:20 AM, Rajini Sivaram > <[EMAIL PROTECTED]> wrote: > > Luciano, > > > > I have fixed this under revision 637797. > > > > > > > > > > On 3/17/08, Luciano Resende <[EMAIL PROTECTED]> wrote: > > > > > > I'm trying to run the Calculator sample from a SCA Distribution > > > (trunk) and I'm noticing that it now requires OSGI dependencies. > Could > > > someone please let me know if this is working as expected ? Below is > > > the exception I'm getting with regular SCA dependencies. > > > > > > (To reproduce, build distribution and run the sample calculator) > > > > > > > > > run: > > > [java] Exception in thread "main" java.lang.NoClassDefFoundError: > > > org/osgi/framework/BundleException > > > [java] at > > > > > > > org.apache.tuscany.sca.contribution.osgi.impl.OSGiClassReferenceModelResolver.initialize > > > (OSGiClassReferenceModelResolver.java:128) > > > [java] at > > > > > > > org.apache.tuscany.sca.contribution.osgi.impl.OSGiClassReferenceModelResolver.resolveModel > > > (OSGiClassReferenceModelResolver.java:85) > > > [java] at > > > > > > > org.apache.tuscany.sca.contribution.java.impl.ClassReferenceModelResolver.resolveModel > > > (ClassReferenceModelResolver.java:95) > > > [java] at > > > > > > > org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver.resolveModel > > > (ExtensibleModelResolver.java:150) > > > [java] at > > > > > > > org.apache.tuscany.sca.implementation.java.xml.JavaImplementationProcessor.resolve > > > (JavaImplementationProcessor.java:145) > > > [java] at > > > > > > > org.apache.tuscany.sca.implementation.java.xml.JavaImplementationProcessor.resolve > > > (JavaImplementationProcessor.java:65) > > > [java] at > > > > > > > org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint$LazyStAXArtifactProcessor.resolve > > > (DefaultStAXArtifactProcessorExtensionPoint.java:252) > > > [java] at > > > > > > > org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.resolve > > > (ExtensibleStAXArtifactProcessor.java:109) > > > [java] at > > > > > > > org.apache.tuscany.sca.assembly.xml.BaseAssemblyProcessor.resolveImplementation > > > (BaseAssemblyProcessor.java:248) > > > [java] at > > > org.apache.tuscany.sca.assembly.xml.CompositeProcessor.resolve( > > > CompositeProcessor.java:876) > > > [java] at > > > org.apache.tuscany.sca.assembly.xml.CompositeProcessor.resolve( > > > CompositeProcessor.java:80) > > > [java] at > > > > > > > org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.resolve > > > (ExtensibleStAXArtifactProcessor.java:109) > > > [java] at > > > > org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.resolve( > > > CompositeDocumentProcessor.java:129) > > > [java] at > > > > org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.resolve( > > > CompositeDocumentProcessor.java:52) > > > [java] at > > > > > > > org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor.resolve > > > (ExtensibleURLArtifactProcessor.java:86) > > > [java] at > > > > > > > org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.processResolvePhase > > > (ContributionServiceImpl.java:464) > > > [java] at > > > > > > > org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.addContribution > > > (ContributionServiceImpl.java:348) > > > [java] at > > > > > > > org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.contribute > > > (ContributionServiceImpl.java:161) > > > [java] at > > > > org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.addContribution > > > (DefaultSCADomain.java:272) > > > [java] at > > > org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.init( > > > DefaultSCADomain.java:155) > > > [java] at > > > org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init>( > > > DefaultSCADomain.java:109) > > > [java] at > > > org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance( > > > SCADomain.java:230) > > > [java] at > > > org.apache.tuscany.sca.host.embedded.SCADomain.newInstance( > SCADomain.java > > > :69) > > > [java] at calculator.CalculatorClient.main( > CalculatorClient.java > > > :31) > > > [java] Java Result: 1 > > > > > > > > > -- > > > Luciano Resende > > > Apache Tuscany Committer > > > http://people.apache.org/~lresende > > > http://lresende.blogspot.com/ > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > -- > > Thank you... > > > > Regards, > > > > Rajini > > > > > > -- > Luciano Resende > Apache Tuscany Committer > http://people.apache.org/~lresende > http://lresende.blogspot.com/ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Thank you... Regards, Rajini