[ 
https://issues.apache.org/jira/browse/GROOVY-3583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15167502#comment-15167502
 ] 

jianping roth commented on GROOVY-3583:
---------------------------------------

I also run into a jdbc issue

@Grab('org.postgresql:postgresql:9.4.1207')
@GrabConfig(systemClassLoader=true)
@Grab('org.codehaus.groovy.modules.http-builder:http-builder:0.7.1')
@Grab('org.apache.httpcomponents:httpclient:4.3.4')

{code}
Caught: 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/tools/RootLoader) 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/tools/RootLoader) 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
        at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown 
Source)
        at 
org.apache.xml.resolver.readers.SAXCatalogReader.readCatalog(SAXCatalogReader.java:245)
        at org.apache.xml.resolver.Catalog.parseCatalog(Catalog.java:681)
        at groovyx.net.http.ParserRegistry.<clinit>(ParserRegistry.java:116)
        at groovyx.net.http.HTTPBuilder.<init>(HTTPBuilder.java:194)
        at commAPIcallback$_run_closure4.doCall(commAPIcallback.groovy:97)
        at commAPIcallback$_run_closure4.doCall(commAPIcallback.groovy)
        at commAPIcallback.run(commAPIcallback.groovy:114)
{code}


> Grape issues
> ------------
>
>                 Key: GROOVY-3583
>                 URL: https://issues.apache.org/jira/browse/GROOVY-3583
>             Project: Groovy
>          Issue Type: Bug
>          Components: Grape
>    Affects Versions: 1.6.3
>         Environment: jdk 1.5-06
> groovy 1.6.3
> WIndows xp
>            Reporter: Keith Hyland
>            Assignee: Paul King
>             Fix For: 1.7-beta-2
>
>
> I have a simple piece of groovy for accessing a (oracle) DB.
> The code works fine once I include the jdbc jar in my $GROOVY_HOME/lib folder.
> However I would like to use grape to dynamically manage dependencies so I 
> changed the code to below.
> {code}
> import groovy.grape.Grape
> Grape.grab(group:'oracle', module:'ojdbc14', version:'10.1.0.4.0' )
> import groovy.sql.Sql
> import java.sql.Time
> def db = Sql.newInstance("jdbc:oracle:thin:@flagtest.intmet.ie:1525:BEAM", 
> "user", "password", 
>               "oracle.jdbc.driver.OracleDriver")
> {code}
> This results in 
> {code}
> Caught: java.sql.SQLException: No suitable driver
>         at t2.run(t2.groovy:8)
> {code}
> If I add the following import after the Grape.grab 
> {code}
> import oracle.jdbc.driver.OracleDriver
> {code}
> I get the following
> {code}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed,
> C:\dev\t2.groovy: 4: unable to resolve class oracle.jdbc.driver.OracleDriver
>  @ line 4, column 1.
>    import oracle.jdbc.driver.OracleDriver;
>    ^
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to