You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Albert Strasheim <fu...@gmail.com> on 2007/09/21 22:16:52 UTC

The matching wildcard is strict error with AMQ 5 (was Re: AMQ 4.1 and Spring XML beans)

Hello all

I'm experiencing this same error with ActiveMQ 5.0 trunk revision 578254.

ERROR: Failed to instantiate Spring bean factory: Line 9 in XML document 
from file [C:\gridgain-1.5.1\config\gridgain.xml] is invalid; nested excepti
on 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'.
wrapper

I'm trying to configure GridGain to use ActiveMQ. Without the amq:broker 
bits, it works fine. My XML configuration:

<?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" 
xmlns:util="http://www.springframework.org/schema/util"
  xsi:schemaLocation="
        http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
        http://www.springframework.org/schema/util 
http://www.springframework.org/schema/util/spring-util-2.0.xsd
        http://activemq.org/config/1.0 
http://activemq.apache.org/schema/core/activemq-core-5.0-SNAPSHOT.xsd">
  <description>GridGain configuration</description>
  <amq:broker useJmx="false" persistent="false">
    <amq:transportConnectors>
      <amq:transportConnector uri="tcp://localhost:41292" />
    </amq:transportConnectors>
  </amq:broker>
  <util:map id="jmsJndiMap">
    <entry>
      <key>
        <util:constant 
static-field="javax.naming.Context.INITIAL_CONTEXT_FACTORY" />
      </key>
      <value>org.apache.activemq.jndi.ActiveMQInitialContextFactory</value>
    </entry>
    <entry>
      <key>
        <util:constant static-field="javax.naming.Context.PROVIDER_URL" />
      </key>
      <value>vm://localhost</value>
    </entry>
  </util:map>
  <bean id="grid" class="org.gridgain.grid.GridConfigurationAdapter" 
scope="singleton">
    <property name="gridName" value="mygrid" />
    <property name="peerClassLoadingEnabled" value="true" />
    <property name="communicationSpi">
      <bean 
class="org.gridgain.grid.spi.communication.jms.GridJmsCommunicationSpi">
        <property name="connectionFactoryName" value="connectionFactory" />
        <property name="topicName" value="topic/gridgain.communication" />
        <property name="jndiEnvironment" ref="jmsJndiMap" />
      </bean>
    </property>
    <property name="discoverySpi">
      <bean class="org.gridgain.grid.spi.discovery.jms.GridJmsDiscoverySpi">
        <property name="connectionFactoryName" value="connectionFactory" />
        <property name="topicName" value="topic/gridgain.discovery" />
        <property name="jndiEnvironment" ref="jmsJndiMap" />
      </bean>
    </property>
  </bean>
</beans>

Any thoughts?

Regards,

Albert

----- Original Message ----- 
From: "Paul Smith" <ps...@aconex.com>
To: <us...@activemq.apache.org>
Sent: Monday, September 03, 2007 1:06 PM
Subject: AMQ 4.1 and Spring XML beans


> Confused!  This works (as expected):
>
>   <amq:broker useJmx="true" persistent="true">
>     <amq:persistenceAdapter>
>   <amq:jdbcPersistenceAdapter dataSource="#derby-ds"/>
>  </amq:persistenceAdapter>
>
>     <amq:transportConnectors>
>       <amq:transportConnector uri="tcp://localhost:0" />
>     </amq:transportConnectors>
>   </amq:broker>
>
> But this doesn't which is sort of copied from the XML guide on the
> website:
>
>   <amq:broker useJmx="true" persistent="true">
>  <amq:persistenceAdapter>
>  <journaledJDBC journalLogFiles="5" dataDirectory="$
> {activemq.base}/activemq-data"  dataSource="#derby-ds"/>
>  </amq:persistenceAdapter>
>
>     <amq:transportConnectors>
>       <amq:transportConnector uri="tcp://localhost:0" />
>     </amq:transportConnectors>
>   </amq:broker>
>
> I get this error after starting up Spring:
>
> Exception in thread "main"
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: L
> ine 15 in XML document from class path resource [amq.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 'journaledJDBC'.
> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The
> matching wildcard is strict, but no declaration can be found for
> element 'journaledJDBC'.
> at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXPar
> seException(ErrorHandlerWrapper.java:236)


Re: The matching wildcard is strict error with AMQ 5 (was Re: AMQ 4.1 and Spring XML beans)

Posted by Albert Strasheim <fu...@gmail.com>.
Hello all

I've been getting a few queries about this issue from various people 
off-list, so I thought I'd reply here with some useful ideas for future 
generations struggling with this issue.

My advice:

If I remember correctly, you should check your Spring XML, the ActiveMQ 
schema and the schema.location in the ActiveMQ JAR *very* carefully to make 
sure that all the various URIs and other IDs match up.

And be sure to read: http://erik.jteam.nl/?p=27

One person who followed this advice replied to me, saying:

You are right,i have corrected the namespace decleration in the spring xml 
and it works now. But i guess i cannot use the spring property placeholders 
for amq:... namespaces.It complains a lot.

Hope this helps.

Cheers,

Albert

----- Original Message ----- 
From: "Albert Strasheim" <fu...@gmail.com>
To: <us...@activemq.apache.org>
Sent: Friday, September 21, 2007 10:41 PM
Subject: Re: The matching wildcard is strict error with AMQ 5 (was Re: AMQ 
4.1 and Spring XML beans)


> Found the bug somewhere between the chair and the keyboard.
>
> ----- Original Message ----- 
> From: "Albert Strasheim" <fu...@gmail.com>
> To: <us...@activemq.apache.org>
> Sent: Friday, September 21, 2007 10:16 PM
> Subject: The matching wildcard is strict error with AMQ 5 (was Re: AMQ 4.1 
> and Spring XML beans)


Re: The matching wildcard is strict error with AMQ 5 (was Re: AMQ 4.1 and Spring XML beans)

Posted by Albert Strasheim <fu...@gmail.com>.
Found the bug somewhere between the chair and the keyboard.

----- Original Message ----- 
From: "Albert Strasheim" <fu...@gmail.com>
To: <us...@activemq.apache.org>
Sent: Friday, September 21, 2007 10:16 PM
Subject: The matching wildcard is strict error with AMQ 5 (was Re: AMQ 4.1 
and Spring XML beans)


> <?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" 
> xmlns:util="http://www.springframework.org/schema/util"
>  xsi:schemaLocation="
>        http://www.springframework.org/schema/beans 
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>        http://www.springframework.org/schema/util 
> http://www.springframework.org/schema/util/spring-util-2.0.xsd
>        http://activemq.org/config/1.0 
> http://activemq.apache.org/schema/core/activemq-core-5.0-SNAPSHOT.xsd">

This last URI should be

http://activemq.apache.org/snapshot-schema/activemq-core-5.0.xsd

It would appear the example at

http://activemq.apache.org/spring-support.html

is wrong, since the spring.schemas isn't set up to work with the URI listed 
there (and the one I tried to use).

Thanks to Erik Wiersma for helping me figure this out.

http://erik.jteam.nl/?p=27

Cheers,

Albert