You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2016/03/01 06:06:18 UTC

[jira] [Commented] (GROOVY-3583) Grape issues

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

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

That code seems to work for me. Can you add this to your script:
{code}
println getClass().classLoader.classPath
{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)