You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by "C. Benson Manica" <at...@sdf.lonestar.org> on 2006/09/21 16:41:24 UTC

Example Spring XML doesn't work

I am not an XML guru by any stretch, but I have been trying for the
better part of an hour to come up with a Spring XML file that
configures ActiveMQ, with no success.  Out of the box, the
configuration at 

http://www.activemq.org/site/how-do-i-embed-a-broker-inside-a-connection.html

gives me

     [java] Exception in thread "main" org.springframework.beans.factory.BeanDef
initionStoreException: Line 4107 in XML document from class path resource [Activ
eMQ.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cos-nona
mbig: "http://activemq.org/config/1.0":redeliveryPolicy and WC[##any] (or elemen
ts from their substitution group) violate "Unique Particle Attribution". During
validation against this schema, ambiguity would be created for those two particl
es.
     [java] Caused by: org.xml.sax.SAXParseException: cos-nonambig: "http://acti
vemq.org/config/1.0":redeliveryPolicy and WC[##any] (or elements from their subs
titution group) violate "Unique Particle Attribution". During validation against
 this schema, ambiguity would be created for those two particles.

This makes absolutely no sense to me, but I suppose it has something
to do with the xmlns attribute, so I changed it to 1.02 (from 1.0) and
then got this:

     [java] Exception in thread "main" org.springframework.beans.factory.BeanDef
