apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.69k stars 853 forks source link

GradleConnectionException when using Run File on a Gradle project while another Gradle project is running #5485

Open swpalmer opened 1 year ago

swpalmer commented 1 year ago

Apache NetBeans version

Apache NetBeans 17 release candidate

What happened

I attempted to run a File in another Gradle project by right-clicking on the file and selecting "Run File", I did this while I had another Gradle-based project running via the Run button on the toolbar.

The output window for the "Run File" action only showed:

JAVA_HOME="/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home" cd /Users/scott/dev/Personal/LeetCode; /Users/scott/dev/gradle/bin/gradle --configure-on-demand -PrunClassName=s1524_sub_arrays_with_odd_sum.Solution -s -x check runSingle

and the file did not run. An icon in the NB status bar indicated there was an issue.

A org.gradle.tooling.GradleConnectionException has occurred. If you are running the latest version of NetBeans you can report this, including a copy of your messages.log file as an attachment. The messages.log file is located in this folder.

I am using Gradle 8.0-rc-5 with NetBeans 17rc3 on JDK 17.

How to reproduce

Run one Gradle-based project and while it is still running, choose "Run File" from the context menu of a file in another Gradle-based project.

Did this work correctly in an earlier version?

No / Don't know

Operating System

macOS 13.2

JDK

OpenJDK 17.0.6

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

messages.log

Are you willing to submit a pull request?

Yes

Code of Conduct

Yes

lkishalmi commented 1 year ago

Does this happen with Gradle before 8.0-rc-5? I'd check 8.0-rc-1 and 7.6 or 7.5.

Right now projects are reusing Gradle connections. Maybe that became an anti pattern.

neilcsmith-net commented 1 year ago

I had a quick try at reproducing this yesterday and couldn't. @lkishalmi ?

Incidentally, I did notice Gradle 8.0 is now out.