1. ActiveMQ
  2. AMQ-2010

META-INF/services files ended up in wrong bundle (jar), missing imports


    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Not A Problem
    • Affects Version/s: 5.1.0
    • Fix Version/s: 5.x
    • Component/s: None
    • Labels:
    • Environment:

      Springsource DM 1.0.0.RC2, java jdk (sun) 1.6_07, Linux 32bit

    • Patch Info:
      Patch Available



      I'm unable to use namespaces in spring xml files. It just cannot resolve namespace

      [2008-11-21 15:06:59.627] server-dm-7 rk.beans.factory.xml.DefaultBeanDefinitionDocumentReader.unknown D Loading bean definitions
      [2008-11-21 15:06:59.628] server-dm-7 D Trying to resolving namespace handler for
      [2008-11-21 15:06:59.630] server-dm-7 .app.spring.GenericModuleOsgiBundleXmlApplicationContext.unknown E Pre refresh error
      org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace
      Offending resource: URL [bundleentry://89/META-INF/spring/bundle-context-amq.xml]

      at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(
      at org.springframework.beans.factory.parsing.ReaderContext.error(
      at org.springframework.beans.factory.parsing.ReaderContext.error(
      at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(

      To make long story short, it seems that in the process of building jar, someone forgot to move META-INF/services files in separate bundles.

      In OSGI enviroment, classpath loader of one bundle can only see files in jars (bundles) which he has import directive, including local root. In current build of activemq, META-INF/services files are all stored in META-INF/services dir under activemq-core bundle.On the other hand, namespace parser is in xbean.spring bundle (referenced by META-INF/spring.handlers). Because parser is in separate bundle, it can not "see" META-INF/services directory, and it dies. Also, import for org.apache.xbean.spring.context.v2 is missing from activemq-core. Additionally, for bundle loader to scan for spring.schema file, bundle must import org.springframework.beans.factory.xml, which is also missing from manifest file. I'm not 100% shure in this, maybe all files from META-INF/services should be moved from activemq-core to xbaen.spring ...

      Anyhow, fix to make it work is to:

      • move META-INF/services in propriate bundles
      • add following import to activemq-core:

      That's it for now.



        Hrvoje Habjanic created issue -
        Rob Davies made changes -
        Field Original Value New Value
        Fix Version/s 5.4.1 [ 12332 ]
        Bruce Snyder made changes -
        Fix Version/s 5.5.0 [ 12344 ]
        Fix Version/s 5.4.1 [ 12332 ]
        Jeff Turner made changes -
        Project Import Fri Nov 26 22:32:02 EST 2010 [ 1290828722158 ]
        Dejan Bosanac made changes -
        Fix Version/s 5.5.0 [ 12315626 ]
        Fix Version/s 5.4.2 [ 12315625 ]
        Gary Tully made changes -
        Fix Version/s 5.6.0 [ 12316331 ]
        Fix Version/s 5.5.0 [ 12315626 ]
        Timothy Bish made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Not A Problem [ 8 ]


          • Assignee:
            Hrvoje Habjanic
          • Votes:
            1 Vote for this issue
            0 Start watching this issue


            • Created: