Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot re-use daemon with sdkman java 8.0.265.hs-adpt #65

Closed
htr3n opened this issue Sep 15, 2020 · 4 comments · Fixed by #66
Closed

Cannot re-use daemon with sdkman java 8.0.265.hs-adpt #65

htr3n opened this issue Sep 15, 2020 · 4 comments · Fixed by #66
Milestone

Comments

@htr3n
Copy link

htr3n commented Sep 15, 2020

I've just started using mvn and noticed from the logs that, there are incompatible daemons due to the javaHome

$ mvnd --version                                                                                            
Sep 15, 2020 10:23:33 AM org.jline.utils.Log logr
WARNING: Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)
[main] INFO org.jboss.fuse.mvnd.client.DaemonConnector - Idle daemon 23a8041a-705b-48d6-8fd7-4b01b7f49ddf does not match the desired criteria: Java home is different.
Wanted: javaHome=/home/alext/.sdkman/candidates/java/8.0.265.hs-adpt, options=[]
Actual: javaHome=/home/alext/.sdkman/candidates/java/8.0.265.hs-adpt/jre, options=[], mavenHome=/home/alext/.sdkman/candidates/mvnd/0.4.0, pid=153885, address=36049, idleTimeout=10800000, locale=en-US, state=Idle, lastIdle=1600129199872, lastBusy=1600129170749uid=23a8041a-705b-48d6-8fd7-4b01b7f49ddf

[main] INFO org.jboss.fuse.mvnd.client.DaemonConnector - Idle daemon fa3a910f-f224-4242-b56e-98b112f851a3 does not match the desired criteria: Java home is different.
Wanted: javaHome=/home/alext/.sdkman/candidates/java/8.0.265.hs-adpt, options=[]
Actual: javaHome=/home/alext/.sdkman/candidates/java/8.0.265.hs-adpt/jre, options=[], mavenHome=/home/alext/.sdkman/candidates/mvnd/0.4.0, pid=150998, address=33263, idleTimeout=10800000, locale=en-US, state=Idle, lastIdle=1600128961673, lastBusy=1600128960395uid=fa3a910f-f224-4242-b56e-98b112f851a3

[main] INFO org.jboss.fuse.mvnd.client.DaemonConnector - Idle daemon 96a3257f-b375-47eb-bfb8-71273e43f6ac does not match the desired criteria: Java home is different.
Wanted: javaHome=/home/alext/.sdkman/candidates/java/8.0.265.hs-adpt, options=[]
Actual: javaHome=/home/alext/.sdkman/candidates/java/8.0.265.hs-adpt/jre, options=[], mavenHome=/home/alext/.sdkman/candidates/mvnd/0.4.0, pid=151587, address=35369, idleTimeout=10800000, locale=en-US, state=Idle, lastIdle=1600129091986, lastBusy=1600129022672uid=96a3257f-b375-47eb-bfb8-71273e43f6ac

[main] INFO org.jboss.fuse.mvnd.client.DaemonConnector - Idle daemon 1fb27912-2bca-4f46-93cd-c43da854b9e1 does not match the desired criteria: Java home is different.
Wanted: javaHome=/home/alext/.sdkman/candidates/java/8.0.265.hs-adpt, options=[]
Actual: javaHome=/home/alext/.sdkman/candidates/java/8.0.265.hs-adpt/jre, options=[], mavenHome=/home/alext/.sdkman/candidates/mvnd/0.4.0, pid=154243, address=38191, idleTimeout=10800000, locale=en-US, state=Idle, lastIdle=1600129327995, lastBusy=1600129327949uid=1fb27912-2bca-4f46-93cd-c43da854b9e1

[main] INFO org.jboss.fuse.mvnd.client.DaemonConnector - Idle daemon 78630163-9886-48a3-bd22-b58e06bd3ab4 does not match the desired criteria: Java home is different.
Wanted: javaHome=/home/alext/.sdkman/candidates/java/8.0.265.hs-adpt, options=[]
Actual: javaHome=/home/alext/.sdkman/candidates/java/8.0.265.hs-adpt/jre, options=[], mavenHome=/home/alext/.sdkman/candidates/mvnd/0.4.0, pid=154325, address=34881, idleTimeout=10800000, locale=en-US, state=Idle, lastIdle=1600129407112, lastBusy=1600129378438uid=78630163-9886-48a3-bd22-b58e06bd3ab4

[main] INFO org.jboss.fuse.mvnd.common.DaemonRegistry - Removing 0 daemon stop events from registry
[main] INFO org.jboss.fuse.mvnd.client.DaemonConnector - Starting a Maven Daemon, 1 busy and 5 incompatible Daemons could not be reused, use --status for details
Maven Daemon 0.0.4-linux-amd64 (native)
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /home/alext/.sdkman/candidates/mvnd/0.4.0
Java version: 1.8.0_265, vendor: AdoptOpenJDK, runtime: /home/alext/.sdkman/candidates/java/8.0.265.hs-adpt/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-47-generic", arch: "amd64", family: "unix"

It sounds like every time I ran mvnd, there is a new daemon created but incompatible to be reused?

@ppalaga
Copy link
Contributor

ppalaga commented Sep 16, 2020

I was able to reproduce when I had 8.0.265.hs-adpt as sdkman java default.

On the contrary, I was not able reproduce when I had 14.0.2.j9-adpt as a default.

Let me investigate more.

@ppalaga
Copy link
Contributor

ppalaga commented Sep 16, 2020

This seems to be caused by the fact that with 8.0.265.hs-adpt, JAVA_HOME is effectively set to ~/.sdkman/candidates/java/8.0.265.hs-adpt but when running an app through $JAVA_HOME/bin/java System.getProperty("java.home") returns ~/.sdkman/candidates/java/8.0.265.hs-adpt/jre.

mvnd client relies on JAVA_HOME but mvnd server relies on System.getProperty("java.home")

Earlier, we had some code in place that was passing the value of JAVA_HOME to the server, but I removed it as superfluous. Now I know why it was there :)

@ppalaga ppalaga changed the title Incompatible daemon Cannot re-use daemon with sdkman java 8.0.265.hs-adpt Sep 16, 2020
@ppalaga
Copy link
Contributor

ppalaga commented Sep 17, 2020

Fixed via #66

@ppalaga ppalaga closed this as completed Sep 17, 2020
@ppalaga
Copy link
Contributor

ppalaga commented Sep 17, 2020

Fixed in the freshly released version 0.0.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants