You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by lekkie <le...@gmail.com> on 2010/05/14 13:25:42 UTC

Embedded ActiveMQ error (Unable to validate using XSD)

Hi guys,

I am trying to run an embedded activemq in my web application using eclipse.

I am certain I have all the right jars and versions as well, the error below
keep coming up:

org.springframework.beans.factory.BeanDefinitionStoreException: Parser
configuration exception parsing XML from ServletContext resource
[/WEB-INF/applicationContext.xml]; nested exception is
javax.xml.parsers.ParserConfigurationException: Unable to validate using
XSD: Your JAXP provider
[org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@7b37df] does not support
XML Schema. Are you running on Java 1.4 with Apache Crimson? Upgrade to
Apache Xerces (or Java 1.5) for full XSD support.
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404)
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)


However, if I start d same web application from tomcat windows service, I
get the following error:

11:55:53,266  INFO DefaultListableBeanFactory:421 - Destroying singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@2006a0:
defining beans
[incomingSMSListener,jmsExceptionListener,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.scheduling.annotation.internalAsyncAnnotationProcessor,org.springframework.scheduling.annotation.internalScheduledAnnotationProcessor,threadPoolExecutor,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,broker,redeliveryPolicy,jmsFactory,cachingConnectionFactory,transactionManager,outgoingSMSQueueJmsTemplate,IncomingSMSListene
 r];
root of factory hierarchy
11:55:53,266 DEBUG DisposableBeanAdapter:172 - Invoking destroy() on bean
with name
'org.springframework.scheduling.annotation.internalScheduledAnnotationProcessor'
11:55:53,266 ERROR ContextLoader:219 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'broker' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested
exception is
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
31 in XML document from ServletContext resource
[/WEB-INF/activemq-broker.xml] 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 'broker'.
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1403)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
	at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
	at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
	at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545)
	at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)
	at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
	at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:272)
	at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:196)


Kindly help out!
-- 
View this message in context: http://old.nabble.com/Embedded-ActiveMQ-error-%28Unable-to-validate-using-XSD%29-tp28557976p28557976.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.


Re: Embedded ActiveMQ error (Unable to validate using XSD)

Posted by lekkie <le...@gmail.com>.
That must be my mistake, I have always thought this is a camel/activeMQ
forum.

I use JDK 1.6
ActiveMQ 5.0.0
Spring 3.0.1

and here is my activemq.xml:

<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at
   
    http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<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"
  xmlns:osgi="http://www.springframework.org/schema/osgi"
  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   
  http://activemq.apache.org/camel/schema/spring
http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
  http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd">

    <!-- Allows us to use system properties as variables in this
configuration file -->
    <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>

	<broker xmlns="http://activemq.apache.org/schema/core" brokerName="default" 
    	dataDirectory="data/activemq/default" useShutdownHook="false">
	
    
        <!-- Destination specific policies using destination names or
wildcards -->
        <destinationPolicy>
            <policyMap>
                <policyEntries>
                    <policyEntry topic=">" producerFlowControl="true"
memoryLimit="1mb">
                        <pendingSubscriberPolicy>
                            <vmCursor />
                        </pendingSubscriberPolicy>
                    </policyEntry>
                    <policyEntry queue=">" producerFlowControl="true"
memoryLimit="1mb">
                        <!-- Use VM cursor for better latency
                             For more information, see:

                             http://activemq.apache.org/message-cursors.html
      
                        <pendingQueuePolicy>
                          <vmQueueCursor/>
                        </pendingQueuePolicy>
                        -->
                    </policyEntry>
                </policyEntries>
            </policyMap>
        </destinationPolicy>

        <!-- Use the following to configure how ActiveMQ is exposed in JMX
-->
        <managementContext>
            <managementContext createConnector="false"/>
        </managementContext>

        <!-- The store and forward broker networks ActiveMQ will listen to
-->
        <networkConnectors>
            <!-- by default just auto discover the other brokers -->
            <networkConnector name="default-nc" uri="multicast://default"/>
            <!-- Example of a static configuration:
            <networkConnector name="host1 and host2"
uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
            -->
        </networkConnectors>

        <persistenceAdapter>
            <kahaDB directory="data/activemq/default" />
        </persistenceAdapter>

        <!-- Use the following if you wish to configure the journal with
JDBC -->
        <!--
        <persistenceAdapter>
            <journaledJDBC dataDirectory="${activemq.base}/data"
dataSource="#postgres-ds"/>
        </persistenceAdapter>
        -->

        <!-- Or if you want to use pure JDBC without a journal -->
        <!--
        <persistenceAdapter>
            <jdbcPersistenceAdapter dataSource="#postgres-ds"/>
        </persistenceAdapter>
        -->

        <!--  The maximum about of space the broker will use before slowing
down producers -->
        <systemUsage>
            <systemUsage>
                <memoryUsage>
                    <memoryUsage limit="20 mb"/>
                </memoryUsage>
                <storeUsage>
                    <storeUsage limit="1 gb" name="foo"/>
                </storeUsage>
                <tempUsage>
                    <tempUsage limit="100 mb"/>
                </tempUsage>
            </systemUsage>
        </systemUsage>


        <!-- The transport connectors ActiveMQ will listen to -->
        <transportConnectors>
            <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"
discoveryUri="multicast://default"/>
            <transportConnector name="stomp" uri="stomp://0.0.0.0:61613"/>
        </transportConnectors>

    </broker>

    <bean id="activemqConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
        <property name="brokerURL" value="tcp://localhost:61616" />
    </bean>

    <bean id="pooledConnectionFactory"
class="org.apache.activemq.pool.PooledConnectionFactoryBean">
        <property name="maxConnections" value="8" />
        <property name="maximumActive" value="500" />
        <property name="transactionManager" ref="transactionManager" />
        <property name="connectionFactory" ref="activemqConnectionFactory"
/>
        <property name="resourceName" value="activemq.default" />
    </bean>

    <bean id="resourceManager"
class="org.apache.activemq.pool.ActiveMQResourceManager"
init-method="recoverResource">
          <property name="transactionManager" ref="transactionManager" />
          <property name="connectionFactory" ref="activemqConnectionFactory"
/>
          <property name="resourceName" value="activemq.default" />
    </bean>

    <osgi:reference id="transactionManager"
interface="javax.transaction.TransactionManager" />

    <osgi:service ref="pooledConnectionFactory">
        <osgi:interfaces>
            <value>javax.jms.ConnectionFactory</value>
        </osgi:interfaces>
        <osgi:service-properties>
            <entry key="name" value="default"/>
        </osgi:service-properties>
    </osgi:service>

</beans>






