If you encounter the exception "java.lang.IllegalArgumentException: URI path begins with multiple slashes" while pointing the APM Insight Java agent folder to your monitoring Java Application server, follow these steps to identify and resolve the issue:
Note: Our Java agent won't proceed with successful communication with Applications Manager if initial communicating(arh/connect) API is in wrong format Identify the issue with Agent Logs:
1. Navigate to the <agent-unzipped-folder> which added as JVM argument to your Java Application server and open the recently modified `apminsight_agent_<YYYY>-<MM>-<DD>-<HH>-<MM>-<SS>_<GMT>_<PID>.log` file.
2. Look for exception entries like the below example:
apminsight_agent_<YYYY>-<MM>-<DD>-<HH>-<MM>-<SS>_<GMT>_<PID>.log
- [27 Feb 2024 16:11:36.502][apminsight-services-starter][INFO]: [JavaAgentService] URL to be executed: http://localhost:9090//arh/connect?license.key=**
- .
- .
- .
- [27 Feb 2024 16:11:36.533][apminsight-services-starter][ERROR]: Exception in Connect. Will try to reconnect after 2 minute(s).
- java.lang.IllegalArgumentException: URI path begins with multiple slashes
- at com.manageengine.org.apache.hc.core5.util.Args.check(Args.java:41) ~[?:6.0.1]
- at com.manageengine.org.apache.hc.core5.http.message.BasicHttpRequest.setUri(BasicHttpRequest.java:281) ~[?:6.0.1]
- at com.manageengine.org.apache.hc.core5.http.message.BasicHttpRequest.<init>(BasicHttpRequest.java:123) ~[?:6.0.1]
- at com.manageengine.org.apache.hc.core5.http.message.BasicClassicHttpRequest.<init>(BasicClassicHttpRequest.java:91) ~[?:6.0.1]
Solution
1. Navigate to the <agent-unzipped-folder> which added as JVM argument to your Java Application server and open the `apminsight.conf` file.
2. Remove ends-with backward slash(/) in the `apm.host` config value as mentioned below:
apm.host=http://localhost:9090/ => apm.host=http://localhost:9090
3. Then, save the file and Restart the Java application server to get reflected