1

我正在尝试学习服务组件架构 (SCA),因此我从以下链接中的 Apache Tuscany 教程开始:http: //tuscany.apache.org/getting-started-with-tuscany.html

在本教程的开头,作者提供了一个指向最新发行版的链接,并要求从该链接下载 tuscany 库。这是他提供的链接: http: //cwiki.apache.org/TUSCNY/sca-java-releases.html

每当我打开此链接时,页面都会显示:The requested URL /TUSCANY/sca-java-releases.html was not found on this server.

所以,我试图通过在谷歌中搜索 apache-tuscany-sca-1.3.2 来解决这个问题。虽然,我只找到了 apache-tuscany-sca-1.6.2 的库。我从这个链接下载了它们:http: //tuscany.apache.org/sca-java-1x-releases.html,我按照教程进行操作。

但是,似乎缺少 apache-tuscany-sca-1.6.2 库。在教程的第一部分中说创建目录界面,

package services;

    import org.osoa.sca.annotations.Remotable;

    @Remotable
    public interface Catalog {
        Item[] get();
    }

在这里,我在这一行得到一个错误import org.osoa.sca.annotations.Remotable;。这个库不存在于我下载的 TUSCNY 库中。

我试图通过搜索包含org.osoa.sca.annotations.Remotable. 我找到了一个并将其添加到库中。我一遍又一遍地做类似的事情来获取丢失的 jar 文件,并将它们添加到 tuscany 库中。但是,当我运行程序时,我得到了错误。这些错误将我引导到我添加到 tuscany 库中的 jar 文件。以下是错误:

Starting ...
يول 12, 2013 7:08:54 م org.apache.tuscany.sca.node.impl.NodeImpl <init>
INFO: Creating node: store.composite
يول 12, 2013 7:08:55 م org.apache.tuscany.sca.node.impl.NodeImpl configureNode
INFO: Loading contribution: file:/C:/Users/student/workspace/store/bin/
Exception in thread "main" org.osoa.sca.ServiceRuntimeException: java.lang.NullPointerException
    at org.apache.tuscany.sca.node.impl.NodeImpl.<init>(NodeImpl.java:204)
    at org.apache.tuscany.sca.node.impl.NodeFactoryImpl.createSCANodeFromClassLoader(NodeFactoryImpl.java:37)
    at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.init(DefaultSCADomain.java:178)
    at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init>(DefaultSCADomain.java:100)
    at org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADomain.java:182)
    at org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(SCADomain.java:63)
    at launch.Launch.main(Launch.java:8)
Caused by: java.lang.NullPointerException
    at org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint.addDataBinding(DefaultDataBindingExtensionPoint.java:85)
    at org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint.loadDataBindings(DefaultDataBindingExtensionPoint.java:122)
    at org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint.introspectType(DefaultDataBindingExtensionPoint.java:196)
    at org.apache.tuscany.sca.core.databinding.processor.DataBindingJavaInterfaceProcessor.processInterface(DataBindingJavaInterfaceProcessor.java:128)
    at org.apache.tuscany.sca.core.databinding.processor.DataBindingJavaInterfaceProcessor.visitInterface(DataBindingJavaInterfaceProcessor.java:55)
    at org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceIntrospectorImpl.introspectInterface(JavaInterfaceIntrospectorImpl.java:123)
    at org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceFactoryImpl.createJavaInterface(JavaInterfaceFactoryImpl.java:58)
    at org.apache.tuscany.sca.implementation.java.introspect.impl.ServiceProcessor.createService(ServiceProcessor.java:175)
    at org.apache.tuscany.sca.implementation.java.introspect.impl.ServiceProcessor.visitClass(ServiceProcessor.java:75)
    at org.apache.tuscany.sca.implementation.java.impl.JavaClassIntrospectorImpl.introspectClass(JavaClassIntrospectorImpl.java:72)
    at org.apache.tuscany.sca.implementation.java.impl.JavaImplementationFactoryImpl.createJavaImplementation(JavaImplementationFactoryImpl.java:55)
    at org.apache.tuscany.sca.implementation.java.xml.JavaImplementationProcessor.resolve(JavaImplementationProcessor.java:228)
    at org.apache.tuscany.sca.implementation.java.xml.JavaImplementationProcessor.resolve(JavaImplementationProcessor.java:74)
    at org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint$LazyStAXArtifactProcessor.resolve(DefaultStAXArtifactProcessorExtensionPoint.java:388)
    at org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.resolve(ExtensibleStAXArtifactProcessor.java:183)
    at org.apache.tuscany.sca.assembly.xml.BaseAssemblyProcessor.resolveImplementation(BaseAssemblyProcessor.java:340)
    at org.apache.tuscany.sca.assembly.xml.CompositeProcessor.resolve(CompositeProcessor.java:1028)
    at org.apache.tuscany.sca.assembly.xml.CompositeProcessor.resolve(CompositeProcessor.java:90)
    at org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint$LazyStAXArtifactProcessor.resolve(DefaultStAXArtifactProcessorExtensionPoint.java:388)
    at org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.resolve(ExtensibleStAXArtifactProcessor.java:183)
    at org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.resolve(CompositeDocumentProcessor.java:231)
    at org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.resolve(CompositeDocumentProcessor.java:59)
    at org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor.resolve(ExtensibleURLArtifactProcessor.java:106)
    at org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.processResolvePhase(ContributionServiceImpl.java:625)
    at org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.addContribution(ContributionServiceImpl.java:430)
    at org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.contribute(ContributionServiceImpl.java:198)
    at org.apache.tuscany.sca.node.impl.NodeImpl.configureNode(NodeImpl.java:524)
    at org.apache.tuscany.sca.node.impl.NodeImpl.<init>(NodeImpl.java:200)
    ... 6 more

看来我不应该一一添加缺少的库。因此,我需要帮助来找到适合本教程的 TUSCANY 库集合。谢谢你。

4

1 回答 1

0

我解决了这个问题。在他们说的部分:

"Since some of you maybe interested in debugging also the Tuscany runtime code we will attachthe Tuscany source to the Tuscany runtime jar in the following step. In the User Libraies dialog scroll down until you see the Tuscany runtime jar and select its Source attachment." 

我相信我没有得到这一步,并删除了其中一个jar文件,而不是添加。

apache-tuscany-sca-1.6.2 适用于本教程。没有问题。

于 2013-07-13T00:53:38.823 回答