I am registering a service with the Registry (via Spring DM) and watching it being set on its client bean when the bean is created. However, when I go to use the service a little later, I get the following exception:
Exception in thread "AWT-EventQueue-0" 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)
at org.springframework.osgi.service.importer.support.internal.support.RetryTemplate.execute(RetryTemplate.java:83)
at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor.lookupService(ServiceDynamicInterceptor.java:430)
at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor.getTarget(ServiceDynamicInterceptor.java:415)
at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy137.activateFeatureSet(Unknown Source)
at com.iggroup.wb.workbench.ui.WorkBenchFrame$WelcomeActionListener.actionPerformed(WorkBenchFrame.java:256)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6289)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6054)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4652)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4482)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4482)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:603)
at java.awt.EventQueue$1.run(EventQueue.java:601)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:617)
at java.awt.EventQueue$2.run(EventQueue.java:615)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
In looking through the log, I find that the plan I am using has been started but then mysteriously stopped. Here are the relevant lines of the log:
[2011-09-16 09:45:01.197] INFO start-signalling-1 org.eclipse.virgo.medic.eventlog.default DE0005I Started plan 'com.iggroup.wb.workbench.plan' version '0.0.1'.
[2011-09-16 09:45:01.808] INFO fs-watcher org.eclipse.virgo.medic.eventlog.default HD0001I Hot deployer processing 'MODIFIED' event for file 'com.iggroup.wb.workbench.plan'.
[2011-09-16 09:45:01.808] INFO fs-watcher o.e.virgo.kernel.deployer.hot.HotDeploymentFileSystemListener Redeploying path 'C:\dev\Virgo\virgo-kernel-3.0.0.RELEASE\pickup\com.iggroup.wb.workbench.plan'.
[2011-09-16 09:45:01.826] WARN fs-watcher org.eclipse.virgo.medic.eventlog.default DE0050W Cannot refresh plan 'com.iggroup.wb.workbench.plan' version '0.0.1' as refresh of plan artifacts is not supported.
[2011-09-16 09:45:01.828] INFO fs-watcher org.eclipse.virgo.medic.eventlog.default DE0010I Stopping plan 'com.iggroup.wb.workbench.plan' version '0.0.1'.
Any pointers as to why the plan would be stopped? Does it have to do with the refresh attempt not succeeding? And why is the plan marked as MODIFIED and refreshed anyway? Is it something the framework does as a result of the plan being started?
Dmitry Sklyut Messages: 252 Registered: January 2010
Senior Member
atomic should only drive if bundles within the plan start/stop together. One of the other bundles within your plan could be failing to start causing all plan bundles to stop. Check if all of the bundles within the plan are started and active when atomic = false.
Well, my "fix" does not seem to work all the time.
I guess my problem is that I am creating a plan file dynamically in the pickup directory, so I first create the file and then I write its contents. Could that be the reason why I trigger the wrong process?
And if that is the case, what is the fix? Just create the file and write the contents in a temp directory and then copy it over in the pickup dir?
Dmitry Sklyut Messages: 252 Registered: January 2010
Senior Member
Barbara,
Yes - you do want to create plan outside of pickup and copy that over.
In pickup there is a directory scanner that is picking up your "new" file while you are still writing to it.