OpenLiberty / open-liberty

Open Liberty is a highly composable, fast to start, dynamic application server runtime environment
https://openliberty.io
Eclipse Public License 2.0
1.14k stars 587 forks source link

WARNING for Unknown module jdk.management.agent and jdk.attach when using a Java 17 Semeru JRE #23042

Open tjwatson opened 1 year ago

tjwatson commented 1 year ago

Steps to reproduce: Use podman or docker and run this:

podman run -it open-liberty:full-java17-openj9 server run

WARNING: Unknown module: jdk.management.agent specified to --add-exports
WARNING: Unknown module: jdk.attach specified to --add-exports
Launching defaultServer (Open Liberty 22.0.0.10/wlp-1.0.69.cl221020220912-1100) on Eclipse OpenJ9 VM, version 17.0.4.1+1 (en_US)
tjwatson commented 1 year ago

If you run locally with Semeru JRE 17 the same issue happens. If you use the JDK then you don't see this issue. To make things more confusing, the Liberty UBI based images are using the JDK, so they do not see this error:

podman run -it icr.io/appcafe/open-liberty:full-java17-openj9-ubi server run

Launching defaultServer (Open Liberty 22.0.0.10/wlp-1.0.69.cl221020220912-1100) on Eclipse OpenJ9 VM, version 17.0.4.1+1 (en_US)
tjwatson commented 1 year ago

Do we really need to open these modules? If so what depends on them? What is broken when running on the JRE that doesn't have them?

jhanders34 commented 1 year ago

This would be a duplicate of https://github.com/OpenLiberty/open-liberty/issues/20135.

jhanders34 commented 1 year ago

To answer your question, attach is used for localConnector-1.0

tjwatson commented 1 year ago

Is localConnector-1.0 broken for all our ubuntu based images that use a JRE?

fmhwong commented 1 year ago

I see the same problem on Docker with JDK 11 and OL 23.0.0.1-beta.

WARNING: Unknown module: jdk.management.agent specified to --add-exports
WARNING: Unknown module: jdk.attach specified to --add-exports
Launching defaultServer (Open Liberty 23.0.0.1-beta/wlp-1.0.72.cl221320221205-1900) on Eclipse OpenJ9 VM, version 11.0.17+8 (en_US)
tjwatson commented 1 year ago

I see the same problem on Docker with JDK 11 and OL 23.0.0.1-beta.

That is because the Java 11 beta images are FROM ibm-semeru-runtimes:open-11-jre-focal the JRE which doesn't have that module. Any of our images that are based on the JRE will see this.

leochr commented 7 months ago

@NottyCode This is also seen with the new Liberty images with Java 21 JRE. Given that it's a known issue with existing images based on JRE, we don't think it should be considered a stop-ship for Java 21 support. Do you agree?

NottyCode commented 7 months ago

@leochr given it is a warning I agree, but I think we need to make sure we have a bug raised against Liberty to address the warnings.

tjwatson commented 7 months ago

@leochr given it is a warning I agree, but I think we need to make sure we have a bug raised against Liberty to address the warnings.

I was hoping that would be this issue here.

prandhir commented 7 months ago

We are also in the same boat where using "ibm-semeru-open-jre_x64_windows_17.0.8.1_1_openj9-0.40.0" and Liberty server 23.0.0.10. So instead of warning , while starting the server with local connector feature , getting class not found exception for class "com.sun.tools.attach.VirtualMachine". was there any work around suggested ?

tjwatson commented 7 months ago

was there any work around suggested ?

If you need local connector then currently you must use the JDK, not the JRE.