我正在尝试学习服务组件架构(SCA),所以我从这个链接开始使用Apache Tuscany教程:http://tuscany.apache.org/getting-started-with-tuscany.html
在本教程的开头,作者提供了最新版本发行版的链接,并要求从该链接下载托斯卡纳库。这是他提供的链接:http://cwiki.apache.org/TUSCANY/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;
中收到错误。我下载的TUSCANY库不存在该库。
我尝试通过搜索包含org.osoa.sca.annotations.Remotable
的jar文件来解决问题。我找到了一个并将其添加到库中。我一遍又一遍地做类似的事情来获取丢失的jar文件,然后我将它们添加到托斯卡纳库中。但是,当我运行程序时,我会收到错误。这些错误将我引导到我添加到托斯卡纳库中的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库的正确集合。谢谢。
答案 0 :(得分: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可以正常使用本教程。没问题。