I am trying to use Tomcat (v: 9.0.12) with Intellij Idea (v: 2018.3) for deploying an Artifact (A simple hello world javaEE web application project).
This is some of my outputs after Building and Starting the project (I am gonna put these outputs for some useful information. also you can find the FULL outputs at the end of my question) :
"C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\catalina.bat" run [2019-09-07 10:58:59,049] Artifact test:war exploded: Waiting for server connection to start artifact deployment... Using CATALINA_BASE: "C:\Users\pcs\.IntelliJIdea2018.3\system\tomcat\Tomcat_9_0_12_test" Using CATALINA_HOME: "C:\Program Files\Apache Software Foundation\Tomcat 9.0" Using CATALINA_TMPDIR: "C:\Program Files\Apache Software Foundation\Tomcat 9.0\temp" Using JRE_HOME: "C:\Program Files\Java\jdk-10.0.1" Using CLASSPATH: "C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\bootstrap.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\tomcat-juli.jar" Error: Exception thrown by the agent : java.net.MalformedURLException: Service URL contains non-ASCII character 0x6f1
After that I have an error with JMX and if I'll be right it occurs at : "jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap.startRemoteConnectorServer" (ConnectorBootstrap.java:491).
Before asking my question would you please take look at some parts of C:\Program Files\Java\jdk-10.0.1\lib\src.zip!\java.management\javax\management\remote\JMXServiceURL.java and as you will see it's making sure that there are no non-ASCII characters in the URL and there is a part of my answer in it :
public class JMXServiceURL implements Serializable {
private static final long serialVersionUID = 8173364409860779292L;
/**
* Constructs a JMXServiceURL by parsing a Service URL
* string.
*
* @param serviceURL the URL string to be parsed.
*
* @exception NullPointerException if serviceURL is
* null.
*
* @exception MalformedURLException if serviceURL
* does not conform to the syntax for an Abstract Service URL or
* if it is not a valid name for a JMX Remote API service. A
* JMXServiceURL must begin with the string
* "service:jmx:" (case-insensitive). It must not
* contain any characters that are not printable ASCII characters.
*/
public JMXServiceURL(String serviceURL) throws MalformedURLException {
final int serviceURLLength = serviceURL.length();
/* Check that there are no non-ASCII characters in the URL,
following RFC 2609. */
for (int i = 0; i < serviceURLLength; i++) {
char c = serviceURL.charAt(i);
if (c < 32 || c >= 127) {
throw new MalformedURLException("Service URL contains " +
"non-ASCII character 0x" +
Integer.toHexString(c));
}
}
You can find @exception MalformedURLException in comment and the interesting part is I can see my Exception message is being ready for me :)
Here's what I have already tested :
I have tried adding "127.0.0.1 localhost hostname" to the end of hosts file which wasn't useful and I can't see any relations between my problem and that.
I have tried running Intellij Idea as Administrator which also didn't work.
*FINALLY This is my FULL output in Intellij Idea Console :
"C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\catalina.bat" run
[2019-09-07 10:58:59,049] Artifact test:war exploded: Waiting for server connection to start artifact deployment...
Using CATALINA_BASE: "C:\Users\pcs\.IntelliJIdea2018.3\system\tomcat\Tomcat_9_0_12_test"
Using CATALINA_HOME: "C:\Program Files\Apache Software Foundation\Tomcat 9.0"
Using CATALINA_TMPDIR: "C:\Program Files\Apache Software Foundation\Tomcat 9.0\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk-10.0.1"
Using CLASSPATH: "C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\bootstrap.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\tomcat-juli.jar"
Error: Exception thrown by the agent : java.net.MalformedURLException: Service URL contains non-ASCII character 0x6f1
jdk.internal.agent.AgentConfigurationError: java.net.MalformedURLException: Service URL contains non-ASCII character 0x6f1
at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap.startRemoteConnectorServer(ConnectorBootstrap.java:491)
at jdk.management.agent/jdk.internal.agent.Agent.startAgent(Agent.java:450)
at jdk.management.agent/jdk.internal.agent.Agent.startAgent(Agent.java:621)
Caused by: java.net.MalformedURLException: Service URL contains non-ASCII character 0x6f1
at java.management/javax.management.remote.JMXServiceURL.<init>(JMXServiceURL.java:157)
at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap.exportMBeanServer(ConnectorBootstrap.java:846)
at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap.startRemoteConnectorServer(ConnectorBootstrap.java:479)
... 2 more
Disconnected from server
Please let me know if I missed something to say. Thanks a lot for your big help.
With a little depth look and doing some researches, I realized ( 0x6f1 ) equals with ( 1777 ) by converting Hexadecimal to Decimal online. It seems there is a non-ASCII character which its ( char to int ) converted result is 1777.
Finally by converting ( int to char ) I realized that the char was actually a non-ASCII :)
(As CrazyCoder found out) it was EXTENDED ARABIC-INDIC DIGIT ONE
My SOLUTION: I removed Persian (Standard) language from my windows OS at:Control Panel\All Control Panel Items\Language
int a = 1777;
char c = (char)a;
System.out.println (c);