2011年8月21日 星期日

Tuscany 2.0 beta3 建立多個 Node 在同一個 SCA Domain 的呼叫方式

The code snippet :

import org.apache.tuscany.sca.node.NodeFactory;
import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
import org.apache.tuscany.sca.node.configuration.impl.NodeConfigurationImpl;

String ContributionPath;
org.apache.tuscany.sca.node.Node nodeInstance = null;
NodeConfiguration nodeCof = new NodeConfigurationImpl();
nodeCof.addContribution( ContributionName , ContributionPath );

NodeFactory.getInstance().setAutoDestroy(false);
nodeInstance = NodeFactory.getInstance().createNode( nodeCof );

nodeInstance.start();

Reference site :

http://mail-archives.apache.org/mod_mbox/tuscany-commits/201104.mbox/%3C20110427102304.31D60238890A@eris.apache.org%3E

How to handle SCA the error Business Interface in not compatible on OSGi

當我打包整個 Tuscany Runtime 成 OSGi bundle 並且安裝到 glassfish 上面時

其他 OSGi bundle 使用 Tuscany Runtime bundle 時偶而會發出

Business interface is XXX not compatible

這是 bundle 在 MANIFEST.MF 中 Import-Package 不完全所至

所以最快的解決辦法 就是把 Tuscany Runtime Bundle 所 Export-Package 全部變成
該 SCA-OSGi bundle 的 Import-Package 就可以解決這個問題

啟動 Glassfish OSGI Telnet 服務

啟動 Glassfish 的 OSGI telent 服務

修改

$GLASSFISH/osgi/felix/conf/config.properties

optionals.bundles = ....
$(com.sun.aas.installRootURI}modules/org.apache.felix.shell.jar \
$(com.sun.aas.installRootURI}modules/org.apache.felix.shell.remote.jar \

telnet localhost 6666

就可以進入 remote console 管理 bundles