Quantcast

http-builder causes "loader constraint violation"...

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

http-builder causes "loader constraint violation"...

Kit Plummer
Here's the error:

Embedded error: java.lang.reflect.InvocationTargetException
loader constraint violation: when resolving overridden method "org.apache.xerces.jaxp.SAXParserImpl.getParser()Lorg/xml/sax/Parser;" the class loader (instance of org/codehaus/groovy/grails/cli/support/GrailsRootLoader) of the current class, org/apache/xerces/jaxp/SAXParserImpl, and its superclass loader (instance of <bootloader>), have different Class objects for the type org/xml/sax/Parser used in the signature

I'm just trying to use http-builder's RestClient to "functional" test RESTful capabilities.

Here's what I've tried in the pom.xml:

<dependency>
      <groupId>org.codehaus.groovy.modules.http-builder</groupId>
      <artifactId>http-builder</artifactId>
      <version>0.5.0-RC2</version>
      <exclusions>
            <exclusion>
                <artifactId>xercesImpl</artifactId>
            </exclusion>
            <exclusion>
                <artifactId>xmlParserAPIs</artifactId>
            </exclusion>
            <exclusion>
                <artifactId>xml-apis</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

I'm on MacOS X "Snow Leopard" with the latest Groovy (1.7.0) and Grails (1.2.0).

Any ideas?  TIA.

Kit
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http-builder causes "loader constraint violation"...

skadiy000
Hi

For some reason http-builder is giving an issue. I too faced the same issue.
The REST plugin has built in http-builder.
Install the grails REST plug-in and remove the http-builder and dependencies from your lib folder.
If you are using maven(pom), you can remove the dependencies from POM.

Thanks

kitplummer wrote
Here's the error:

Embedded error: java.lang.reflect.InvocationTargetException
loader constraint violation: when resolving overridden method "org.apache.xerces.jaxp.SAXParserImpl.getParser()Lorg/xml/sax/Parser;" the class loader (instance of org/codehaus/groovy/grails/cli/support/GrailsRootLoader) of the current class, org/apache/xerces/jaxp/SAXParserImpl, and its superclass loader (instance of <bootloader>), have different Class objects for the type org/xml/sax/Parser used in the signature

I'm just trying to use http-builder's RestClient to "functional" test RESTful capabilities.

Here's what I've tried in the pom.xml:

<dependency>
      <groupId>org.codehaus.groovy.modules.http-builder</groupId>
      <artifactId>http-builder</artifactId>
      <version>0.5.0-RC2</version>
      <exclusions>
            <exclusion>
                <artifactId>xercesImpl</artifactId>
            </exclusion>
            <exclusion>
                <artifactId>xmlParserAPIs</artifactId>
            </exclusion>
            <exclusion>
                <artifactId>xml-apis</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

I'm on MacOS X "Snow Leopard" with the latest Groovy (1.7.0) and Grails (1.2.0).

Any ideas?  TIA.

Kit
Srinivasa Kadiyala
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http-builder causes "loader constraint violation"...

Kit Plummer
Isn't the REST plugin defunct?  I definitely don't want to create a dependency for something that isn't supported.

Srinivasa, Kadiyala wrote
Hi

For some reason http-builder is giving an issue. I too faced the same issue.
The REST plugin has built in http-builder.
Install the grails REST plug-in and remove the http-builder and dependencies from your lib folder.
If you are using maven(pom), you can remove the dependencies from POM.

Thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http-builder causes "loader constraint violation"...

skadiy000
The REST plug-in is not defunct I think. It is working fine for  me.

The problem is some compatibility while importing an http-builder from maven repos.

I suspect that it is a matter of combination of http-builder and its dependencies mis-match.

The best way..is to install the rest plug-in and get rid of the http-builder from POM(If this solution is fine for your task).

Other probably you might have to find the correct combination of http-builder for GRAILS and also other dependencies.

It might be a bit time consuming or some one from GRAILS development team might come handy....

Good luck
kitplummer wrote
Isn't the REST plugin defunct?  I definitely don't want to create a dependency for something that isn't supported.

Srinivasa, Kadiyala wrote
Hi

For some reason http-builder is giving an issue. I too faced the same issue.
The REST plugin has built in http-builder.
Install the grails REST plug-in and remove the http-builder and dependencies from your lib folder.
If you are using maven(pom), you can remove the dependencies from POM.

Thanks
Srinivasa Kadiyala
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http-builder causes "loader constraint violation"...

iouatp
I also get this class loader issue (and the REST plugin is being decommisioned so don't want to use either) and was wondering if anybody could tell me what the issue is.  Difference is I get this when trying to use BuildConfig.groovy

grails.project.dependency.resolution = {
        inherits( "global" ) {
        }
        log "verbose"
        repositories {        
                grailsPlugins()
                grailsHome()
                mavenLocal()
                mavenCentral()
               
                mavenRepo "http://repository.codehaus.org"
        }
        dependencies {
                compile(
                                [group:'org.codehaus.groovy.modules.http-builder', name:'http-builder', version:'0.5.0-RC2']
                )
        }
}
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http-builder causes "loader constraint violation"...

iouatp
i found some bugs in jira that mention this issue.  following the advice i tried to set all jars on my class path to use xerces 2.8.1 and xml-apis 1.3.04 but the error is the same

maybe some other jar on that class path has it in, will try to find it with jarscan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http-builder causes "loader constraint violation"...

iouatp
despite replacing xml-apis-1.3.03.jar with xml-apis-1.3.04.jar in ~/.ivy2/cache/xml-apis/xml-apis/jars, so that it matches the other versions I have on the class path, it keeps downloading xml-apis-1.3.03.jar.  I'm not sure if this is the cause but it sounds like a good bet
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http-builder causes "loader constraint violation"...

iouatp
Please guys, I'm at a loss.

I'm trying to run my canoo tests that ran fine with 1.1 but now I've upgraded I get this loader constraint violation.  I can see an issue (5500, with 1 vote from me) in jira for this but it's not listed in any release notes, so the earliest it can be resolved seems to be 2.0 which has no date.  Until then I'm constrained to using an old version of grails unless somebody has a work around, that doesn't require xml-apis-1.3.03, hence http-builder.  I use http-builder for making RESTful calls.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http-builder causes "loader constraint violation"...

Gustavo Giráldez
This post was updated on .
In reply to this post by iouatp
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http-builder causes "loader constraint violation"...

iouatp
many thanks Gustavo

will try when we attempt another upgrade from grails 1.1.1 to latest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: http-builder causes "loader constraint violation"...

algrails8
Hi,

I've got the same problem

Error executing script RunApp: loader constraint violation: when resolving overridden method "org.apache.xerces.jaxp.SAXParserImpl.getParser()Lorg/xml/sax/Parser;" the class loader (instance of org/codehaus/groovy/grails/cli/support/GrailsRootLoader) of the current class, org/apache/xerces/jaxp/SAXParserImpl, and its superclass loader (instance of <bootloader>), have different Class objects for the type org/xml/sax/Parser used in the signature
java.lang.LinkageError: loader constraint violation: when resolving overridden method "org.apache.xerces.jaxp.SAXParserImpl.getParser()Lorg/xml/sax/Parser;" the class loader (instance of org/codehaus/groovy/grails/cli/support/GrailsRootLoader) of the current class, org/apache/xerces/jaxp/SAXParserImpl, and its superclass loader (instance of <bootloader>), have different Class objects for the type org/xml/sax/Parser used in the signature

we hope that grails people fix it soon ...
Loading...