You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Chris Searle <ch...@chrissearle.org> on 2007/07/02 14:55:07 UTC

XML parser versions

OK. A little confused here. I have three maven projects - all were  
running just fine. All are spring based - and I wanted to add some  
simple aspect programming to one of them. So - I changed the spring  
config file to start like:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:aop="http://www.springframework.org/schema/aop"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="http://www.springframework.org/schema/ 
beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                            http://www.springframework.org/schema/tx  
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
                            http://www.springframework.org/schema/aop  
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
	<aop:spring-configured/>


Now - for this to be parseable you need a recent parser - so - I  
added the following to the pom:

    <dependency>
       <groupId>xerces</groupId>
       <artifactId>xercesImpl</artifactId>
       <version>2.8.1</version>
     </dependency>

This project works just fine. mvn test completes, mvn install works.  
All is well and good. Even the spring aop stuff works fine - using  
the aspectjweaver.jar :)


Projects 2 and 3 depend on project 1. Both of these have the exact  
same start to their spring XML minus the <aop:spring-configured> line  
since they do not directly have aop (they both use the spring config  
of project1 for that part - loaded from the classpath). Both projects  
2 and 3 have the same xerces dependency in their poms.

mvn test and mvn install work just fine on project 2. But project 3  
fails. It gives:

testGetActiveMembersReport(net.chrissearle.export.TestExportService)   
Time elapsed: 5.424 sec  <<< ERROR!
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: L 
ine 9 in XML document from class path resource [project1.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 'aop:spring-configured'.

Now - this is apparently due to parser version.

mvn dependency:build-classpath shows only xerces 2.8.1. But - mvn  
site builds a site page where the dependencies show:

For compile:

xerces xercesImpl 2.8.1 - jar

but - for Project Transitive Dependencies

xerces xerces 1.2.3 - jar

However - the Project Dependency Graph only lists  
xerces:xercesImpl:jar (the direct dependency) - not the  
xerces:xerces:jar.

I just can't figure out what is pulling in the older xerces - and I  
need to get it into an exclusion somehow. Any hints on how to find  
out what is pulling it in?

Chris Searle
chris@chrissearle.org



Re: XML parser versions

Posted by Chris Searle <ch...@chrissearle.org>.
On 3. jul. 2007, at 22.16, Bryan Loofbourrow wrote:

Sorry for the late reply - a little hectic with a new son in the  
house :)

> I'm assuming that you have your preferred version of xerces listed  
> in a
> <dependencyManagement> section of your root pom.xml. That's a good  
> thing,

Not that I am aware of. I'm pretty much new to maven and my pom is  
mostly cargo-cult fetched from google searches.

I'm not even clear what you refer to as the "root pom.xml" file - all  
of the projects have their own pom - and I have not yet had time to  
look into collecting them into collected set with a parent pom (if  
that is indeed possible).

> but it's not a panacea because of Maven 2's oddball rules about  
> what version
> wins, based on some sort of "distance from the invoker" rule. I think
> there's a JIRA entry asking for better behavior there, and I  
> haven't checked
> on it lately so I don't know the status.
>
> I've dealt with a similar issue by putting an explicit dependency  
> on the
> preferred artifact version into the pom.xml of the project that  
> generates
> the artifact into which the subsidiary artifact will be packaged.  
> That's an
> ear, in my case. That works because such dependencies always win  
> the version
> competition, but it is a bit of a hack.

Trouble is - I have

1) Added explicit requirement on xerces 2.8.1 in all poms
2) In the problem project added an exclusion on xerces 1.2.3 in the  
dependency xml for commons-jxpath (the only one in my .m2/repo that  
refers to xerces 1.2.3)

As far as I can tell - this _should_ work. It _does_ in two of three  
poms. Just this one that won't fly.



