You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "jianping roth (JIRA)" <ji...@apache.org> on 2016/02/29 23:52:18 UTC

[jira] [Comment Edited] (GROOVY-3583) Grape issues

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

jianping roth edited comment on GROOVY-3583 at 2/29/16 10:51 PM:
-----------------------------------------------------------------

Hi Paul,

Here below is the version information. I am glad that you didn't see the problem. 
{code}
$ java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

$ groovy -version
Groovy Version: 2.4.3 JVM: 1.8.0_45 Vendor: Oracle Corporation OS: Mac OS X
{code}

I have reduced the code to the following for me to reproduce the issue

{code}
@Grab('org.postgresql:postgresql:9.4.1207')
@GrabConfig(systemClassLoader=true)
@Grab('org.codehaus.groovy.modules.http-builder:http-builder:0.7.1')
import java.lang.Object
new groovyx.net.http.HTTPBuilder("http://jsonplaceholder.typicode.com")
println("test")
{code}

My @grabs do represent the whole classpath. 



was (Author: jianping.roth):
Hi Paul,

Here below is the version information. I am glad that you didn't see the problem. 
{code}
$ java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

$ groovy -version
Groovy Version: 2.4.3 JVM: 1.8.0_45 Vendor: Oracle Corporation OS: Mac OS X
{code}

I have reduced the code to the following for me to reproduce the issue

{code}
@Grab('org.postgresql:postgresql:9.4.1207')
@GrabConfig(systemClassLoader=true)
@Grab('org.codehaus.groovy.modules.http-builder:http-builder:0.7.1')
import groovy.sql.Sql
import groovyx.net.http.HTTPBuilder

Sql.newInstance("jdbc:postgresql://localhost:5432/testdb", 'testdb', 'testdb', 'org.postgresql.Driver')
new HTTPBuilder("http://jsonplaceholder.typicode.com")

{code}

My @grabs do represent the 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)