initionStoreException: Line 135 in XML document from class path resource [Active
MQ.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-compl
ex-type.2.4.c: The matching wildcard is strict, but no declaration can be found
for element 'amq:broker'.
     [java] Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: Th
e matching wildcard is strict, but no declaration can be found for element 'amq:
broker'.

This still makes no sense to me whatsoever.  If someone could please
tell me what I need to do to the example configuration to make it work
I would be most appreciative.

-- 
C. Benson Manica
ataru(at)sdf.lonestar.org

Re: Example Spring XML doesn't work

Posted by Piers Geyman <pi...@gta-travel.com>.
Hi,

I have the same issue. I updated my activemq jars to use version
4.1-SNAPSHOT (as there does not seem to be a 4.1 release yet) and I still
get the same problem.

I am using: 
* Spring version 2.0-rc3 (jar: spring-2.0-rc3.jar)
* Active MQ 4.1-SNAPSHOT (jars: activeio-core-3.0-SNAPSHOT.jar,
activemq-core-4.1-SNAPSHOT.jar)
* xbean-spring 2.6  (jar: xbean-spring-2.6.jar)

I am running under Tomcat 5.5.17 on Sun JDK version:  1.5.0_07-b03 (on
windows)

I have created an activemq.xml that has a root element of beans with name
space declarations: 

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/schema/beans/spring-beans.xsd
http://activemq.org/config/1.0
http://people.apache.org/repository/org.apache.activemq/xsds/activemq-core-4.1-incubator-SNAPSHOT.xsd"

And a simple broker configured using amq:broker element as per the sample on
the web site.
I have loaded the activemq.xml into spring using the contextConfigLocation
context-param in the web.xml.

When the web application loads, and spring initializes I get the same error
and stacktrace as below.
Any suggestions? Would this be an xml version issue?

Thanks and regards

Piers


James.Strachan wrote:
> 
> On 9/21/06, C. Benson Manica <at...@sdf.lonestar.org> wrote:
>> On Thu, Sep 21, 2006 at 04:13:59PM +0100, James Strachan wrote:
>> > On 9/21/06, C. Benson Manica <at...@sdf.lonestar.org> wrote:
>> > >I am not an XML guru by any stretch, but I have been trying for the
>> > >better part of an hour to come up with a Spring XML file that
>> > >configures ActiveMQ, with no success.  Out of the box, the
>> > >configuration at
>> > >
>> >
>> >http://www.activemq.org/site/how-do-i-embed-a-broker-inside-a-connection.html
>> > >
>> > >gives me
>> > >
>> > >     [java] Exception in thread "main"
>> > >     org.springframework.beans.factory.BeanDef
>> > >initionStoreException: Line 4107 in XML document from class path
>> resource
>> > >[Activ
>> > >eMQ.xml] is invalid; nested exception is
>> org.xml.sax.SAXParseException:
>> > >cos-nona
>> > >mbig: "http://activemq.org/config/1.0":redeliveryPolicy and WC[##any]
>> (or
>> > >elemen
>> > >ts from their substitution group) violate "Unique Particle
>> Attribution".
>> > >During
>> > >validation against this schema, ambiguity would be created for those
>> two
>> > >particl
>> > >es.
>> > >     [java] Caused by: org.xml.sax.SAXParseException: cos-nonambig:
>> > >     "http://acti
>> > >vemq.org/config/1.0":redeliveryPolicy and WC[##any] (or elements from
>> > >their subs
>> > >titution group) violate "Unique Particle Attribution". During
>> validation
>> > >against
>> > > this schema, ambiguity would be created for those two particles.
>> >
>> > So the example on that page does not use any XSDs - so I'm wondering
>> > what your XML actually looks like? Also what is the version of
>> > ActiveMQ / xbean / spring that you are using?
>>
>> Scroll down a little on the page - I am using the Spring 2.0 example
>> XML, which does use XSD's.
> 
> You're XML didn't make it to the Apache mailing list - I guess nabble
> removed it.
> 
> 
>> I'm using Spring 2.0 RC4, ActiveMQ 4.0.1, and xbean-spring-2.6.  Am I
>> missing a jar?
> 
> Unfortuantely 4.0.x doesn't support Spring 2 - I suspect you'll need to
> use 4.1.
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/Example-Spring-XML-doesn%27t-work-tf2312387.html#a6484280
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Example Spring XML doesn't work

Posted by "C. Benson Manica" <at...@sdf.lonestar.org>.
On Thu, Sep 21, 2006 at 06:22:42PM +0100, James Strachan wrote:
> You're XML didn't make it to the Apache mailing list - I guess nabble
> removed it.
 
I didn't include it, actually, since it seemed superfluous given that
it was available from the web site...

> Unfortuantely 4.0.x doesn't support Spring 2 - I suspect you'll need to use 
> 4.1.

That definitely sounds like the problem - thanks!

-- 
C. Benson Manica
ataru(at)sdf.lonestar.org

Re: Example Spring XML doesn't work

Posted by James Strachan <ja...@gmail.com>.
On 9/21/06, C. Benson Manica <at...@sdf.lonestar.org> wrote:
> On Thu, Sep 21, 2006 at 04:13:59PM +0100, James Strachan wrote:
> > On 9/21/06, C. Benson Manica <at...@sdf.lonestar.org> wrote:
> > >I am not an XML guru by any stretch, but I have been trying for the
> > >better part of an hour to come up with a Spring XML file that
> > >configures ActiveMQ, with no success.  Out of the box, the
> > >configuration at
> > >
> > >http://www.activemq.org/site/how-do-i-embed-a-broker-inside-a-connection.html
> > >
> > >gives me
> > >
> > >     [java] Exception in thread "main"
> > >     org.springframework.beans.factory.BeanDef
> > >initionStoreException: Line 4107 in XML document from class path resource
> > >[Activ
> > >eMQ.xml] is invalid; nested exception is org.xml.sax.SAXParseException:
> > >cos-nona
> > >mbig: "http://activemq.org/config/1.0":redeliveryPolicy and WC[##any] (or
> > >elemen
> > >ts from their substitution group) violate "Unique Particle Attribution".
> > >During
> > >validation against this schema, ambiguity would be created for those two
> > >particl
> > >es.
> > >     [java] Caused by: org.xml.sax.SAXParseException: cos-nonambig:
> > >     "http://acti
> > >vemq.org/config/1.0":redeliveryPolicy and WC[##any] (or elements from
> > >their subs
> > >titution group) violate "Unique Particle Attribution". During validation
> > >against
> > > this schema, ambiguity would be created for those two particles.
> >
> > So the example on that page does not use any XSDs - so I'm wondering
> > what your XML actually looks like? Also what is the version of
> > ActiveMQ / xbean / spring that you are using?
>
> Scroll down a little on the page - I am using the Spring 2.0 example
> XML, which does use XSD's.

