You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by "Max Philipp Wriedt (Jira)" <ji...@apache.org> on 2023/03/02 17:22:00 UTC

[jira] [Comment Edited] (TORQUE-361) Groovy can't resolve import from ddl scripts

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

Max Philipp Wriedt edited comment on TORQUE-361 at 3/2/23 5:21 PM:
-------------------------------------------------------------------

I am currently developing a gradle plugin for torque generation. The gradle version is 8.0.1
https://git.rehost.eu/rehost/gradle-torque

I am using the code from „Running the generator“ converted to Kotlin.

When printing the classpath from systemproperties I only get the gradle-launcher.jar. When printing the classpath from contextClassLoader() I get the full and correct classpath.

I tried setting the classloader as you described. In my case the GroovyShell wasn‘t using it and stayed on the wrong systemproperty class.path.
The TorqueGenerator itself used the UnitDescriptor.classLoader (tested with removing the templates, which couldn‘t be found after removing from URLClassPath)


was (Author: JIRAUSER299058):
I am currently developing a gradle plugin for torque generation. The gradle version is 8.0.1
https://git.rehost.eu/rehost/gradle-torque

I am using the code from „Running the generator“ converted to Kotlin.

When printing the classpath from systemproperties I only get the gradle-launcher.jar. When printing the classpath from contextClassLoader() I get the full and correct classpath.

I tried setting the classloader as u described. In my case the GroovyShell wasn‘t using it and stayed on the wrong systemproperty class.path.
The TorqueGenerator itself used the UnitDescriptor.classLoader (tested with removing the templates, which couldn‘t be found after removing from URLClassPath)

> Groovy can't resolve import from ddl scripts
> --------------------------------------------
>
>                 Key: TORQUE-361
>                 URL: https://issues.apache.org/jira/browse/TORQUE-361
>             Project: Torque
>          Issue Type: Bug
>          Components: Generator
>    Affects Versions: 5.0, 5.1
>            Reporter: Max Philipp Wriedt
>            Priority: Major
>              Labels: groovy
>
> The GroovyShell invoked at GroovyScriptOutlet.java:42 doesn't get a classpath, if i try to start it from a gradle instance. (the generator is invoked inside a kotlin.class)
> {code:java}
> Error executing template torque.sql.ddl.database
> org.apache.torque.generator.GeneratorException: Error executing template torque.sql.ddl.database
> Caused by: org.apache.torque.generator.GeneratorException: Error executing groovy script torque.sql.ddl.database
> Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
> Script1.groovy: 17: unable to resolve class org.apache.torque.generator.template.groovy.TorqueGenGroovy
>  @ line 17, column 1.
>    import org.apache.torque.generator.template.groovy.TorqueGenGroovy
>    ^{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org