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

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

{code}
$ groovy groovy3583-1.groovy
[/Users/jianpingroth/.groovy/grapes/org.codehaus.groovy.modules.http-builder/http-builder/jars/http-builder-0.7.jar,
 
/Users/jianpingroth/.groovy/grapes/org.apache.httpcomponents/httpclient/jars/httpclient-4.2.1.jar,
 
/Users/jianpingroth/.groovy/grapes/org.apache.httpcomponents/httpcore/jars/httpcore-4.2.1.jar,
 
/Users/jianpingroth/.groovy/grapes/commons-logging/commons-logging/jars/commons-logging-1.1.1.jar,
 
/Users/jianpingroth/.groovy/grapes/commons-codec/commons-codec/jars/commons-codec-1.6.jar,
 
/Users/jianpingroth/.groovy/grapes/net.sf.json-lib/json-lib/jars/json-lib-2.3-jdk15.jar,
 
/Users/jianpingroth/.groovy/grapes/commons-beanutils/commons-beanutils/jars/commons-beanutils-1.8.0.jar,
 
/Users/jianpingroth/.groovy/grapes/commons-collections/commons-collections/jars/commons-collections-3.2.1.jar,
 
/Users/jianpingroth/.groovy/grapes/commons-lang/commons-lang/jars/commons-lang-2.4.jar,
 
/Users/jianpingroth/.groovy/grapes/net.sf.ezmorph/ezmorph/jars/ezmorph-1.0.6.jar,
 
/Users/jianpingroth/.groovy/grapes/net.sourceforge.nekohtml/nekohtml/jars/nekohtml-1.9.16.jar,
 
/Users/jianpingroth/.groovy/grapes/xerces/xercesImpl/jars/xercesImpl-2.9.1.jar, 
/Users/jianpingroth/.groovy/grapes/xml-apis/xml-apis/jars/xml-apis-1.3.04.jar, 
/Users/jianpingroth/.groovy/grapes/xml-resolver/xml-resolver/jars/xml-resolver-1.2.jar]
------------
[file:/Users/jianpingroth/workspace/xmatters/cns-migrator/./, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/ant-1.9.4.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/ant-antlr-1.9.4.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/ant-junit-1.9.4.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/ant-launcher-1.9.4.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/bsf-2.4.0.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/commons-cli-1.2.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/commons-logging-1.2.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/gpars-1.2.1.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/groovy-2.4.3.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/groovy-ant-2.4.3.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/groovy-bsf-2.4.3.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/groovy-console-2.4.3.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/groovy-docgenerator-2.4.3.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/groovy-groovydoc-2.4.3.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/groovy-groovysh-2.4.3.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/groovy-jmx-2.4.3.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/groovy-json-2.4.3.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/groovy-jsr223-2.4.3.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/groovy-nio-2.4.3.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/groovy-servlet-2.4.3.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/groovy-sql-2.4.3.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/groovy-swing-2.4.3.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/groovy-templates-2.4.3.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/groovy-test-2.4.3.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/groovy-testng-2.4.3.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/groovy-xml-2.4.3.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/hamcrest-core-1.3.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/ivy-2.4.0.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/jansi-1.11.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/jcommander-1.47.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/jline-2.12.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/jsp-api-2.0.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/jsr166y-1.7.0.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/junit-4.12.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/multiverse-core-0.7.0.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/openbeans-1.0.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/qdox-1.12.1.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/servlet-api-2.4.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/testng-6.8.13.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/xmlpull-1.1.3.1.jar, 
file:/usr/local/Cellar/groovy/2.4.3/libexec/lib/xstream-1.4.7.jar, 
file:/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/lib/tools.jar,
 
file:/Users/jianpingroth/.groovy/grapes/org.codehaus.groovy.modules.http-builder/http-builder/jars/http-builder-0.7.jar,
 
file:/Users/jianpingroth/.groovy/grapes/org.apache.httpcomponents/httpclient/jars/httpclient-4.2.1.jar,
 
file:/Users/jianpingroth/.groovy/grapes/org.apache.httpcomponents/httpcore/jars/httpcore-4.2.1.jar,
 
file:/Users/jianpingroth/.groovy/grapes/commons-logging/commons-logging/jars/commons-logging-1.1.1.jar,
 
file:/Users/jianpingroth/.groovy/grapes/commons-codec/commons-codec/jars/commons-codec-1.6.jar,
 
file:/Users/jianpingroth/.groovy/grapes/net.sf.json-lib/json-lib/jars/json-lib-2.3-jdk15.jar,
 
file:/Users/jianpingroth/.groovy/grapes/commons-beanutils/commons-beanutils/jars/commons-beanutils-1.8.0.jar,
 
file:/Users/jianpingroth/.groovy/grapes/commons-collections/commons-collections/jars/commons-collections-3.2.1.jar,
 
file:/Users/jianpingroth/.groovy/grapes/commons-lang/commons-lang/jars/commons-lang-2.4.jar,
 
file:/Users/jianpingroth/.groovy/grapes/net.sf.ezmorph/ezmorph/jars/ezmorph-1.0.6.jar,
 
file:/Users/jianpingroth/.groovy/grapes/net.sourceforge.nekohtml/nekohtml/jars/nekohtml-1.9.16.jar,
 
file:/Users/jianpingroth/.groovy/grapes/xerces/xercesImpl/jars/xercesImpl-2.9.1.jar,
 
file:/Users/jianpingroth/.groovy/grapes/xml-apis/xml-apis/jars/xml-apis-1.3.04.jar,
 
file:/Users/jianpingroth/.groovy/grapes/xml-resolver/xml-resolver/jars/xml-resolver-1.2.jar]
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:185)
        at groovy3583-1.run(groovy3583-1.groovy:9)
{code}

script
{code}
@GrabConfig(systemClassLoader=true)
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', 
version='0.7' )
import java.lang.Object

println getClass().classLoader.classPath
println '------------'
println getClass().classLoader.rootLoader.URLs

def http = new groovyx.net.http.HTTPBuilder('http://www.codehaus.org')
println http
{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