Announcement Announcement Module
No announcement yet.
intermittent activmeq schema failure Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • intermittent activmeq schema failure

    I'm trying to deploy an embedded activemq broker in a war bundle. However, I seem to get an intermittent error that requires me to deploy my war with the activemq schema references in place successfully before actually putting in the broker config. I have a bundle dependency on 5.3.0 in my war, with a corresponding embedded broker configuration. However, when I try to start the war bundle I get an initialization error:

    XML validation warning org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document '', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
    The only way I've found to make this work is to add the activemq schema references into the beans tag and deploy the war (which it does successfully) and then add the broker config and redeploy. That works reliably, but every time I restart my server I have to remove the broker configuration, deploy the war, add the broker configuration back in and deploy it again. I've tried dropping the activemq bundle into the pickup folder (instead of repository/usr) but that makes no difference. What am I doing wrong?

    I'm using STS 2.3.0, by the way, and doing "hot" deployment.

    Here's the spring context file:

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns=""
    	<osgi:reference id="osgiDictionaryService"
    	        interface="" filter="(backend=${backend})"/>
    	<context:property-placeholder properties-ref="configAdminProperties"/>
    	<osgix:cm-properties id="configAdminProperties" persistent-id="dictionary">
    		<prop key="backend">memory</prop>
    		<prop key="importqueue">queue.import</prop>
       <broker useJmx="true" persistent="false" xmlns="">
             <kahaDB directory="serviceability/activemq"/>
             <transportConnector uri="tcp://localhost:61616" />

  • #2
    With OSGi and activemq config, I found that using ActiveMQ schema causes more issues than benefit.
    I believe it is using XBean, and xbean is trying to be a classloader when it grows up and does dynamic discovery of property files in META-INF folders of bundles it has no visibility into.

    I would switch to using plain spring bean configuration.

    Just my 2c.


    • #3
      Hmmm.... I never actually even thought about doing straight Spring. Apache should put up an example using regular spring to make it a bit quicker for people to get up to speed. But you're right, it worked much better that way. Thanks for the tip.


      • #4
        How about this:

        <bean id="broker" class="org.apache.activemq.xbean.XBeanBrokerService">
                <property name="transportConnectorURIs">
                <property name="useJmx" value="true"/>
                <property name="persistent" value="true"/>
            <!-- use pooled connection factory -->
            <bean id="jmsFactory" class="org.apache.activemq.pool.PooledConnectionFactory" destroy-method="stop">
                <property name="connectionFactory">
                    <bean class="org.apache.activemq.ActiveMQConnectionFactory">
                        <property name="brokerURL" value="tcp://localhost:61616"/>