You're XML didn't make it to the Apache mailing list - I guess nabble
removed it.


> I'm using Spring 2.0 RC4, ActiveMQ 4.0.1, and xbean-spring-2.6.  Am I
> missing a jar?

Unfortuantely 4.0.x doesn't support Spring 2 - I suspect you'll need to use 4.1.
-- 

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

Re: Example Spring XML doesn't work

Posted by "C. Benson Manica" <at...@sdf.lonestar.org>.
On Thu, Sep 21, 2006 at 04:13:59PM +0100, James Strachan wrote:
> On 9/21/06, C. Benson Manica <at...@sdf.lonestar.org> wrote:
> >I am not an XML guru by any stretch, but I have been trying for the
> >better part of an hour to come up with a Spring XML file that
> >configures ActiveMQ, with no success.  Out of the box, the
> >configuration at
> >
> >http://www.activemq.org/site/how-do-i-embed-a-broker-inside-a-connection.html
> >
> >gives me
> >
> >     [java] Exception in thread "main" 
> >     org.springframework.beans.factory.BeanDef
> >initionStoreException: Line 4107 in XML document from class path resource 
> >[Activ
> >eMQ.xml] is invalid; nested exception is org.xml.sax.SAXParseException: 
> >cos-nona
> >mbig: "http://activemq.org/config/1.0":redeliveryPolicy and WC[##any] (or 
> >elemen
> >ts from their substitution group) violate "Unique Particle Attribution". 
> >During
> >validation against this schema, ambiguity would be created for those two 
> >particl
> >es.
> >     [java] Caused by: org.xml.sax.SAXParseException: cos-nonambig: 
> >     "http://acti
> >vemq.org/config/1.0":redeliveryPolicy and WC[##any] (or elements from 
> >their subs
> >titution group) violate "Unique Particle Attribution". During validation 
> >against
> > this schema, ambiguity would be created for those two particles.
> 
> So the example on that page does not use any XSDs - so I'm wondering
> what your XML actually looks like? Also what is the version of
> ActiveMQ / xbean / spring that you are using?

Scroll down a little on the page - I am using the Spring 2.0 example
XML, which does use XSD's.

I'm using Spring 2.0 RC4, ActiveMQ 4.0.1, and xbean-spring-2.6.  Am I
missing a jar?

-- 
C. Benson Manica
ataru(at)sdf.lonestar.org

Re: Example Spring XML doesn't work

Posted by James Strachan <ja...@gmail.com>.
On 9/21/06, C. Benson Manica <at...@sdf.lonestar.org> wrote:
> I am not an XML guru by any stretch, but I have been trying for the
> better part of an hour to come up with a Spring XML file that
> configures ActiveMQ, with no success.  Out of the box, the
> configuration at
>
> http://www.activemq.org/site/how-do-i-embed-a-broker-inside-a-connection.html
>
> gives me
>
>      [java] Exception in thread "main" org.springframework.beans.factory.BeanDef
> initionStoreException: Line 4107 in XML document from class path resource [Activ
> eMQ.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cos-nona
> mbig: "http://activemq.org/config/1.0":redeliveryPolicy and WC[##any] (or elemen
> ts from their substitution group) violate "Unique Particle Attribution". During
> validation against this schema, ambiguity would be created for those two particl
> es.
>      [java] Caused by: org.xml.sax.SAXParseException: cos-nonambig: "http://acti
> vemq.org/config/1.0":redeliveryPolicy and WC[##any] (or elements from their subs
> titution group) violate "Unique Particle Attribution". During validation against
>  this schema, ambiguity would be created for those two particles.

So the example on that page does not use any XSDs - so I'm wondering
what your XML actually looks like? Also what is the version of
ActiveMQ / xbean / spring that you are using?

-- 

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