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

2023-04-04 Thread Max Philipp Wriedt (Jira)


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

Max Philipp Wriedt commented on TORQUE-361:
---

I have just realized, that you put that code inside the subversion.
I finally got to test it and can confirm it works fine in my use case.
 
the gradle plugin is still in development and requires some refactoring 
regarding the configuration, so I consider it "early alpha".
I will continue working on it soon.

> 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



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

2023-03-08 Thread Georg Kallidis (Jira)


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

Georg Kallidis commented on TORQUE-361:
---

thanks for mentioning this! - Torque 5.1 Templates 
[Downloads|https://db.apache.org/torque/torque-5.1/download.html] and Jira 
Release Status are fixed now.

Also, I would encourage you, if you might want to share some code (as soon you 
think, of course).  As your code is gradle based this might become an 
integrated tool instead of the [ant 
tasks|https://db.apache.org/torque/torque-5.1/documentation/modules/ant-tasks/reference/index.html]
 (or the 
[maven-plugin)|https://db.apache.org/torque/torque-4.0/documentation/modules/maven-plugin/reference/index.html]?

> 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



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

2023-03-08 Thread Max Philipp Wriedt (Jira)


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

Max Philipp Wriedt commented on TORQUE-361:
---

I will test this in the near future. Hadn't found the time for it by now.

But a question in between (maybe a little off-topic:
Inside Jira version 5.1 is defined as "unreleased". In 
[Downloads|https://db.apache.org/torque/torque-5.1/download.html] it is 
released.

There is also an issue with the 5.1 templates download.

> 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



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

2023-03-03 Thread Georg Kallidis (Jira)


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

Georg Kallidis commented on TORQUE-361:
---

ok, it seems to me worth considering to change the code that the already 
configured classpath in UnitDescriptor might be used?

What if we initialize GroovyShell lazily, not statically using singleton 
pattern?

Pseudocode (in org.apache.torque.generator.template.groovy.GroovyScriptOutlet):
{code:java}
private static volatile GroovyShell groovyShell = null;

GroovyShell getInstance(ClassLoader cl) {
  if (groovyShell == null) {
     // might check also cl == null ?
 groovyShell = new GroovyShell(cl);
  } 
  return groovyShell;
}

executeGroovy(binding, controllerState)
..
gs = getInstance(controllerState.getUnitConfiguration().getClassLoader())
gs.parse ..


{code}
If this is feasible and consistent (the classpath in unit configuration is from 
unit descriptor and is exactly what we want to be used here) then I would ask 
you to try this and share here with us, what you prefer - this or another 
solution.

> 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



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

2023-03-02 Thread Max Philipp Wriedt (Jira)


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

Max Philipp Wriedt commented on TORQUE-361:
---

My fix was to change GroovyScriptOutlet:42 from
{code:java}
private static GroovyShell groovyShell = new GroovyShell(); {code}
to
{code:java}
private static GroovyShell groovyShell = new 
GroovyShell(Thread.currentThread().getContextClassLoader()); {code}
as this invokes the GroovyShell including the ClassLoader given by the 
Kotlin.class which is started by gradle

> 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
>Reporter: Max Philipp Wriedt
>Priority: Major
>
> 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 cl ass 
> 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