liuhongyu 发表于 2017-1-15 06:57:38

使用Eclipse3.2.1+STP.0.4.0+Apache Tuscany开发SCA的Java组件(4)安装运行错误问题修正篇

1、安装STP插件成功后的问题  插件安装完后,在eclipse菜单 window --> preferences 下可以看到SOA Tools 以及JAX-WS和SCA子菜单。
  但是,选中SCA下面的Java项会提示一个错误信息: The current page contain invalid value .如图所示:

  这是STP中一个Bug引起的。
  解决方法:可以从 http://stp.teamlet.org 下载已经修正的 STP V0.4.0 Plugin。在提交这个Bug之后,STP尚未发布一个稳定版本,子项目的部分结构也发生了变化。所以这里提供一个可以运行的修正版,可以实现文章中的例子。
  2、提供STP依赖环境
  这里提供STP的依赖环境。可以将这个环境和上面提供的STP V0.4.0 Plugin分别以link方式引入eclipse。
  这个环境包括:
EMF --- emf-sdo-xsd-SDK-2.2.0
GEF ---GEF-SDK-3.2
Java EMF Model Runtime --- JEM-SDK-1.2
Web Tools Platform --- wtp-sdk-R-1.5.0-200606281455
GMF Platform ---GMF-runtime-1.0.2
等...
  可以避免四处下载依赖包,防止包版本不一致,防止遗漏包。
  3、运行STP例子出现的问题
  A、在运行的时候,控制台提示错误:如下
  org.apache.tuscany.spi.loader.UnrecognizedElementException: {http://incubator.apache.org/tuscany/xmlns/binding/rmi/1.0-incubator-M2}binding.rmi [{http://incubator.apache.org/tuscany/xmlns/binding/rmi/1.0-incubator-M2}binding.rmi]
Context stack trace:
  解决方法:需要把Tuscany_Home目录中contrib目录下的rmi-1.0-incubator-M2.jar复制到extensions目录中。
  Tuscany_Home是指在eclipse菜单中,window-->preferences-->SOA Tools-->SCA-->Java中Apache Tuscany所设置的目录。
  contrib和extensions是Tuscany_Home目录中同级的子目录。注意:不要把多余的jar复制过来,只要rmi-1.0-incubator-M2.jar !
  B、在运行的时候,控制台提示错误:如下
  Exception in thread "main" org.apache.tuscany.spi.component.TargetException: Error initializing component instance
at org.apache.tuscany.core.implementation.PojoAtomicComponent.init(PojoAtomicComponent.java:96)
at org.apache.tuscany.core.component.scope.InstanceWrapperImpl.start(InstanceWrapperImpl.java:49)
  这是由于Tuscany SCA运行需要使用Maven本地库的内容。
  解决方法:可以从 http://stp.teamlet.org 下载STP Sample 依赖环境。
  下载后,解压。放在Document and Setting/当前用户的目录下,建立.m2(注意m前面有一个点),在.m2里面建立repository目录,然后把解压目录中的内容复制到repository中。例如:
  C:/Documents and Settings/teamlet/.m2/repository
  然后在repository目录下是 cglib、org、stax的目录。
页: [1]
查看完整版本: 使用Eclipse3.2.1+STP.0.4.0+Apache Tuscany开发SCA的Java组件(4)安装运行错误问题修正篇