Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Hot deployment and service version changes

  1. #1

    Default Hot deployment and service version changes

    Hi everybody,

    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

    Caused by: org.springframework.osgi.service.ServiceUnavailabl eException: service matching filter=[(objectClass=de.tmobile.tvpp.cxf.business.EchoServ iceProcess)] unavailable
    at org.springframework.osgi.service.importer.support. internal.aop.ServiceDynamicInterceptor.getTarget(S erviceDynamicInterceptor.java:419)
    at org.springframework.osgi.service.importer.support. internal.aop.ServiceDynamicInterceptor.afterProper tiesSet(ServiceDynamicInterceptor.java:472)
    at org.springframework.osgi.service.importer.support. OsgiServiceProxyFactoryBean.createProxy(OsgiServic eProxyFactoryBean.java:215)
    at org.springframework.osgi.service.importer.support. AbstractServiceImporterProxyFactoryBean.getObject( AbstractServiceImporterProxyFactoryBean.java:86)
    at org.springframework.osgi.service.importer.support. OsgiServiceProxyFactoryBean.getObject(OsgiServiceP roxyFactoryBean.java:161)
    at org.springframework.beans.factory.support.FactoryB eanRegistrySupport.doGetObjectFromFactoryBean(Fact oryBeanRegistrySupport.java:143)
    ... 95 common frames omitted


    Only the version number in the manifest is changed and when I call the services command, I see the new service in the list...

    Am I doing something wrong?

  2. #2
    Join Date
    Oct 2008
    Location
    Winchester, UK
    Posts
    535

    Default

    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.
    Glyn Normington
    SpringSource

  3. #3

    Default

    Ok,

    but unfortunately scoped is set to false in plan, atomic is also false...

    But you mean generally what I am trying to do should function....

  4. #4

    Default

    Funny,

    after you hint, I take this version of the service in the plan also..

    So plan deploys now 2 version of the service (I had gave explicit the version numbers in plan)....

    Now when I call the web module, web module as expected get a reference to the newest version of the service (in old constellation it was getting a reference to older version)...

    Now I stopped the new version of the service and I am expecting that web module with a new call would get a reference to old version, but that is not happening I am getting a read timeout....

    Something funny is going on here....

  5. #5
    Join Date
    Oct 2008
    Location
    Winchester, UK
    Posts
    535

    Default

    I agree that this sounds peculiar.

    Please could you tell me which version of dm Server you are running.

    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.
    Glyn Normington
    SpringSource

  6. #6

    Default

    Ok,

    before I go deep to your comments, some more information bits...

    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....

    Funny...

  7. #7
    Join Date
    Oct 2008
    Location
    Winchester, UK
    Posts
    535

    Default

    Ok. It sounds tricky to produce a simple testcase, so don't waste your time.

    Please can you provide some more information about the two published services so I can see if there's anything unusual about them?

    You can do this by using the dm Server shell. Issue "service list" to see all the services and "service examine <service id>" to see the details of a particular service.

    If you could also provide the Spring DM service declarations and the service reference from the web bundle, that would be very helpful.
    Glyn Normington
    SpringSource

  8. #8

    Default

    Hmm,

    in dm server 2.0.0.M6 there is only service and services command in dm shell (I think you mean I have to connect with ssh to dm server and execute commands)

    So for old service, I see the followings when I call service <serviceid>

    :>service 82
    org.springframework.osgi.bean.name:
    websebservice.testServices
    service.id:
    82
    objectClass:
    org.test.cxf.business.EchoServiceProcess
    Bundle-SymbolicName:
    cxf.business
    Bundle-Version:
    2.0
    Publisher:
    65 cxf.business 2.0.0
    Consumers:
    None

    :>service 84
    org.springframework.osgi.bean.name:
    websebservice.testServices
    service.id:
    84
    objectClass:
    org.test.cxf.business.EchoServiceProcess
    Bundle-SymbolicName:
    cxf.business
    Bundle-Version:
    2.1
    Publisher:
    66 cxf.business 2.1.0
    Consumers:
    67 cxf.dmserver

    And service configuration....

    <osgi:service id="testservices" interface="org.test.cxf.business.EchoServiceProces s" ref="webservice.testServices" />


    And service reference....
    <osgi:reference id="echoServiceProcess" interface="org.test.cxf.business.EchoServiceProces s" />

    As you may see there is nothing extaordinary....

    Only point that I am asking to myself...

    CXF reference this osgi service with such a notation...

    <javaws:endpoint xml:ns1="http://org.test/testservices_v01_00" address="/testservices" endpointName="ns1:TestServicesPort" id="testServicesWebService" implementor="#webservice.testServices" serviceName="ns1:TestServices" wsdlLocation="classpath:META-INF/cxf-dm-server/wsdl/testservices.wsdl" />

    <bean id="webservice.testServices" class="org.test.cxf.TestServicesWebServicesImpl">
    <property name="echoServiceProcess" ref=echoServiceProcess" />
    </bean>

    What disturbs me is this funny constellation here
    implementor="#webservice.testServices"

    I think it is something cxf specific and may be it creates somehow a sticky reference????
    Last edited by posthumecaver; Jan 7th, 2010 at 06:43 AM.

  9. #9
    Join Date
    Oct 2008
    Location
    Winchester, UK
    Posts
    535

    Default

    I agree this looks pretty normal apart from the CXF stuff which I can't really comment on. Does the regular <osgi:reference ...> work ok?
    Glyn Normington
    SpringSource

  10. #10

    Default

    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...)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •