Uploaded image for project: 'Geronimo'
  1. Geronimo
  2. GERONIMO-5522

ActiveMQ + OSGi XML xBean configuration problem



    • Type: Bug
    • Status: Open
    • Priority: Blocker
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: ActiveMQ
    • Security Level: public (Regular issues)
    • Labels:
    • Environment:

      Apache Felix, Spring DM


      I'm trying to use an external .xml file to configure a broker. I have the following code in my spring bundle context:

          <bean id="brokerFactory" class="org.apache.activemq.xbean.BrokerFactoryBean">  
          	<property name="config" value="file:c:/activemq.xml" />  
          	<property name="start" value="false" />  

      This should link with the configuration file with no further problems. Here is what my activemq.xml file looks like:

        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
        http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
        <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
        <amq:broker useJmx="true" xmlns="http://activemq.apache.org/schema/core">
            <networkConnector uri="multicast://default?initialReconnectDelay=100" />
            <networkConnector uri="static://(tcp://localhost:61616)" />
            <journalPersistenceAdapterFactory journalLogFiles="5" dataDirectory="${basedir}/target/foo" />
            <transportConnector uri="tcp://localhost:61636" />

      As you can see it's a pretty standard one. When starting out my bundles I get the following exception:

      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'brokerManager' defined in URL [bundle://7.0:0/META-INF/spring
      /bundle-context.xml]: Cannot resolve reference to bean 'brokerFactory' while setting bean property 'brokerFactory'; nested exception is org.springfra
      mework.beans.factory.BeanCreationException: Error creating bean with name 'brokerFactory' defined in URL [bundle://7.0:0/META-INF/spring/bundle-conte
      xt.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 10 in XML 
      document from OSGi resource[file:c:/activemq.xml|bnd.id=7|bnd.sym=genericenqueuer-engine] is invalid; nested exception is org.xml.sax.SAXParseExcepti
      on: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'amq:broker'.

      I have tried several configurations for the namaspaces involved. Using the broker tags with and without the "amq:" declaration (<broker> and <amq:broker>) and specifying the specific version number for the activemq .xsd declaration. Still, the .xsd file doesn't seem to be found.

      I am using xbean-spring version 3.7 which can be found here. I have tried extracting the .xsd file from my com.springsource.org.apache.activemq-5.3.0.jar bundle file and exporting it on a package in one of my bundles but the parser still can't seem to find it. Any help with this issue will be greatly appreciated.




            • Assignee:
              eduzanni Eduardo Zanni
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: