tuscany-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rajini Sivaram" <rajinisiva...@googlemail.com>
Subject Re: Using contributions in the tutorial, was: Improving the store tutorial module structure
Date Thu, 03 Jan 2008 10:19:50 GMT
On 1/3/08, Jean-Sebastien Delfino <jsdelfino@apache.org> wrote:
>
> Rajini Sivaram wrote:
> > Sebastien,
> >
> > Sorry, ignore my previous note (the one below). Even with assets not in
> the
> > classpath, I can run launch.LaunchCloud as long as the assets
> contribution
> > is added first. The code in svn does:
> >
> >
> > currencyNode.addContribution("http://cloud", cloudContribution);
> >
> > catalogsNode.addContribution("http://assets", assetsContribution);
> >
> > assets should be aded to currencyNode before cloud (at least with the
> > current code). With that change, it runs without throwing any
> exceptions.
> >
> >
>
> With the latest code and after fixing the addContribution calls
> LaunchCloud now works for me too. Thanks.
>
> However, after starting LaunchCloud, starting LaunchStore throws the
> exception below, as o.a.t.implementation.data.api.collection.Collection
> is required by services.ShoppingCart but not on the contribution path.
>
> Adding implementation-data-api.jar and derby.jar as contributions (as I
> did in SVN r608288) is not sufficient as these JARs don't have an
> sca-contribution.xml exporting their classes.
>
> Summary: classes that depend on existing JARs (likely to happen in many
> component implementation classes) cannot be loaded from SCA
> contributions, as the existing JARs are not properly handled by the
> contribution processor.
>
> I'll try to fix the contribution processor, the contribution ClassLoader
> and the import/export machinery later this week.
>
> P.S. Simon, I don't think that you need to wait for the fix for the 1.1
> release.
>
> Here's the exception:
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org.apache.tuscany.sca.implementation.data.collection.Collection
>        at java.lang.ClassLoader.defineClassImpl(Native Method)
>        at java.lang.ClassLoader.defineClass(ClassLoader.java:228)
>        at java.security.SecureClassLoader.defineClass(
> SecureClassLoader.java:148)
>        at java.net.URLClassLoader.defineClass(URLClassLoader.java:557)
>        at java.net.URLClassLoader.access$400(URLClassLoader.java:120)
>        at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:962)
>        at java.security.AccessController.doPrivileged(
> AccessController.java:275)
>        at java.net.URLClassLoader.findClass(URLClassLoader.java:488)
>        at
>
> org.apache.tuscany.sca.contribution.impl.ContributionClassLoader.findClassFromContribution
> (ContributionClassLoader.java:281)
>        at
> org.apache.tuscany.sca.contribution.impl.ContributionClassLoader.findClass
> (ContributionClassLoader.java:85)
>        at
> org.apache.tuscany.sca.contribution.impl.ContributionClassLoader.loadClass
> (ContributionClassLoader.java:142)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
>        at java.lang.ClassLoader.defineClassImpl(Native Method)
>        at java.lang.ClassLoader.defineClass(ClassLoader.java:228)
>        at java.security.SecureClassLoader.defineClass(
> SecureClassLoader.java:148)
>        at java.net.URLClassLoader.defineClass(URLClassLoader.java:557)
>        at java.net.URLClassLoader.access$400(URLClassLoader.java:120)
>        at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:962)
>        at java.security.AccessController.doPrivileged(
> AccessController.java:275)
>        at java.net.URLClassLoader.findClass(URLClassLoader.java:488)
>        at
>
> org.apache.tuscany.sca.contribution.impl.ContributionClassLoader.findClassFromContribution
> (ContributionClassLoader.java:281)
>        at
> org.apache.tuscany.sca.contribution.impl.ContributionClassLoader.findClass
> (ContributionClassLoader.java:85)
>        at
> org.apache.tuscany.sca.contribution.impl.ContributionClassLoader.findClass
> (ContributionClassLoader.java:98)
>        at
> org.apache.tuscany.sca.contribution.impl.ContributionClassLoader.loadClass
> (ContributionClassLoader.java:142)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
>        at java.lang.Class.forNameImpl(Native Method)
>        at java.lang.Class.forName(Class.java:163)
>        at
>
> org.apache.tuscany.sca.contribution.java.impl.ClassReferenceModelResolver.resolveModel
> (ClassReferenceModelResolver.java:95)
>        at
>
> org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver.resolveModel
> (ExtensibleModelResolver.java:127)
>        at
>
> org.apache.tuscany.sca.implementation.java.xml.JavaImplementationProcessor.resolve
> (JavaImplementationProcessor.java:145)
>        at
>
> org.apache.tuscany.sca.implementation.java.xml.JavaImplementationProcessor.resolve
> (JavaImplementationProcessor.java:1)
>        at
>
> org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint$LazyStAXArtifactProcessor.resolve
> (DefaultStAXArtifactProcessorExtensionPoint.java:242)
>        at
>
> org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.resolve
> (ExtensibleStAXArtifactProcessor.java:108)
>        at
>
> org.apache.tuscany.sca.assembly.xml.BaseAssemblyProcessor.resolveImplementation
> (BaseAssemblyProcessor.java:241)
>        at
> org.apache.tuscany.sca.assembly.xml.CompositeProcessor.resolve(
> CompositeProcessor.java:794)
>        at
> org.apache.tuscany.sca.assembly.xml.CompositeProcessor.resolve(
> CompositeProcessor.java:1)
>        at
>
> org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.resolve
> (ExtensibleStAXArtifactProcessor.java:108)
>        at
> org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.resolve(
> CompositeDocumentProcessor.java:113)
>        at
> org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.resolve(
> CompositeDocumentProcessor.java:1)
>        at
>
> org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor.resolve
> (ExtensibleURLArtifactProcessor.java:86)
>        at
>
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.processResolvePhase
> (ContributionServiceImpl.java:423)
>        at
>
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.addContribution
> (ContributionServiceImpl.java:333)
>        at
>
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.contribute
> (ContributionServiceImpl.java:169)
>        at
> org.apache.tuscany.sca.node.impl.SCANodeImpl.addContributionFromDomain(
> SCANodeImpl.java:321)
>        at
> org.apache.tuscany.sca.node.impl.SCANodeImpl.addContribution(
> SCANodeImpl.java:484)
>        at
> org.apache.tuscany.sca.node.impl.SCANodeImpl.addContribution(
> SCANodeImpl.java:478)
>        at launch.LaunchStore.main(LaunchStore.java:45)
>
> --
> Jean-Sebastien
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>
Sebastien,

  Why would you want to add implementation-data-api.jar and derby.jar as
contributions rather than as maven (and Eclipse) project dependencies? With
tuscany-implementation-data-api and derby as   dependencies in pom.xml, I am
able to run LaunchStore without any exceptions (from Eclipse with the
.classpath file generated from the modified pom.xml). I must have missed the
point entirely...

Unlike OSGi bundle dependencies which require all imported packages to be
exported by OSGi bundles, the SCA contribution classloader was designed to
enable Tuscany runtime and other 3rd party libraries to be accessed directly
from contributions without converting these into contributions. The default
thread context classloader is the parent of all contribution classloaders.
Hence all classes in the CLASSPATH are accessible from the contribution
classloader. The packages imported from outside SCA contributions do not
require import statements (import/export statements are used only across SCA
contributions).


Thank you...

Regards,

Rajini

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message