Announcement Announcement Module
No announcement yet.
Failure deploying Shared Libraries WAR with Import-Bundle for commons logging 1.1.1 Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Failure deploying Shared Libraries WAR with Import-Bundle for commons logging 1.1.1

    I have been working on a small example web application that started off as a traditional war file. I tested it under tomcat and after it worked I deployed it to the DM Server and all works fine. I then started to move the application over to a Shared Libraries WAR. In the traditional war the commons logging jar was included and all worked fine. I was able to make a Shared Libraries WAR file and it deployed with errors. In the end I was able to remove the following Import-Bundle entry from the manifest file allowing the application to deploy and function.

    The error that the DM server returned when the Import-Bundle entry was present in the manifest file is:

    [2009-05-27 16:18:26.489] onnection(5)- <SPOF0005W> Detected Import-Bundle of bundle '' version '1.1.1' which exports packages that are exported by the system bundle: consider importing the packages explicitly. For example, use Import-Package: org.apache.commons.logging,org.apache.commons.logging.impl.
    [2009-05-27 16:18:29.306] onnection(5)- <SPFF0002I> Wrote dump file "C:\development\springsource-dm-server-1.0.2.RELEASE\serviceability\dump\2009-05-27_16-18-28.dump"
    [2009-05-27 16:18:29.659] onnection(5)- <SPDE0018E> Unable to install application from location 'file:///C:/development/springsource-dm-server-1.0.2.RELEASE/stage/myspring-webapp.war'. Could not satisfy constraints for bundle 'com.mycompany.example.myspring-webapp-shared-libs' at version '1.0.0'.
     Cannot resolve: com.mycompany.example.myspring-webapp-shared-libs
      Resolver report:
        Bundle: com.mycompany.example.myspring-webapp-shared-libs_1.0.0 - Uses Conflict: Import-Package:; version="2.5.6"
          Possible Supplier: org.springframework.beans_2.5.6.A - Export-Package:; version="2.5.6.A"
            Possible Conflicts: org.springframework.core,org.apache.commons.logging,net.sf.cglib.proxy,org.springframework.util,,org.springframework.beans,,org.springframework.beans.factory.config,org.springframework.beans.factory
          Possible Supplier: org.springframework.beans_2.5.6 - Export-Package:; version="2.5.6"
            Possible Conflicts: org.springframework.core,org.apache.commons.logging,net.sf.cglib.proxy,org.springframework.util,,org.springframework.beans,,org.springframework.beans.factory.config,org.springframework.beans.factory
    [2009-05-27 16:18:29.765] onnection(5)- <SPDE0011E> Deployment of 'com.mycompany.example.myspring-webapp-shared-libs' version '1' failed.
    Why is the Shared Services WAR failing to deploy when the commons logging jar is imported as a bundle?

    The following is the content of the Shared Service WAR manifest file that works. I am using an older version of Spring, (version 2.5.6) compared to the included version of Spring, (2.5.6.A). I thought that this would not be a problem because there might be a case to move older applications over and then start a process of upgrading.

    Manifest-Version: 1.0
    Bundle-Name: MySpring Web Application
    Bundle-Classpath: .
    Bundle-ManifestVersion: 2
    Bundle-SymbolicName: com.mycompany.example.myspring-webapp-shared-libs
    Bundle-Vendor: MyComapny Inc.
    Bundle-Version: 1.0
    Import-Bundle: org.springframework.web;version="[2.5.6,2.5.6]",

    Any help to understand this would be really appreciated.

  • #2
    I think the problem here is that there are two bundles in the system that provide the org.apache.commons.logging package: the vanilla commons logging bundle, and the SLF4J verison of commons logging that delegates its calls into dm Servers serviceability system.

    The Spring bundles have wired to the SLF4J version of commons logging, whereas your Import-Bundle statement is causing your shared libraries WAR to wire to vanilla commons logging. As you WAR is also importing Spring the usage of commons logging is detected as being in conflict.

    In this case I would recommend using Import-Package to avoid tieing your commons logging import to a specific bundle. This extra flexibility should, I hope, resolve your problem.