Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Application Deployer crashing on undeploy(Problem with org.eclipse.virgo.kernel.deployer.core.ApplicationDeployer)
Application Deployer crashing on undeploy [message #703626] Wed, 27 July 2011 19:05 Go to next message
Julien Chouinard is currently offline Julien ChouinardFriend
Messages: 6
Registered: July 2011
Junior Member
Hi!

I'm trying to have a bundle deploy other bundles and start them using the org.eclipse.virgo.kernel.deployer.core.ApplicationDeployer mostly like the admin app (org.eclipse.virgo.apps.admin) is doing. I've inspired myself from the admin console code and do :
deploymentIdentity = applicationDeployer(bundleFile.getURI(), new DeploymentOptions(false,false,true));

and :

applicationDeployer.undeploy(deploymentIdentity);

It works, but once in a while, it crash with the exception :
 
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]


I've wired the applicationDeployer at first with a service ref, then with a osgi:listener. In both implementations, the applicationDeployer reference never come back, but still works fine in the virgo's admin webapp.

What am I doing wrong?

Re: Application Deployer crashing on undeploy [message #704086 is a reply to message #703626] Thu, 28 July 2011 09:03 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
I guess that the bundle calling the ApplicationDeployer service is somehow getting embroiled in the lifecycle of the artifacts it is installing and uninstalling and this is invalidating the service proxy provided by Spring DM.

You should probably check the package wiring of the bundles to see if there is an unexpected dependency.

To avoid this issue, you could try using a direct reference to the ApplicationDeployer service which you can obtain programmatically via the BundleContext passed to a bundle activator or, most easily in Virgo 3.0, using Declarative Services.

Alternatively, you could use the Deployer mxbean to deploy and undeploy artifacts.

Hope that helps!
Re: Application Deployer crashing on undeploy [message #704270 is a reply to message #704086] Thu, 28 July 2011 12:42 Go to previous messageGo to next message
Julien Chouinard is currently offline Julien ChouinardFriend
Messages: 6
Registered: July 2011
Junior Member
Hi and thanks for the reply, I really had lost hope on that. I'll try theses solutions and post back!
Re: Application Deployer crashing on undeploy [message #704272 is a reply to message #704270] Thu, 28 July 2011 12:46 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Ok. Please would you point the stack overflow question at this thread.
Re: Application Deployer crashing on undeploy [message #705335 is a reply to message #704272] Fri, 29 July 2011 18:43 Go to previous messageGo to next message
Julien Chouinard is currently offline Julien ChouinardFriend
Messages: 6
Registered: July 2011
Junior Member
I worked on untangling my dependencies and finally found that I wasn't cleaning my timedTasks, and it still lived while the bundle rebooted. So now, with the fixed dependencies, it does not reboot it anymore on my developer machine. But when I deploy it on my "production" server, it still reboots while undeploying a fragment. The difference between theses environments is that on my local machine, I deploy in pickup and on my server, I deploy a plan with the bundles in the user repository. In my plan I start every bundles that I need in order. Is it possible that when a bundle of a plan reboot everything else gets rebooted? Is there a better way to deploy my app other then having all my bundles in a plan? I really need to learn more on that.

[Updated on: Fri, 29 July 2011 18:43]

Report message to a moderator

Re: Application Deployer crashing on undeploy [message #705344 is a reply to message #705335] Fri, 29 July 2011 18:55 Go to previous messageGo to next message
Julien Chouinard is currently offline Julien ChouinardFriend
Messages: 6
Registered: July 2011
Junior Member
Found it! Sorry about that, my plan had "atomic=true", that makes everything reboot if one of the bundle reboots (that happens when you remove a fragment from one of them)
Re: Application Deployer crashing on undeploy [message #707945 is a reply to message #705344] Tue, 02 August 2011 08:58 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Well done and thanks for letting us know.
Re: Application Deployer crashing on undeploy [message #711048 is a reply to message #705344] Fri, 05 August 2011 18:10 Go to previous messageGo to next message
Jack Lynch is currently offline Jack LynchFriend
Messages: 9
Registered: August 2011
Junior Member
I'm attempting the same process, however I can't find the bundle for the ApplicationDeployer interface. I've tried the following repositories

<repository>
  <id>eclipse.virgo.maven.repo</id>
  <name>Eclipse Virgo Maven Repository</name>
  <url>http: //zodiac.springsource.com/maven/bundles/release</url> 
</repository>
<repository>
  <id>eclipse.virgo.maven.repo.milestone</id>
  <name>Eclipse Virgo Milestone Repository</name>
  <url>http: //zodiac.springsource.com/maven/bundles/milestone</url>
</repository> 


(with the above urls correct/space removed - I'm not allowed post links here yet) and both milestone and release numbers, e.g.

<dependency>
  <groupId>org.eclipse.virgo.kernel</groupId>
  <artifactId>org.eclipse.virgo.kernel.deployer</artifactId>
  <version>3.0.0.M05</version>
  <scope>compile</scope>
</dependency>


but no luck. I guess I've got the wrong repositories..

Thanks,
Jack
Re: Application Deployer crashing on undeploy [message #713701 is a reply to message #711048] Mon, 08 August 2011 20:26 Go to previous message
Julien Chouinard is currently offline Julien ChouinardFriend
Messages: 6
Registered: July 2011
Junior Member
Hello jack!
I've set it up manually in a nexus repository. You should maybe change your scope to "provided" too, you don't need it once it's deployed, you're using the libs from Virgo.

Hope it helps,
Julien
Previous Topic:context class loader
Next Topic:Where to get the required version of Spring IDE?
Goto Forum:
  


Current Time: Tue Mar 19 08:49:00 GMT 2024

Powered by FUDForum. Page generated in 0.03535 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top