日期:2014-05-19  浏览次数:20662 次

osgi service为什么初始化是空值。
<bean class="com.huateng.ota.app.ykt.front.service.NCBusPlatService" id="NCBusPlatService">
<property name="communicationService" ref="CommunicationService"></property>
</bean>
<osgi:service id="IAppService" interface="com.huateng.ota.app.api.IAppService" ref="NCBusPlatService"></osgi:service>
</beans>

java中
try {
confirmResult = appService.appService(AppConstant.APP_TRANS_TYPE_CHARGE_RESULT, confirminfo);
} catch (AppServiceException e) {
try {
throw new TransactionException(TransactionConstant.ERR_CODE_APP_CONFIRM_ERR, "充值确认失败");
} catch (TransactionException e1) {
e1.printStackTrace();
}
}

----------------------------------------
我想问一下调appService的时候是null值,是为什么呢。我同事执行的时候是可以得到NCBusPlatService值的。我实在想不出为什么。而且我把他们eclipse workspace原原本本的搬到我机器上,执行后还是null值。我实在想不通了,deburg configuation 里的配置都一样啊。 jdk1.6。。。只能对osgi很精通的人才能回答吧。我先谢谢你们了。
osgi service interface eclipse null

------解决方案--------------------
如果是这么奇怪的问题,可以检查下路径或者配置。