JDK-8328273 : sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java failed with java.rmi.server.ExportException: Port already in use
  • Type: Bug
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 23
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86_64,aarch64
  • Submitted: 2024-03-15
  • Updated: 2024-08-20
  • Resolved: 2024-04-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 17 JDK 21 JDK 23
11.0.25-oracleFixed 17.0.13-oracleFixed 21.0.5-oracleFixed 23 b17Fixed
Related Reports
Relates :  
Relates :  
Description
The following test failed in the JDK23 CI:

sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java

Here's a snippet from the log file:

-------------------------------------------------------------
RmiRegistrySslTest : SSL RMIRegistry - SSL Lookup
-------------------------------------------------------------
Command line: [/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk-23+14-1075/macosx-x64-debug.jdk/jdk-23/fastdebug/bin/java -cp /System/Volumes/Data/mesos/work_dir/slaves/412fde1c-3e26-4c3d-b41e-bab008e2c85d-S19820/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/79adae84-f9d6-4f84-9106-c435e0e2aaaf/runs/1c966f1e-96a3-4f3d-a831-16830017d7d8/testoutput/test-support/jtreg_open_test_jdk_jdk_management/classes/0/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.d:/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk-23+14-1075/src.full/open/test/jdk/sun/management/jmxremote/bootstrap:/System/Volumes/Data/mesos/work_dir/slaves/412fde1c-3e26-4c3d-b41e-bab008e2c85d-S19820/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/79adae84-f9d6-4f84-9106-c435e0e2aaaf/runs/1c966f1e-96a3-4f3d-a831-16830017d7d8/testoutput/test-support/jtreg_open_test_jdk_jdk_management/classes/0/test/lib:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/7.3.1/1/bundles/jtreg-7.3.1+1.zip/jtreg/lib/jtreg.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/7.3.1/1/bundles/jtreg-7.3.1+1.zip/jtreg/lib/junit-platform-console-standalone-1.9.2.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/7.3.1/1/bundles/jtreg-7.3.1+1.zip/jtreg/lib/testng-7.3.0.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/7.3.1/1/bundles/jtreg-7.3.1+1.zip/jtreg/lib/jcommander-1.82.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/7.3.1/1/bundles/jtreg-7.3.1+1.zip/jtreg/lib/guice-5.1.0.jar -Xmx768m -XX:MaxRAMPercentage=4.16667 -Dtest.boot.jdk=/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk/21/35/bundles/macos-x64/jdk-21_macos-x64_bin.tar.gz/jdk-21.jdk/Contents/Home -Djava.io.tmpdir=/System/Volumes/Data/mesos/work_dir/slaves/412fde1c-3e26-4c3d-b41e-bab008e2c85d-S19820/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/79adae84-f9d6-4f84-9106-c435e0e2aaaf/runs/1c966f1e-96a3-4f3d-a831-16830017d7d8/testoutput/test-support/jtreg_open_test_jdk_jdk_management/tmp -ea -esa -XX:+UseZGC -Xmx768m -XX:MaxRAMPercentage=4.16667 -Dtest.boot.jdk=/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk/21/35/bundles/macos-x64/jdk-21_macos-x64_bin.tar.gz/jdk-21.jdk/Contents/Home -Djava.io.tmpdir=/System/Volumes/Data/mesos/work_dir/slaves/412fde1c-3e26-4c3d-b41e-bab008e2c85d-S19820/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/79adae84-f9d6-4f84-9106-c435e0e2aaaf/runs/1c966f1e-96a3-4f3d-a831-16830017d7d8/testoutput/test-support/jtreg_open_test_jdk_jdk_management/tmp -ea -esa -XX:+UseZGC -Dtest.src=/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk-23+14-1075/src.full/open/test/jdk/sun/management/jmxremote/bootstrap -Dtest.rmi.port=53106 -DtestID=Test3 -Djavax.net.ssl.keyStore=/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk-23+14-1075/src.full/open/test/jdk/sun/management/jmxremote/bootstrap/ssl/keystore -Djavax.net.ssl.keyStorePassword=password -Djavax.net.ssl.trustStore=/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk-23+14-1075/src.full/open/test/jdk/sun/management/jmxremote/bootstrap/ssl/truststore -Djavax.net.ssl.trustStorePassword=trustword -Dcom.sun.management.config.file=/System/Volumes/Data/mesos/work_dir/slaves/412fde1c-3e26-4c3d-b41e-bab008e2c85d-S19820/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/79adae84-f9d6-4f84-9106-c435e0e2aaaf/runs/1c966f1e-96a3-4f3d-a831-16830017d7d8/testoutput/test-support/jtreg_open_test_jdk_jdk_management/classes/0/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.d/lib/rmiregistryssl.properties -cp /System/Volumes/Data/mesos/work_dir/slaves/412fde1c-3e26-4c3d-b41e-bab008e2c85d-S19820/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/79adae84-f9d6-4f84-9106-c435e0e2aaaf/runs/1c966f1e-96a3-4f3d-a831-16830017d7d8/testoutput/test-support/jtreg_open_test_jdk_jdk_management/classes/0/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.d:/System/Volumes/Data/mesos/work_dir/slaves/412fde1c-3e26-4c3d-b41e-bab008e2c85d-S19820/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/79adae84-f9d6-4f84-9106-c435e0e2aaaf/runs/1c966f1e-96a3-4f3d-a831-16830017d7d8/testoutput/test-support/jtreg_open_test_jdk_jdk_management/classes/0/test/lib RmiRegistrySslTestApp ]
[2024-03-15T02:20:25.329590Z] Gathering output for process 52124
[2024-03-15T02:20:25.330159Z] Waiting for completion for process 52124
[2024-03-15T02:20:30.042580Z] Waiting for completion finished for process 52124
Output and diagnostic info for process 52124 was saved into 'pid-52124-output.log'
test output:
Error: Exception thrown by the agent: java.rmi.server.ExportException: Port already in use: 53106; nested exception is: 
	java.net.BindException: Address already in use
jdk.internal.agent.AgentConfigurationError: java.rmi.server.ExportException: Port already in use: 53106; nested exception is: 
	java.net.BindException: Address already in use
	at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap.startRemoteConnectorServer(ConnectorBootstrap.java:491)
	at jdk.management.agent/jdk.internal.agent.Agent.startAgent(Agent.java:447)
	at jdk.management.agent/jdk.internal.agent.Agent.startAgent(Agent.java:603)
Caused by: java.rmi.server.ExportException: Port already in use: 53106; nested exception is: 
	java.net.BindException: Address already in use
	at java.rmi/sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:356)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:251)
	at java.rmi/sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:415)
	at java.rmi/sun.rmi.transport.LiveRef.exportObject(LiveRef.java:147)
	at java.rmi/sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:235)
	at java.rmi/sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:223)
	at java.rmi/sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:182)
	at jdk.management.agent/sun.management.jmxremote.SingleEntryRegistry.<init>(SingleEntryRegistry.java:60)
	at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap.exportMBeanServer(ConnectorBootstrap.java:849)
	at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap.startRemoteConnectorServer(ConnectorBootstrap.java:479)
	... 2 more
Caused by: java.net.BindException: Address already in use
	at java.base/sun.nio.ch.Net.bind0(Native Method)
	at java.base/sun.nio.ch.Net.bind(Net.java:565)
	at java.base/sun.nio.ch.Net.bind(Net.java:554)
	at java.base/sun.nio.ch.NioSocketImpl.bind(NioSocketImpl.java:636)
	at java.base/java.net.ServerSocket.bind(ServerSocket.java:391)
	at java.base/java.net.ServerSocket.<init>(ServerSocket.java:278)
	at java.base/java.net.ServerSocket.<init>(ServerSocket.java:170)
	at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap$SslServerSocket.<init>(ConnectorBootstrap.java:1012)
	at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap$HostAwareSslSocketFactory.createServerSocket(ConnectorBootstrap.java:960)
	at java.rmi/sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:672)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:344)
	... 11 more

----------System.err:(11/567)----------
java.lang.Error: 1 test(s) failed
	at RmiRegistrySslTest.runTest(RmiRegistrySslTest.java:128)
	at RmiRegistrySslTest.main(RmiRegistrySslTest.java:209)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333)
	at java.base/java.lang.Thread.run(Thread.java:1575)

JavaTest Message: Test threw exception: java.lang.Error
JavaTest Message: shutting down test

result: Failed. Execution failed: `main' threw exception: java.lang.Error: 1 test(s) failed
Comments
Fix request [11u] I backport this for parity with 11.0.25-oracle. No risk, only tests change. Clean backport. Test pass. SAP nightly testing passed.
17-07-2024

Fix request [17u] I backport this for parity with 17.0.13-oracle. No risk, only tests change. Clean backport. Test pass. SAP nightly testing passed.
17-07-2024

Fix request [21u] I backport this for parity with 21.0.5-oracle. No risk, only a test change. Clean backport. Test pass. SAP nightly testing passed.
17-07-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk11u-dev/pull/2857 Date: 2024-07-16 06:30:27 +0000
16-07-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk17u-dev/pull/2714 Date: 2024-07-16 06:30:19 +0000
16-07-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk21u-dev/pull/844 Date: 2024-07-16 06:30:08 +0000
16-07-2024

Changeset: a85c8493 Author: Jaikiran Pai <jpai@openjdk.org> Date: 2024-04-02 01:14:35 +0000 URL: https://git.openjdk.org/jdk/commit/a85c8493aec73e81c000ea3e3d983b05706bbfec
02-04-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/18561 Date: 2024-04-01 02:02:40 +0000
01-04-2024