app-web-toolkit:buildWidgetSet FAILED with email Templates 1.4.2

Hi,

I have actual Cuba plugin and using version 7.2.20…
Use Coretto java 11 on Windows…
When I add the email template from the marketplace I get an error, building the war file.
Remove the email template, everything is fine.
Adding the email templage, error occurs…

PS F:\data\java_projects\gradletest> ./gradlew buildWar

Task :app-web-toolkit:buildWidgetSet FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app-web-toolkit:buildWidgetSet’.

A problem occurred starting process ‘command ‘F:\Java\openjdk-11.0.19\bin\java.exe’’

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use ‘–warning-mode all’ to show the individual deprecation warnings.
See Command-Line Interface
19 actionable tasks: 19 executed
PS F:\data\java_projects\gradletest> ./gradlew --refresh-dependencies clean assemble

Task :app-web-toolkit:buildWidgetSet FAILED

FAILURE: Build failed with an exception.
Use ‘–warning-mode all’ to show the individual deprecation warnings.
See Command-Line Interface

BUILD FAILED in 33s
24 actionable tasks: 24 executed

Next test with a blank new cuba app… only adding the email template… same error

and a new test, this time using version 7.2.19 with email template addon 1.4.2
now it works…

so, looks like there is something strange when using cuba version 7.2.20 together with the email template 1.4.2

Hello Roland!

I’ve reproduced the problem. The stacktrace from terminal says:

java.io.IOException: CreateProcess error=206 The filename or extension is too long

Just add shortClassPath = true to buildWidgetSet task in your build.gradle file:

configure(webToolkitModule) {
    // ..

    task buildWidgetSet(type: CubaWidgetSetBuilding) {
        shortClassPath = true
        widgetSetClass = 'com.company.trtemplate.web.toolkit.ui.AppWidgetSet'
    }

   // ...
}
1 Like

thx, that helped one on developer machine.
but on the other where I am working I am see this now:

Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

Exception java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache [in thread “Daemon worker”]

I have the same JDK on both machines,
use https://services.gradle.org/distributions/gradle-5.6.4-bin.zip on both,
have the project structure JDK set to that JDK on both machines,
have the Gradle JVM setting to use the Project JDK on both machines…

The only difference I see is, that the machine with the error has another Java_Home setting to
openjdk_17, which I cannot change.

I also tried ./gradlew -Dorg.gradle.java.home=/path_to_jdk_directory and pointed to the same JDK… but it looks like gradle is only listening to the system variable JAVA_HOME, which is the wrong one

any idea how to handle that?

got it:
tasks.withType(JavaCompile).configureEach {
//enable compilation in a separate daemon process
options.forkOptions.executable = ‘D:/Java/openjdk-11.0.19/bin/javac.exe’
options.fork = true
}

that works fine