ActiveMQ + OSGi XML xBean configuration problem
-----------------------------------------------
Key: GERONIMO-5522
URL: https://issues.apache.org/jira/browse/GERONIMO-5522
Project: Geronimo
Issue Type: Bug
Security Level: public (Regular issues)
Components: ActiveMQ
Environment: Apache Felix, Spring DM
Reporter: Eduardo Zanni
Priority: Blocker
I'm trying to use an external .xml file to configure a broker. I have the
following code in my spring bundle context:
{noformat}
<bean id="brokerFactory"
class="org.apache.activemq.xbean.BrokerFactoryBean">
<property name="config" value="file:c:/activemq.xml" />
<property name="start" value="false" />
</bean>
{noformat}
This should link with the configuration file with no further problems. Here is
what my activemq.xml file looks like:
{noformat}
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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">
<networkConnectors>
<!--
<networkConnector uri="multicast://default?initialReconnectDelay=100" />
<networkConnector uri="static://(tcp://localhost:61616)" />
-->
</networkConnectors>
<persistenceFactory>
<journalPersistenceAdapterFactory journalLogFiles="5"
dataDirectory="${basedir}/target/foo" />
</persistenceFactory>
<transportConnectors>
<transportConnector uri="tcp://localhost:61636" />
</transportConnectors>
</amq:broker>
</beans>
{noformat}
As you can see it's a pretty standard one. When starting out my bundles I get
the following exception:
{noformat}
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'.
{noformat}
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|http://mvnrepository.com/artifact/org.apache.xbean/xbean-spring]. 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.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.