Announcement Announcement Module
Collapse
No announcement yet.
Problems using two versions of the same service Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems using two versions of the same service

    I am having a problem getting a prototype of deploying and using two versions of the same service working. I have a service, SimpleOSGiService and a corresponding Web application which I have created two versions of each. When I deploy only one version of the service bundle and its corresponding Web application everything works as expected. When I attempt to deploy both versions at the same time I am getting conflicts that are exposed based on the order I deploy the services.

    I am using the admin console to deploy:

    Method 1:
    deploy simpleosgiservice-0.1.0.jar
    deploy simpleosgiservice-0.2.0.jar
    deploy simpleosgiapp-0.1.war
    deploy simpleosgiapp-0.2.war

    I get an error when deploying simpleosgiapp-0.2.war:
    [2008-09-09 17:15:07.312] latform-tomcat-thread-51 <SPDE0018E> Unable to install application from location 'file:/C:/springsource-ap-1.0.0.RC1/work/com.springsource.platform.primordial/upload/simpleosgiapp-0.2.war'. Could not satisfy constraints for bundle 'com.express-scripts.ccs.simpleosgiapp' at version '0.2.0'.
    Cannot resolve: com.express-scripts.ccs.simpleosgiapp
    Resolver report:
    Bundle: com.express-scripts.ccs.simpleosgiapp_0.2.0 - Missing Constraint: Import-Package: com.express_scripts.cus.simpleosgiservice; version="0.2.0"

    V0.1 of the app executes correctly.


    Method 2:
    deploy simpleosgiservice-0.2.0.jar
    deploy simpleosgiservice-0.1.0.jar
    deploy simpleosgiapp-0.2.war
    deploy simpleosgiapp-0.1.war

    No errors during deploy but when I execute web app V0.1 I get a NoSuchMethod exception on the class that differs between the two versions. V0.2 of the app executes correctly.

  • #2
    Problems using two versions of the same service

    simpleosgiservice-0.1.0.jar has the following manifest:

    Manifest-Version: 1.0
    Built-By: SConstantin
    Created-By: Apache Maven Bundle Plugin
    Import-Package: com.express_scripts.cus.simpleosgiservice
    Bnd-LastModified: 1220983556946
    Export-Package: com.express_scripts.cus.simpleosgiservice;version= "0.1.0"
    Bundle-Version: 0.1.0
    Bundle-Name: Spring OSGi Bundle
    Build-Jdk: 1.4.2_12
    Private-Package: com.express_scripts.cus.simpleosgiservice.internal
    Bundle-ManifestVersion: 2
    Bundle-SymbolicName: com.express-scripts.ccs.business-services.simpleosgiservice
    Tool: Bnd-0.0.238

    simpleosgiservice-0.2.0.jar has the following manifest:

    Manifest-Version: 1.0
    Built-By: SConstantin
    Created-By: Apache Maven Bundle Plugin
    Import-Package: com.express_scripts.cus.simpleosgiservice
    Bnd-LastModified: 1220986741875
    Export-Package: com.express_scripts.cus.simpleosgiservice;version= "0.2.0"
    Bundle-Version: 0.2.0
    Bundle-Name: Spring OSGi Bundle
    Build-Jdk: 1.4.2_12
    Private-Package: com.express_scripts.cus.simpleosgiservice.internal
    Bundle-ManifestVersion: 2
    Bundle-SymbolicName: com.express-scripts.ccs.business-services.simpleosgiservice
    Tool: Bnd-0.0.238

    simpleosgiapp-0.1.war has the following manifest:

    Manifest-Version: 1.0
    Bundle-Name: Spring OSGi Samples: SimpleOsgiApp - War Bundle
    Bundle-Classpath: WEB-INF/classes
    Built-By: SConstantin
    Build-Jdk: 1.4.2_12
    Web-ContextPath: simple-web-app-1
    Created-By: Apache Maven Bundle Plugin
    Bundle-ManifestVersion: 2
    Bundle-SymbolicName: com.express-scripts.ccs.simpleosgiapp
    Import-Package: javax.servlet;version="2.4.0",
    javax.servlet.http;version="2.4.0",
    javax.servlet.resources;version="2.0.0",
    javax.servlet.jsp;version="2.0.0",
    javax.servlet.jsp.jstl.core;version="1.1.2",
    javax.servlet.jsp.jstl.fmt;version="1.1.2",
    javax.servlet.jsp.jstl.tlv;version="1.1.2",
    org.apache.taglibs.standard.resources;version="1.1 .2",
    org.apache.taglibs.standard.tag.common.core;versio n="1.1.2",
    org.apache.taglibs.standard.tag.rt.core;version="1 .1.2",
    org.apache.taglibs.standard.tei;version="1.1.2",
    org.apache.taglibs.standard.tlv;version="1.1.2",
    com.express_scripts.cus.simpleosgiservice;version= "0.1.0",
    org.springframework.osgi.web.context.support;versi on="1.1.0",
    org.springframework.stereotype;version="2.5.5",
    org.springframework.web.bind.annotation;version="2 .5.5",
    org.springframework.web.context;version="2.5.5",
    org.springframework.web.servlet;version="2.5.5",
    org.springframework.web.servlet.view;version="2.5. 5",
    org.springframework.web.servlet.mvc;version="2.5.5 ",
    org.apache.log4j;version="1.2.14"
    Bundle-Version: 0.1
    Application-TraceLevels: *=info,com.express_scripts.*=verbose

    simpleosgiapp-0.2.war has the following manifest:

    Manifest-Version: 1.0
    Bundle-Name: Spring OSGi Samples: SimpleOsgiApp - War Bundle
    Bundle-Classpath: WEB-INF/classes
    Built-By: SConstantin
    Build-Jdk: 1.4.2_12
    Web-ContextPath: simple-web-app-2
    Created-By: Apache Maven Bundle Plugin
    Bundle-ManifestVersion: 2
    Bundle-SymbolicName: com.express-scripts.ccs.simpleosgiapp
    Import-Package: javax.servlet;version="2.4.0",
    javax.servlet.http;version="2.4.0",
    javax.servlet.resources;version="2.0.0",
    javax.servlet.jsp;version="2.0.0",
    javax.servlet.jsp.jstl.core;version="1.1.2",
    javax.servlet.jsp.jstl.fmt;version="1.1.2",
    javax.servlet.jsp.jstl.tlv;version="1.1.2",
    org.apache.taglibs.standard.resources;version="1.1 .2",
    org.apache.taglibs.standard.tag.common.core;versio n="1.1.2",
    org.apache.taglibs.standard.tag.rt.core;version="1 .1.2",
    org.apache.taglibs.standard.tei;version="1.1.2",
    org.apache.taglibs.standard.tlv;version="1.1.2",
    com.express_scripts.cus.simpleosgiservice;version= "0.2.0",
    org.springframework.osgi.web.context.support;versi on="1.1.0",
    org.springframework.stereotype;version="2.5.5",
    org.springframework.web.bind.annotation;version="2 .5.5",
    org.springframework.web.context;version="2.5.5",
    org.springframework.web.servlet;version="2.5.5",
    org.springframework.web.servlet.view;version="2.5. 5",
    org.springframework.web.servlet.mvc;version="2.5.5 ",
    org.apache.log4j;version="1.2.14"
    Bundle-Version: 0.2
    Application-TraceLevels: *=info,com.express_scripts.*=verbose


    Any help would be appreciated.

    Thanks,

    Steve

    Comment


    • #3
      Problems using two versions of the same service

      Steve, if the simpleosgiservice-0.2.0.jar is not backwards compatible (which it probably isn't reading you get NoSuchMethodError), you have to declare the dependency in simpleosgiapp-0.1.war as com.express_scripts.cus.simpleosgiservice;version= "[0.1.0,0.2.0)". Version range "0.1.0" means "[0.1.0,Infinity)" as far as I am concerned.

      Because of this, when you deploy simpleosgiapp-0.1.war, it picks up simpleosgiservice-0.2.0.jar.

      Comment


      • #4
        Problems using two versions of the same service

        I have changed the manifest in the war to import the package as follows:

        simpleosgiapp-0.1.war:
        com.express_scripts.cus.simpleosgiservice;version= "[0.1.0,0.1.0]"

        simpleosgiapp-0.2.war:
        com.express_scripts.cus.simpleosgiservice;version= "[0.2.0,0.2.0]"

        Again, when I deploy only one version of the service bundle and its corresponding Web application everything works as expected. When attempting to deploy both versions of the service and web application I run into problems.

        Method 1:
        deploy simpleosgiservice-0.1.0.jar
        deploy simpleosgiservice-0.2.0.jar
        deploy simpleosgiapp-0.1.war

        [2008-09-11 13:27:11.135] server-tomcat-thread-29 <SPDE0018E> Unable to install application from location 'file:/C:/springsource-dm-server-1.0.0.RC2/work/com.springsource.server.primordial/upload/simpleosgiapp-0.1.war'. Could not satisfy constraints for bundle 'com.express-scripts.ccs.simpleosgiapp' at version '0.1'.
        Cannot resolve: com.express-scripts.ccs.simpleosgiapp
        .

        deploy simpleosgiapp-0.2.war

        [2008-09-11 13:28:42.834] server-tomcat-thread-35 <SPDE0018E> Unable to install application from location 'file:/C:/springsource-dm-server-1.0.0.RC2/work/com.springsource.server.primordial/upload/simpleosgiapp-0.2.war'. Could not satisfy constraints for bundle 'com.express-scripts.ccs.simpleosgiapp' at version '0.2'.
        Cannot resolve: com.express-scripts.ccs.simpleosgiapp
        Resolver report:
        Bundle: com.express-scripts.ccs.simpleosgiapp_0.2 - Missing Constraint: Import-Package: com.express_scripts.cus.simpleosgiservice; version="[0.2.0,0.2.0]"
        .

        Method 2:
        deploy simpleosgiservice-0.2.0.jar
        deploy simpleosgiservice-0.1.0.jar
        deploy simpleosgiapp-0.2.war
        deploy simpleosgiapp-0.1.war

        [2008-09-11 13:44:43.350] server-tomcat-thread-11 <SPDE0018E> Unable to install application from location 'file:/C:/springsource-dm-server-1.0.0.RC2/work/com.springsource.server.primordial/upload/simpleosgiapp-0.1.war'. Could not satisfy
        constraints for bundle 'com.express-scripts.ccs.simpleosgiapp' at version '0.1'.
        Cannot resolve: com.express-scripts.ccs.simpleosgiapp
        .

        V0.2 of the web application executes as expected. Am I missing something obvious? It seems like this should work.

        Comment


        • #5
          Problems using two versions of the same service

          Steven,

          This looks strange. If you don't mind, can you create a JIRA and include your bundles at attachments.

          JIRA can be found at: https://issuetracker.springsource.com/.

          Regards,

          Rob

          Comment


          • #6
            Problems using two versions of the same service

            Done, PLATFORM-170.

            Thanks,

            Steve

            Comment

            Working...
            X