corda / corda-gradle-plugins

Gradle plugins used by Corda and Cordapps
Other
24 stars 36 forks source link

./gradlew deployNodes: java.lang.StackOverflowError (no error message) #495

Closed ghost closed 2 years ago

ghost commented 2 years ago

Expected Behavior

Actual Behavior

Specifications

Context

My task was originally working fine, but then I started to see the above error when I added a new dependency (no code changes). The dependency was a custom library for producing Red Hat AMQ messages and has the following child dependencies:

      org.springframework.boot:spring-boot-starter-web:2.2.0.RELEASE
      org.apache.activemq:artemis-jms-client:2.10.1 (*)
      org.springframework:spring-jms:2.5
      javax.json:javax.json-api:1.0

Any idea whats going on here?

Update 1: The cordapp jar builds fine. It's only the deployNodes task that fails.

chrisr3 commented 2 years ago

The last time I saw errors like that it was because Gradle was using an incompatible version of the JVM. Which version of the JVM are you deploying Corda with? The Quasar Java agent used by Corda is sensitive to this:

ghost commented 2 years ago

I’ve tried with both 8 and 11. Both are failing with the same error

gradlew.bat --version


Gradle 5.6.4


Build time: 2019-11-01 20:42:00 UTC

Revision: dd870424f9bd8e195d614dc14bb140f43c22da98

Kotlin: 1.3.41

Groovy: 2.5.4

Ant: Apache Ant(TM) version 1.9.14 compiled on March 12 2019

JVM: 11.0.11 (Oracle Corporation 11.0.11+9-LTS-194)

OS: Windows 10 10.0 amd64

./gradlew --version


Gradle 5.6.4


Build time: 2019-11-01 20:42:00 UTC

Revision: dd870424f9bd8e195d614dc14bb140f43c22da98

Kotlin: 1.3.41

Groovy: 2.5.4

Ant: Apache Ant(TM) version 1.9.14 compiled on March 12 2019

JVM: 1.8.0_211 (Oracle Corporation 25.211-b12)

OS: Linux 3.10.0-1160.53.1.el7.x86_64 amd64

chrisr3 commented 2 years ago
gradlePluginsVersion=5.0.12
quasarVersion=0.7.10

Are you really using Quasar 0.7.10? You should be using 0.7.13_r3 with Corda 4.8.5. The latest Corda Gradle plugins version is 5.0.15 as well.

ghost commented 2 years ago

I debugged the task in IntelliJ and found that the following if statement evaluated to true.

            private LoggerContext validateContext(final LoggerContext context) {

                    if (TO_SLF4J_CONTEXT.equals(context.getClass().getName())) {

                            throw new LoggingException("log4j-slf4j-impl cannot be present with log4j-to-slf4j");

                    }

                    return context;

            }

The solution was to add this exclusion in the build.gradle

            configurations {

                    all {

                            exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'

                    }

            }

The deployNodes task runs okay now. I think we can close this issue. Thanks for the help!

chrisr3 commented 2 years ago

I'm glad you've resolved this, but you also really need to upgrade quasarVersion from 0.7.10 to 0.7.13_r3 because otherwise you've missing some important changes.

ghost commented 2 years ago

Yes, I did update all the dependencies to the latest. Issue was still there and then I found the above error.