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

Georg Kallidis commented on TORQUE-361:
---------------------------------------

Thanks for providing this bug report!

Could you tell us about the gradle version? It might be an incorrect setting 
there.

Nevertheless it might be the case, when the default constructor Groovy 3 is 
fetching the classpath from  GroovyShell.class.getClassLoader(), it might be 
already statically set previously and thus not always the correct loader.

We have to do some more tests to be sure this will be in other cases the proper 
setting or we might want to make it configurable.

I am not sure, how your Torque settings are, but are you aware of, that 
UnitDescriptor (org.apache.torque.generator.configuration.UnitDescriptor) has a 
method 
[setClassLoader|https://db.apache.org/torque/torque-5.1/documentation/modules/generator/reports/apidocs/org/apache/torque/generator/configuration/UnitDescriptor.html#setClassLoader(java.lang.ClassLoader)].

(as well as the class UnitConfiguration.setClassLoader)

Could you check if you are using one of those classes and changing it there 
does not help?

Thanks for the feedback!

> 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-unsubscr...@db.apache.org
For additional commands, e-mail: torque-dev-h...@db.apache.org

Reply via email to