Announcement Announcement Module
No announcement yet.
Import-Package conflict with apache.commons.logging Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Import-Package conflict with apache.commons.logging


    I face a problem with conflicts between org.springframework.spring library import and the bundle import of

    To demonstrate the conflict, I added the Bundle-Import Header to the "Hello" Demo from SpringOne:

    Manifest-Version: 1.0
    Bundle-Name: Hello Service Implementation - German
    Bundle-ManifestVersion: 2
    Bundle-SymbolicName: hello.service.impl-de
    Bundle-Version: 1.0.0
    Import-Package: hello.domain, hello.service,
    Import-Library: org.springframework.spring

    When I try to deploy this, I get the following message. Since there is no commons.logging bundle within the library, I have no idea what might be the reason for that.

    Here is the error-log:

    [2008-07-11 14:52:48.263] ion(567)- <SPDE0018E> Unable to install application from location 'file:/C:/spring_tools/apps/springsource-ap-1.0.0.beta9/stage/hello.service.impl-de.jar/'. Could not satisfy constraints for bundle 'hello.service.impl-de' at version '1.0.0'.
    Cannot resolve: hello.service.impl-de
    Resolver report:
    Bundle: hello.service.impl-de_1.0.0 - Uses Conflict: Import-Package:; version="2.5.5.A"
    Possible Supplier: org.springframework.beans_2.5.5.A - Export-Package:; version="2.5.5.A"
    Possible Conflicts: org.springframework.core,org.apache.commons.loggin g,net.sf.cglib.proxy,org.springframework.util,org.,org.springframework.beans,,org.springfram ework.beans.factory.config,org.springframework.bea ns.factory
    [2008-07-11 14:52:48.287] ion(567)- <SPDE0011E> Deployment of 'hello.service.impl-de.jar' version '0' failed.

    Any suggestions, what I am doing wrong or what might be the problem?

    Kind regards,
    André Schäfer (namics AG)

  • #2
    Import-Package conflict with apache.commons.logging

    What version of S2AP is this ?


    • #3
      Import-Package conflict with apache.commons.logging

      Hi André,

      To use Log4J and Commons Logging in OSGi, you should actually use the SLF4J implementations.
      Note that Commons Logging is already made available via SLF4J via the JAR which you can find in

      Long story, short: do not import the Commons Logging bundle. Rather, just import the
      packages: org.apache.commons.logging,org.apache.commons.logg ing.impl

      Hope this clears up the issue for you.

      - Sam


      • #4
        Import-Package conflict with apache.commons.logging

        Importing the packages worked, thank you very much.


        • #5
          Import-Package conflict with apache.commons.logging

          When we say it "works" are we saying that this technique will allow us to write to our own log files? I did a similar thing, but it is only logging to the "trace.log" file. is there any way to get messages logged to my own files?



          • #6
            Import-Package conflict with apache.commons.logging

            Hi Carlos,

            You are free to use Log4J and Commons Logging APIs in your application code; however, the Platform uses SL4FJ to route the log output to a per-application trace.log file. You can find detailed information on how this works and how to configure it for your application in the User Guide here:


            > is there any way to get messages logged to my own files?

            As described in the User Guide, your log messages will get written to a location such as
            $PLATFORM_HOME/serviceability/trace/com.myapp-1/, assuming your application's Bundle-SymbolicName is com.myapp and version is 1. So in that regard, the answer to your question is "yes"; however, you can not currently configure the Platform to route your per-application log messages to a user-defined location.

            Hope this helps,



            • #7
              Import-Package conflict with apache.commons.logging