xBean으로 파싱 된 외부 XML 파일을 통해 ActiveMQ 브로커를 구성하는 데 문제가 있습니다. 이 시점에서 모든 도움말, 팁, 포인터, 힌트 또는 기분을 상쾌하게합니다. 여기에 내 문제가 :ActiveMQ 용 브로커 빈을 설정할 수 없습니다
외부 .xml 파일을 사용하여 브로커를 구성하려고합니다. 내 봄 번들 컨텍스트에서 다음 코드를 가지고있다 :
<bean id="brokerFactory" class="org.apache.activemq.xbean.BrokerFactoryBean">
<property name="config" value="file:c:/activemq.xml" />
<property name="start" value="false" />
</bean>
이것은 더 이상 문제없이 구성 파일과 연결되어야한다. 다음은 내 activemq.xml 파일의 모습입니다.
<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>
알다시피 꽤 표준적인 것입니다. 내 번들을 시작할 때 다음과 같은 예외가 발생합니다.
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.springframework.beans.factory.BeanCreationException: Error creating bean with name 'brokerFactory' defined in URL [bundle://7.0:0/META-INF/spring/bundle-context.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.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'amq:broker'.
관련된 네임 스페이스에 대해 여러 구성을 시도했습니다. "amq:"
선언이있는 브로커 태그 (<broker>
및 <amq:broker>
)를 사용하고 activemq .xsd 선언의 특정 버전 번호를 지정합니다. 그래도 .xsd 파일이없는 것 같습니다. 내가 ActiveMQ를 .XSD 파일의 버전 번호를 제공하면 나는이 대신받을 :
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'brokerFactory' defined in URL [bundle://7.0:0/META-INF/spring/bundle-context.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unrecognized xbean namespace mapping: http://activemq.apache.org/schema/core
내가 here을 찾을 수 있습니다 xbean 스프링 버전 3.7을 사용하고 있습니다. 내 com.springsource.org.apache.activemq-5.3.0.jar
번들 파일에서 .xsd 파일의 압축을 풀어 내 번들 중 하나에서 패키지로 내보내려고했지만 파서가 여전히 찾을 수없는 것 같습니다. 나는 또한 Geronimo Jira에 버그를 게시했다.
누구든지 문제에 관해 밝힐 수 있습니까?
미리 감사드립니다.
Eduardo.