Details
-
Bug
-
Resolution: Fixed
-
P4
-
11, 17
-
Intel(R) Xeon(R) Platinum 8260 CPU 2.4GHz, 2 core, 8GB Memory
Windows 10 Enterprise
-
b05
-
generic
-
generic
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8316717 | 11.0.22 | Kimura Yukihiro | P4 | Resolved | Fixed | b01 |
Description
On English Windows environment, jcmd prints "Invalid agent state" as RuntimeException message if ManagementAgent.start is executed twice.
But the message is corrupted on Japanese Windows environment.
English Windows environment:
jcmd Test ManagementAgent.start jmxremote.port=50082 jmxremote.authenticate=false jmxremote.ssl=false
16942:
java.lang.RuntimeException: Invalid agent state: Agent already started
Japanese Windows environment:
jcmd Test ManagementAgent.start jmxremote.port=50082 jmxremote.authenticate=false jmxremote.ssl=false
7368:
java.lang.RuntimeException: 繧ィ繝シ繧ク繧ァ繝ウ繝医?ョ迥カ諷九′辟。蜉ケ縺ァ縺?: Agent already started
The java process throws RuntimeException at jdk.management.agent/jdk.internal.agent.Agent.startRemoteManagementAgent(Agent.java:340).
throw new RuntimeException(getText(INVALID_STATE, "Agent already started"));
The japanese exception message is defined in ./jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_ja.properties
with utf8 charset, and it is built in jdk/internal/agent/resources/agent_ja.class.
agent.err.invalid.state = \u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u306E\u72B6\u614B\u304C\u7121\u52B9\u3067\u3059: {0}
On the other hand,
the jcmd reads the message at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.readErrorMessage(HotSpotVirtualMachine.java:360).
BufferedReader br = new BufferedReader(new InputStreamReader(in));
while ((s = br.readLine()) != null) {
The message is read without specifying a charset and the default charset is not utf8.
This is the reason why the exception message of jcmd ManagementAgent.start is corrupted in Japanese Windows.
This does not occur since jdk18 owing to JEP 400: UTF-8 by Default.
But the message is corrupted on Japanese Windows environment.
English Windows environment:
jcmd Test ManagementAgent.start jmxremote.port=50082 jmxremote.authenticate=false jmxremote.ssl=false
16942:
java.lang.RuntimeException: Invalid agent state: Agent already started
Japanese Windows environment:
jcmd Test ManagementAgent.start jmxremote.port=50082 jmxremote.authenticate=false jmxremote.ssl=false
7368:
java.lang.RuntimeException: 繧ィ繝シ繧ク繧ァ繝ウ繝医?ョ迥カ諷九′辟。蜉ケ縺ァ縺?: Agent already started
The java process throws RuntimeException at jdk.management.agent/jdk.internal.agent.Agent.startRemoteManagementAgent(Agent.java:340).
throw new RuntimeException(getText(INVALID_STATE, "Agent already started"));
The japanese exception message is defined in ./jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_ja.properties
with utf8 charset, and it is built in jdk/internal/agent/resources/agent_ja.class.
agent.err.invalid.state = \u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u306E\u72B6\u614B\u304C\u7121\u52B9\u3067\u3059: {0}
On the other hand,
the jcmd reads the message at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.readErrorMessage(HotSpotVirtualMachine.java:360).
BufferedReader br = new BufferedReader(new InputStreamReader(in));
while ((s = br.readLine()) != null) {
The message is read without specifying a charset and the default charset is not utf8.
This is the reason why the exception message of jcmd ManagementAgent.start is corrupted in Japanese Windows.
This does not occur since jdk18 owing to JEP 400: UTF-8 by Default.
Attachments
Issue Links
- backported by
-
JDK-8316717 The exception messages printed by jcmd ManagementAgent.start are corrupted on Japanese Windows
- Resolved