willem.jiang wrote:
> 
> Can I have a look at your broker configure ?
> BTW, you didn't mention the JDK, ActiveMQ, and Spring version.
> 
> Finally, I don't think it relates to Camel :)
> 
> Willem
> 
> lekkie wrote:
>> Hi guys,
>> 
>> I am trying to run an embedded activemq in my web application using
>> eclipse.
>> 
>> I am certain I have all the right jars and versions as well, the error
>> below
>> keep coming up:
>> 
>> org.springframework.beans.factory.BeanDefinitionStoreException: Parser
>> configuration exception parsing XML from ServletContext resource
>> [/WEB-INF/applicationContext.xml]; nested exception is
>> javax.xml.parsers.ParserConfigurationException: Unable to validate using
>> XSD: Your JAXP provider
>> [org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@7b37df] does not
>> support
>> XML Schema. Are you running on Java 1.4 with Apache Crimson? Upgrade to
>> Apache Xerces (or Java 1.5) for full XSD support.
>> 	at
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404)
>> 	at
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
>> 	at
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
>> 
>> 
>> However, if I start d same web application from tomcat windows service, I
>> get the following error:
>> 
>> 11:55:53,266  INFO DefaultListableBeanFactory:421 - Destroying singletons
>> in
>> org.springframework.beans.factory.support.DefaultListableBeanFactory@2006a0:
>> defining beans
>> [incomingSMSListener,jmsExceptionListener,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.scheduling.annotation.internalAsyncAnnotationProcessor,org.springframework.scheduling.annotation.internalScheduledAnnotationProcessor,threadPoolExecutor,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,broker,redeliveryPolicy,jmsFactory,cachingConnectionFactory,transactionManager,outgoingSMSQueueJmsTemplate,IncomingSMSList
 e
> ne
>>  r];
>> root of factory hierarchy
>> 11:55:53,266 DEBUG DisposableBeanAdapter:172 - Invoking destroy() on bean
>> with name
>> 'org.springframework.scheduling.annotation.internalScheduledAnnotationProcessor'
>> 11:55:53,266 ERROR ContextLoader:219 - Context initialization failed
>> org.springframework.beans.factory.BeanCreationException: Error creating
>> bean
>> with name 'broker' defined in ServletContext resource
>> [/WEB-INF/applicationContext.xml]: Invocation of init method failed;
>> nested
>> exception is
>> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
>> Line
>> 31 in XML document from ServletContext resource
>> [/WEB-INF/activemq-broker.xml] 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 'broker'.
>> 	at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1403)
>> 	at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
>> 	at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
>> 	at
>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
>> 	at
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>> 	at
>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
>> 	at
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
>> 	at
>> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545)
>> 	at
>> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)
>> 	at
>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
>> 	at
>> org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:272)
>> 	at
>> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:196)
>> 
>> 
>> Kindly help out!
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Embedded-ActiveMQ-error-%28Unable-to-validate-using-XSD%29-tp28557976p28567551.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.


Re: Embedded ActiveMQ error (Unable to validate using XSD)

Posted by Willem Jiang <wi...@gmail.com>.
Can I have a look at your broker configure ?
BTW, you didn't mention the JDK, ActiveMQ, and Spring version.

Finally, I don't think it relates to Camel :)

Willem

lekkie wrote:
> Hi guys,
> 
> I am trying to run an embedded activemq in my web application using eclipse.
> 
> I am certain I have all the right jars and versions as well, the error below
> keep coming up:
> 
> org.springframework.beans.factory.BeanDefinitionStoreException: Parser
> configuration exception parsing XML from ServletContext resource
> [/WEB-INF/applicationContext.xml]; nested exception is
> javax.xml.parsers.ParserConfigurationException: Unable to validate using
> XSD: Your JAXP provider
> [org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@7b37df] does not support
> XML Schema. Are you running on Java 1.4 with Apache Crimson? Upgrade to
> Apache Xerces (or Java 1.5) for full XSD support.
> 	at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404)
> 	at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
> 	at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
> 
> 
> However, if I start d same web application from tomcat windows service, I
> get the following error:
> 
> 11:55:53,266  INFO DefaultListableBeanFactory:421 - Destroying singletons in
> org.springframework.beans.factory.support.DefaultListableBeanFactory@2006a0:
> defining beans
> [incomingSMSListener,jmsExceptionListener,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.scheduling.annotation.internalAsyncAnnotationProcessor,org.springframework.scheduling.annotation.internalScheduledAnnotationProcessor,threadPoolExecutor,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,broker,redeliveryPolicy,jmsFactory,cachingConnectionFactory,transactionManager,outgoingSMSQueueJmsTemplate,IncomingSMSListe
ne
>  r];
> root of factory hierarchy
> 11:55:53,266 DEBUG DisposableBeanAdapter:172 - Invoking destroy() on bean
> with name
> 'org.springframework.scheduling.annotation.internalScheduledAnnotationProcessor'
> 11:55:53,266 ERROR ContextLoader:219 - Context initialization failed
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'broker' defined in ServletContext resource
> [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested
> exception is
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
> 31 in XML document from ServletContext resource
> [/WEB-INF/activemq-broker.xml] 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 'broker'.
> 	at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1403)
> 	at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
> 	at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
> 	at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
> 	at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
> 	at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
> 	at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
> 	at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545)
> 	at
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)
> 	at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
> 	at
> org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:272)
> 	at
> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:196)
> 
> 
> Kindly help out!