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

Paul King commented on GROOVY-3583:
-----------------------------------

What versions of Java and Groovy are you using? Do you have a complete 
standalone script demonstrating the problem? I tried the above with a little 
bit of http builder code and it worked fine for me using the master branch and 
Java 1.8. Perhaps you are using different versions or your invoking different 
classes. I'd guess that you might be on an older version that needs a 
GrabExclude in place or the Grab's don't represent your whole classpath?

> 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