>
> -- Bryan
>
> -----Original Message-----
> From: Chris Searle [mailto:chris@chrissearle.org]
> Sent: Tuesday, July 03, 2007 2:04 AM
> To: Maven Users List
> Subject: Re: XML parser versions
>
>> I suggest grepping your local repository for 1.2.3. My guess would
>> be that
>> you'll find a reference to it in a pom.xml file somewhere in there.
>
> slippen:~/.m2/repository chris$ grep -r -l "1.2.3" . | grep pom$
> ./commons-jxpath/commons-jxpath/1.2/commons-jxpath-1.2.pom
> ./xerces/xerces/1.2.3/xerces-1.2.3.pom
>
> So - it is present in xerces itself and commons-jxpath.
>
> So - I have added the following again:
>
>      <dependency>
>        <groupId>commons-jxpath</groupId>
>        <artifactId>commons-jxpath</artifactId>
>        <version>1.2</version>
>        <exclusions>
>          <exclusion>
>            <groupId>xerces</groupId>
>            <artifactId>xerces</artifactId>
>          </exclusion>
>        </exclusions>
>      </dependency>
>
> Ran a mvn clean, then a site then a test.
>
> site still shows xerces xerces 1.2.3 required under Project
> Transitive Dependencies
>
> test still fails due to the wrong parser being used
>
>
>
>>
>> -----Original Message-----
>> From: Chris Searle [mailto:chris@chrissearle.org]
>> Sent: Monday, July 02, 2007 5:55 AM
>> To: users@maven.apache.org
>> Subject: XML parser versions
>>
>> OK. A little confused here. I have three maven projects - all were
>> running just fine. All are spring based - and I wanted to add some
>> simple aspect programming to one of them. So - I changed the spring
>> config file to start like:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <beans xmlns="http://www.springframework.org/schema/beans"
>>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>         xmlns:aop="http://www.springframework.org/schema/aop"
>>         xmlns:tx="http://www.springframework.org/schema/tx"
>>         xsi:schemaLocation="http://www.springframework.org/schema/
>> beans http://www.springframework.org/schema/beans/spring- 
>> beans-2.0.xsd
>>                             http://www.springframework.org/schema/tx
>> http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
>>                             http://www.springframework.org/schema/aop
>> http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
>> 	<aop:spring-configured/>
>>
>>
>> Now - for this to be parseable you need a recent parser - so - I
>> added the following to the pom:
>>
>>     <dependency>
>>        <groupId>xerces</groupId>
>>        <artifactId>xercesImpl</artifactId>
>>        <version>2.8.1</version>
>>      </dependency>
>>
>> This project works just fine. mvn test completes, mvn install works.
>> All is well and good. Even the spring aop stuff works fine - using
>> the aspectjweaver.jar :)
>>
>>
>> Projects 2 and 3 depend on project 1. Both of these have the exact
>> same start to their spring XML minus the <aop:spring-configured> line
>> since they do not directly have aop (they both use the spring config
>> of project1 for that part - loaded from the classpath). Both projects
>> 2 and 3 have the same xerces dependency in their poms.
>>
>> mvn test and mvn install work just fine on project 2. But project 3
>> fails. It gives:
>>
>> testGetActiveMembersReport(net.chrissearle.export.TestExportService)
>> Time elapsed: 5.424 sec  <<< ERROR!
>> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException 
>> :
>>  L
>> ine 9 in XML document from class path resource [project1.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 'aop:spring-configured'.
>>
>> Now - this is apparently due to parser version.
>>
>> mvn dependency:build-classpath shows only xerces 2.8.1. But - mvn
>> site builds a site page where the dependencies show:
>>
>> For compile:
>>
>> xerces xercesImpl 2.8.1 - jar
>>
>> but - for Project Transitive Dependencies
>>
>> xerces xerces 1.2.3 - jar
>>
>> However - the Project Dependency Graph only lists
>> xerces:xercesImpl:jar (the direct dependency) - not the
>> xerces:xerces:jar.
>>
>> I just can't figure out what is pulling in the older xerces - and I
>> need to get it into an exclusion somehow. Any hints on how to find
>> out what is pulling it in?
>>
>> Chris Searle
>> chris@chrissearle.org
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>
> Chris Searle
> chris@chrissearle.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

Chris Searle
chris@chrissearle.org



RE: XML parser versions

Posted by Bryan Loofbourrow <br...@islandbeast.com>.
I'm assuming that you have your preferred version of xerces listed in a
<dependencyManagement> section of your root pom.xml. That's a good thing,
but it's not a panacea because of Maven 2's oddball rules about what version
wins, based on some sort of "distance from the invoker" rule. I think
there's a JIRA entry asking for better behavior there, and I haven't checked
on it lately so I don't know the status.

I've dealt with a similar issue by putting an explicit dependency on the
preferred artifact version into the pom.xml of the project that generates
the artifact into which the subsidiary artifact will be packaged. That's an
ear, in my case. That works because such dependencies always win the version
competition, but it is a bit of a hack.

-- Bryan

-----Original Message-----
From: Chris Searle [mailto:chris@chrissearle.org] 
Sent: Tuesday, July 03, 2007 2:04 AM
To: Maven Users List
Subject: Re: XML parser versions

> I suggest grepping your local repository for 1.2.3. My guess would  
> be that
> you'll find a reference to it in a pom.xml file somewhere in there.

slippen:~/.m2/repository chris$ grep -r -l "1.2.3" . | grep pom$
./commons-jxpath/commons-jxpath/1.2/commons-jxpath-1.2.pom
./xerces/xerces/1.2.3/xerces-1.2.3.pom

So - it is present in xerces itself and commons-jxpath.

So - I have added the following again:

     <dependency>
       <groupId>commons-jxpath</groupId>
       <artifactId>commons-jxpath</artifactId>
       <version>1.2</version>
       <exclusions>
         <exclusion>
           <groupId>xerces</groupId>
           <artifactId>xerces</artifactId>
         </exclusion>
       </exclusions>
     </dependency>

Ran a mvn clean, then a site then a test.

site still shows xerces xerces 1.2.3 required under Project  
Transitive Dependencies

test still fails due to the wrong parser being used



>
> -----Original Message-----
> From: Chris Searle [mailto:chris@chrissearle.org]
> Sent: Monday, July 02, 2007 5:55 AM
> To: users@maven.apache.org
> Subject: XML parser versions
>
> OK. A little confused here. I have three maven projects - all were
> running just fine. All are spring based - and I wanted to add some
> simple aspect programming to one of them. So - I changed the spring
> config file to start like:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xmlns:aop="http://www.springframework.org/schema/aop"
>         xmlns:tx="http://www.springframework.org/schema/tx"
>         xsi:schemaLocation="http://www.springframework.org/schema/
> beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>                             http://www.springframework.org/schema/tx
> http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
>                             http://www.springframework.org/schema/aop
> http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
> 	<aop:spring-configured/>
>
>
> Now - for this to be parseable you need a recent parser - so - I
> added the following to the pom:
>
>     <dependency>
>        <groupId>xerces</groupId>
>        <artifactId>xercesImpl</artifactId>
>        <version>2.8.1</version>
>      </dependency>
>
> This project works just fine. mvn test completes, mvn install works.
> All is well and good. Even the spring aop stuff works fine - using
> the aspectjweaver.jar :)
>
>
> Projects 2 and 3 depend on project 1. Both of these have the exact
> same start to their spring XML minus the <aop:spring-configured> line
> since they do not directly have aop (they both use the spring config
> of project1 for that part - loaded from the classpath). Both projects
> 2 and 3 have the same xerces dependency in their poms.
>
> mvn test and mvn install work just fine on project 2. But project 3
> fails. It gives:
>
> testGetActiveMembersReport(net.chrissearle.export.TestExportService)
> Time elapsed: 5.424 sec  <<< ERROR!
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: 
>  L
> ine 9 in XML document from class path resource [project1.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 'aop:spring-configured'.
>
> Now - this is apparently due to parser version.
>
> mvn dependency:build-classpath shows only xerces 2.8.1. But - mvn
> site builds a site page where the dependencies show:
>
> For compile:
>
> xerces xercesImpl 2.8.1 - jar
>
> but - for Project Transitive Dependencies
>
> xerces xerces 1.2.3 - jar
>
> However - the Project Dependency Graph only lists
> xerces:xercesImpl:jar (the direct dependency) - not the
> xerces:xerces:jar.
>
> I just can't figure out what is pulling in the older xerces - and I
> need to get it into an exclusion somehow. Any hints on how to find
> out what is pulling it in?
>
> Chris Searle
> chris@chrissearle.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

Chris Searle
chris@chrissearle.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: XML parser versions

Posted by Chris Searle <ch...@chrissearle.org>.
> I suggest grepping your local repository for 1.2.3. My guess would  
> be that
> you'll find a reference to it in a pom.xml file somewhere in there.

slippen:~/.m2/repository chris$ grep -r -l "1.2.3" . | grep pom$
./commons-jxpath/commons-jxpath/1.2/commons-jxpath-1.2.pom
./xerces/xerces/1.2.3/xerces-1.2.3.pom

So - it is present in xerces itself and commons-jxpath.

So - I have added the following again:

     <dependency>
       <groupId>commons-jxpath</groupId>
       <artifactId>commons-jxpath</artifactId>
       <version>1.2</version>
       <exclusions>
         <exclusion>
           <groupId>xerces</groupId>
           <artifactId>xerces</artifactId>
         </exclusion>
       </exclusions>
     </dependency>

Ran a mvn clean, then a site then a test.

site still shows xerces xerces 1.2.3 required under Project  
Transitive Dependencies

test still fails due to the wrong parser being used



>
> -----Original Message-----
> From: Chris Searle [mailto:chris@chrissearle.org]
> Sent: Monday, July 02, 2007 5:55 AM
> To: users@maven.apache.org
> Subject: XML parser versions
>
> OK. A little confused here. I have three maven projects - all were
> running just fine. All are spring based - and I wanted to add some
> simple aspect programming to one of them. So - I changed the spring
> config file to start like:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xmlns:aop="http://www.springframework.org/schema/aop"
>         xmlns:tx="http://www.springframework.org/schema/tx"
>         xsi:schemaLocation="http://www.springframework.org/schema/
> beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>                             http://www.springframework.org/schema/tx
> http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
>                             http://www.springframework.org/schema/aop
> http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
> 	<aop:spring-configured/>
>
>
> Now - for this to be parseable you need a recent parser - so - I
> added the following to the pom:
>
>     <dependency>
>        <groupId>xerces</groupId>
>        <artifactId>xercesImpl</artifactId>
>        <version>2.8.1</version>
>      </dependency>
>
> This project works just fine. mvn test completes, mvn install works.
> All is well and good. Even the spring aop stuff works fine - using
> the aspectjweaver.jar :)
>
>
> Projects 2 and 3 depend on project 1. Both of these have the exact
> same start to their spring XML minus the <aop:spring-configured> line
> since they do not directly have aop (they both use the spring config
> of project1 for that part - loaded from the classpath). Both projects
> 2 and 3 have the same xerces dependency in their poms.
>
> mvn test and mvn install work just fine on project 2. But project 3
> fails. It gives:
>
> testGetActiveMembersReport(net.chrissearle.export.TestExportService)
> Time elapsed: 5.424 sec  <<< ERROR!
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: 
>  L
> ine 9 in XML document from class path resource [project1.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 'aop:spring-configured'.
>
> Now - this is apparently due to parser version.
>
> mvn dependency:build-classpath shows only xerces 2.8.1. But - mvn
> site builds a site page where the dependencies show:
>
> For compile:
>
> xerces xercesImpl 2.8.1 - jar
>
> but - for Project Transitive Dependencies
>
> xerces xerces 1.2.3 - jar
>
> However - the Project Dependency Graph only lists
> xerces:xercesImpl:jar (the direct dependency) - not the
> xerces:xerces:jar.
>
> I just can't figure out what is pulling in the older xerces - and I
> need to get it into an exclusion somehow. Any hints on how to find
> out what is pulling it in?
>
> Chris Searle
> chris@chrissearle.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

Chris Searle
chris@chrissearle.org



RE: XML parser versions

Posted by Bryan Loofbourrow <br...@islandbeast.com>.
I suggest grepping your local repository for 1.2.3. My guess would be that
you'll find a reference to it in a pom.xml file somewhere in there.

-----Original Message-----
From: Chris Searle [mailto:chris@chrissearle.org] 
Sent: Monday, July 02, 2007 5:55 AM
To: users@maven.apache.org
Subject: XML parser versions

OK. A little confused here. I have three maven projects - all were  
running just fine. All are spring based - and I wanted to add some  
simple aspect programming to one of them. So - I changed the spring  
config file to start like:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:aop="http://www.springframework.org/schema/aop"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="http://www.springframework.org/schema/ 
beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                            http://www.springframework.org/schema/tx  
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
                            http://www.springframework.org/schema/aop  
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
	<aop:spring-configured/>


Now - for this to be parseable you need a recent parser - so - I  
added the following to the pom:

    <dependency>
       <groupId>xerces</groupId>
       <artifactId>xercesImpl</artifactId>
       <version>2.8.1</version>
     </dependency>

This project works just fine. mvn test completes, mvn install works.  
All is well and good. Even the spring aop stuff works fine - using  
the aspectjweaver.jar :)


Projects 2 and 3 depend on project 1. Both of these have the exact  
same start to their spring XML minus the <aop:spring-configured> line  
since they do not directly have aop (they both use the spring config  
of project1 for that part - loaded from the classpath). Both projects  
2 and 3 have the same xerces dependency in their poms.

mvn test and mvn install work just fine on project 2. But project 3  
fails. It gives:

testGetActiveMembersReport(net.chrissearle.export.TestExportService)   
Time elapsed: 5.424 sec  <<< ERROR!
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: L 
ine 9 in XML document from class path resource [project1.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 'aop:spring-configured'.

Now - this is apparently due to parser version.

mvn dependency:build-classpath shows only xerces 2.8.1. But - mvn  
site builds a site page where the dependencies show:

For compile:

xerces xercesImpl 2.8.1 - jar

but - for Project Transitive Dependencies

xerces xerces 1.2.3 - jar

However - the Project Dependency Graph only lists  
xerces:xercesImpl:jar (the direct dependency) - not the  
xerces:xerces:jar.

I just can't figure out what is pulling in the older xerces - and I  
need to get it into an exclusion somehow. Any hints on how to find  
out what is pulling it in?

Chris Searle
chris@chrissearle.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org