activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Mixing Spring and XBean XML configuration
Date Tue, 04 Jul 2006 11:24:58 GMT
As I said in my previous mail, make sure the <bean> element is in the
empty namespace - not in the activemq namespace. So try something like
this which makes sure only the <broker> and child elements are in the
activemq namespace

<?xml version="1.0" encoding="UTF-8"?>
<beans>
       <broker  xmlns="http://activemq.org/config/1.0">
               <transportConnectors>
                       <transportConnector name="default"
uri="tcp://localhost:61616"/>
               </transportConnectors>
               <jmsBridgeConnectors>
                       <ref bean="jmsConnector"/>
               </jmsBridgeConnectors>
       </broker>
       <bean id="jmsConnector"
class="org.apache.activemq.network.jms.JmsQueueConnector"/>
</beans>

On 7/4/06, ENP <prokopiev@stc.donpac.ru> wrote:
>
> I tried this mixed configuration:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
> "http://www.springframework.org/dtd/spring-beans.dtd">
> <beans xmlns="http://activemq.org/config/1.0">
>         <broker>
>                 <transportConnectors>
>                         <transportConnector name="default" uri="tcp://localhost:61616"/>
>                 </transportConnectors>
>                 <jmsBridgeConnectors>
>                         <ref bean="jmsConnector"/>
>                 </jmsBridgeConnectors>
>         </broker>
>         <bean id="jmsConnector"
> class="org.apache.activemq.network.jms.JmsQueueConnector"/>
> </beans>
>
> I got:
>
> $ sh activemq
> ACTIVEMQ_HOME: /home/john/devel/java/jms/incubator-activemq-4.0-bridged
> Loading message broker from: xbean:activemq.xml
> INFO  XBeanXmlBeanDefinitionReader   - Loading XML bean definitions from
> class path resource [activemq.xml]
> DEBUG XBeanXmlBeanDefinitionReader   - Using JAXP implementation
> [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl@587c94]
> DEBUG ResourceEntityResolver         - Trying to resolve XML entity with
> public ID [-//SPRING//DTD BEAN//EN] and system ID
> [http://www.springframework.org/dtd/spring-beans.dtd]
> DEBUG ResourceEntityResolver         - Trying to locate [spring-beans.dtd]
> in Spring jar
> DEBUG ResourceEntityResolver         - Found beans DTD
> [http://www.springframework.org/dtd/spring-beans.dtd] in classpath
> DEBUG XBeanXmlBeanDefinitionParser   - Loading bean definitions
> DEBUG XBeanXmlBeanDefinitionParser   - Default lazy init 'false'
> DEBUG XBeanXmlBeanDefinitionParser   - Default autowire 'no'
> DEBUG XBeanXmlBeanDefinitionParser   - Default dependency check 'none'
> DEBUG XBeanXmlBeanDefinitionParser   - Could not find resource:
> META-INF/services/org/apache/xbean/spring/http/activemq.org/config/1.0/broker
> DEBUG XBeanXmlBeanDefinitionParser   - Neither XML 'id' nor 'name' specified
> - using generated bean name [org.apache.activemq.xbean.XBeanBrokerService]
> DEBUG XBeanXmlBeanDefinitionParser   - Could not find resource:
> META-INF/services/org/apache/xbean/spring/http/activemq.org/config/1.0/transportConnector
> DEBUG XBeanXmlBeanDefinitionParser   - No XML 'id' specified - using
> 'default' as bean name and [] as aliases
> DEBUG XBeanXmlBeanDefinitionParser   - Could not find resource:
> META-INF/services/org/apache/xbean/spring/http/activemq.org/config/1.0/list
> ERROR: java.lang.RuntimeException: Failed to execute start task. Reason:
> org.springframework.beans.factory.BeanDefinitionStoreException: Error
> registering bean with name '' defined in class path resource [activemq.xml]:
> Bean class [list] not found; nested exception is
> java.lang.ClassNotFoundException: list
> ERROR: java.lang.Exception:
> org.springframework.beans.factory.BeanDefinitionStoreException: Error
> registering bean with name '' defined in class path resource [activemq.xml]:
> Bean class [list] not found; nested exception is
> java.lang.ClassNotFoundException: list
> [john@prokopiev bin]$ sh activemq
> ACTIVEMQ_HOME: /home/john/devel/java/jms/incubator-activemq-4.0-bridged
> Loading message broker from: xbean:activemq.xml
> INFO  XBeanXmlBeanDefinitionReader   - Loading XML bean definitions from
> class path resource [activemq.xml]
> DEBUG XBeanXmlBeanDefinitionReader   - Using JAXP implementation
> [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl@587c94]
> DEBUG ResourceEntityResolver         - Trying to resolve XML entity with
> public ID [-//SPRING//DTD BEAN//EN] and system ID
> [http://www.springframework.org/dtd/spring-beans.dtd]
> DEBUG ResourceEntityResolver         - Trying to locate [spring-beans.dtd]
> in Spring jar
> DEBUG ResourceEntityResolver         - Found beans DTD
> [http://www.springframework.org/dtd/spring-beans.dtd] in classpath
> DEBUG XBeanXmlBeanDefinitionParser   - Loading bean definitions
> DEBUG XBeanXmlBeanDefinitionParser   - Default lazy init 'false'
> DEBUG XBeanXmlBeanDefinitionParser   - Default autowire 'no'
> DEBUG XBeanXmlBeanDefinitionParser   - Default dependency check 'none'
> DEBUG XBeanXmlBeanDefinitionParser   - Could not find resource:
> META-INF/services/org/apache/xbean/spring/http/activemq.org/config/1.0/broker
> DEBUG XBeanXmlBeanDefinitionParser   - Neither XML 'id' nor 'name' specified
> - using generated bean name [org.apache.activemq.xbean.XBeanBrokerService]
> DEBUG XBeanXmlBeanDefinitionParser   - Could not find resource:
> META-INF/services/org/apache/xbean/spring/http/activemq.org/config/1.0/transportConnector
> DEBUG XBeanXmlBeanDefinitionParser   - No XML 'id' specified - using
> 'default' as bean name and [] as aliases
> DEBUG XBeanXmlBeanDefinitionParser   - Could not find resource:
> META-INF/services/org/apache/xbean/spring/http/activemq.org/config/1.0/ref
> ERROR: java.lang.RuntimeException: Failed to execute start task. Reason:
> org.springframework.beans.factory.BeanDefinitionStoreException: Error
> registering bean with name '' defined in class path resource [activemq.xml]:
> Bean class [ref] not found; nested exception is
> java.lang.ClassNotFoundException: ref
> ERROR: java.lang.Exception:
> org.springframework.beans.factory.BeanDefinitionStoreException: Error
> registering bean with name '' defined in class path resource [activemq.xml]:
> Bean class [ref] not found; nested exception is
> java.lang.ClassNotFoundException: ref
>
> --
> View this message in context: http://www.nabble.com/Embedded-broker-with-Spring-%3A-java.lang.ClassCastException-tf1883713.html#a5165696
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Mime
View raw message