This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Hot deployment and service version changes

I have a question about different versions of a service with a dm server...

For test purposes, I deployed a bundle as Spring DM Service and web bundle that is referencing to this service (web module and service are deployed with a plan) everything working perfect...

Then I created a new version of the service and placed in pickup directory (it is deployed, I can see it with bundles command). After that I stopped original service and engaged the webservice call (I am expecting that new version of the service would be picked up) but then I get a read timeout....

I don't understand why new service version isn't picked up. I even try to stop and restart the web bundle but that didn't helped also...

I see following error in logs during the restart of the web bundle but that doesn't make any sense also

Is the plan scoped? That would be the most obvious cause of the behaviour you are seeing.

In that case, the web bundle "prefers" the service inside the plan's scope to any in the global scope, so it waits until the service inside the scoped plan is restarted. A bundle deployed via the pickup directory will publish its services in the global scope.

An unscoped, atomic plan should yield equivalent results to deploying the contents of the plan manually (e.g. by dropping them into pickup in the right order).

So, to boil the problem down further, I would see what happens without a plan.

The most obvious cause of the problems you are seeing would be if you had put service properties on the service definition or service reference and if some of those properties didn't match the way you are expecting them to. But I guess you didn't code *any* service properties. Right?

If you can boil this down to a few binary bundles you would be happy to share, please raise a JIRA and we can take a look.

Comment

I am using the STS (2.2.1:RELEASE) in the spring context context assist I see a sticky attribute for osgi:reference element, I thought that might be problem child and tried...

It looks like STS knows this attribute (I think it comes from spring-osgi-2.x.xsd) but Spring DM Server 2.0.0.M6 not, so I guess that is not the cause also...

I think I answered one your questions

The problem about JIRA and sample, as you may see one of my previous post, I first got CXF working under dm server then I started this test project (which cxf web service works perfectly under dm server) only changing service version on the runtime goes crazy...

So to anybody to reproduce this thing, they should first also deploy CXF into dm server...

To reproduce the problem without plan would be very time consuming while I have to deploy lots CXF dependencies manually and in the correct order but I would try...

I have a feeling this has something to do with web module because Spring Osgi actually behaves corrrectly, when I only deploy the old service in plan it works correctly, if I deploy old and new service in the same plan it correctly reference the newer version (default behaviour in spring osgi) but why it can switch the service version on the run, when a service is stopped actually spring osgi should be able to search another reference....

Comment

I want to debug the subject to find out which part causing the problem....

I just debug until BundleContextImpl class, unfortunately I no source code to look inside to see what happens....I think it is a equinox class, but where in dm server equinox framework configured (I like to see which equinox bundle is used to be able find the its source code)...

Another question, is it possible to run the dm server with Apache Felix, if yes, where can I configure that, I can't find anything about in the internet....

And one final question, how should I configure a plan so it depends another plan (I want to control the deployment order, I should be deployed before other is deployed...)

Comment

I want to debug the subject to find out which part causing the problem....

I just debug until BundleContextImpl class, unfortunately I no source code to look inside to see what happens....I think it is a equinox class, but where in dm server equinox framework configured (I like to see which equinox bundle is used to be able find the its source code)...

See the build.versions file in the root of the dm Server git repository. It currently contains the line:

org.eclipse.osgi=3.5.1.R35x_v20091005

which answers your question.

Alternatively, you can observe the version on the end of the Equinox jar (org.eclipse.osgi-<version>.jar) in the dm Server binary package in the lib directory.

Another question, is it possible to run the dm server with Apache Felix, if yes, where can I configure that, I can't find anything about in the internet....

I'm afraid not. Some parts of dm Server depend on Equinox.

And one final question, how should I configure a plan so it depends another plan (I want to control the deployment order, I should be deployed before other is deployed...)

Put the "child" plan you want to refer to in a repository where dm Server can find it and then refer to the plan like any other artifact, e.g.: