我正在尝试让一个bundle部署其他bundle并使用org.eclipse.virgo.kernel.deployer.core.ApplicationDeployer启动它们,就像管理app(org.eclipse.virgo.apps.admin)正在做的那样。我从管理控制台代码中获得灵感,并且: deploymentIdentity = applicationDeployer(bundleFile.getURI(),new DeploymentOptions(false,false,true));
和:
applicationDeployer.undeploy(deploymentIdentity);
它可以工作,但偶尔会崩溃,但例外情况是:
service proxy has been destroyed
org.springframework.osgi.service.importer.ServiceProxyDestroyedException: service proxy has been destroyed
at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor$ServiceLookUpCallback.doWithRetry(ServiceDynamicInterceptor.java:105) ~[na:na]
at org.springframework.osgi.service.importer.support.internal.support.RetryTemplate.execute(RetryTemplate.java:83) ~[na:na]
at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor.lookupService(ServiceDynamicInterceptor.java:430) ~[na:na]
at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor.getTarget(ServiceDynamicInterceptor.java:415) ~[na:na]
at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62) ~[na:na]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[na:na]
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) ~[na:na]
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) ~[na:na]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[na:na]
at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59) ~[na:na]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[na:na]
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) ~[na:na]
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) ~[na:na]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[na:na]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) ~[na:na]
我首先使用服务引用连接了applicationDeployer,然后使用osgi:listener。在这两个实现中,applicationDeployer引用永远不会回来,但仍然可以在virgo的管理webapp中正常工作。 我做错了什么?
答案 0 :(得分:2)
感谢Gym Normington在Eclipse论坛上回答我:http://www.eclipse.org/forums/index.php/t/225554/