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

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

excludoing xml-apis:xml-apis worked:

{code}
@Grapes([
        @GrabConfig(systemClassLoader=true),
        @Grab('org.postgresql:postgresql:9.4.1207'),
        @Grab('org.codehaus.groovy.modules.http-builder:http-builder:0.7.1'),
        @GrabExclude('xml-apis:xml-apis')
])
{code}

Thank you for your help!

> 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