activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pradeep <pradeepzm...@gmail.com>
Subject Re: Spring 2.0 + ActiveMQ 4.1 Snapshot: SAXParseException on XML config files
Date Thu, 07 Dec 2006 06:16:43 GMT

Why are you pointing to dtd in your xml file?

  xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/dtd/spring-beans-2.0.dtd 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Replace it with http://www.springframework.org/schema/beans/spring-beans.xsd

pradeep




elusivemel wrote:
> 
> I've been trying to wire up ActiveMQ 4.1-SNAPSHOT with Spring 2.0-m2 with
> no success.  I'm using maven2 to manage my project's build process and I'm
> using xbean-spring-common 2.7:
> 
> From my pom.xml:
> 
>     <dependency>
>       <groupId>org.apache.xbean</groupId>
>       <artifactId>xbean-spring-common</artifactId>
>       <version>2.7</version>
>     </dependency>
> 
> I started with the example spring XML configuration file
> (http://svn.apache.org/repos/asf/incubator/activemq/trunk/activemq-core/src/test/resources/spring-embedded-xbean.xml)
> , but got an exception:
> 
> ------- begin error message ------- 
> 
> org.springframework.beans.factory.BeanDefinitionStoreException: Line 5 in
> XML document from ServletContext resource
> [/WEB-INF/jms-context.xml] is invalid; nested exception is
> org.xml.sax.SAXParseException: Document root element "beans", must match
> DOCTYPE root "null".
> org.xml.sax.SAXParseException: Document root element "beans", must match
> DOCTYPE root "null".
> 
> ------- end error message ------- 
> 
> 
> Here's a look at my spring configuration file.
> 
> ------ begin jms-context.xml ------ 
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:amq="http://activemq.org/config/1.0"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/dtd/spring-beans-2.0.dtd
> http://activemq.org/config/1.0
> http://people.apache.org/repository/org.apache.activemq/xsds/activemq-core-4.1-incubator-SNAPSHOT.xsd">
> 
> 	<!--  lets create an embedded ActiveMQ Broker -->
> 	<amq:broker useJmx="false" persistent="false">
> 		<amq:transportConnectors>
> 			<amq:transportConnector uri="tcp://localhost:0" />
> 		</amq:transportConnectors>
> 	</amq:broker>
> 
> 	<!--  ActiveMQ destinations to use  -->
> 	<amq:queue id="destination"
> 		physicalName="org.apache.activemq.spring.Test.spring.embedded" />
> 
> 	<!-- JMS ConnectionFactory to use, configuring the embedded broker using
> XML -->
> 	<amq:connectionFactory id="jmsFactory" brokerURL="vm://localhost" />
> 
> 	<!-- Spring JMS Template -->
> 	<bean id="myJmsTemplate"
> 		class="org.springframework.jms.core.JmsTemplate">
> 		<property name="connectionFactory">
> 			<!-- lets wrap in a pool to avoid creating a connection per send -->
> 			<bean
> 				class="org.springframework.jms.connection.SingleConnectionFactory">
> 				<property name="targetConnectionFactory">
> 					<ref local="jmsFactory" />
> 				</property>
> 			</bean>
> 		</property>
> 	</bean>
> 
> 	<bean id="consumerJmsTemplate"
> 		class="org.springframework.jms.core.JmsTemplate">
> 		<property name="connectionFactory" ref="jmsFactory" />
> 	</bean>
> 
> 	<!-- a sample POJO which uses a Spring JmsTemplate -->
> 	<bean id="producer"
> 		class="org.apache.activemq.spring.SpringProducer">
> 		<property name="template">
> 			<ref bean="myJmsTemplate" />
> 		</property>
> 
> 		<property name="destination">
> 			<ref bean="destination" />
> 		</property>
> 
> 		<property name="messageCount">
> 			<value>10</value>
> 		</property>
> 	</bean>
> 
> 	<!-- a sample POJO consumer -->
> 	<bean id="consumer"
> 		class="org.apache.activemq.spring.SpringConsumer">
> 		<property name="template" ref="consumerJmsTemplate" />
> 		<property name="destination" ref="destination" />
> 	</bean>
> </beans>
> ------ end jms-context.xml ------ 
> 
> 
> Am I missing a DTD somewhere?  The message "Document root element "beans",
> must match DOCTYPE root 'null'" has me stumped.  
> 
> It's been two frustrating days and I don't see any end in sight.  Any help
> would be greatly appreciated.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Spring-2.0-%2B-ActiveMQ-4.1-Snapshot%3A-SAXParseException-on-XML-config-files-tf2770420.html#a7734118
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message