Merge branch 'master' into async-context

This commit is contained in:
吴晟 Wu Sheng 2019-03-14 20:39:06 +08:00 committed by GitHub
commit 32c43280ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -19,6 +19,7 @@
package org.apache.skywalking.apm.agent.core.boot;
import java.net.URISyntaxException;
import org.apache.skywalking.apm.agent.core.logging.api.ILog;
import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
@ -61,9 +62,11 @@ public class AgentPackagePath {
urlString = urlString.substring(urlString.indexOf("file:"), insidePathIndex);
File agentJarFile = null;
try {
agentJarFile = new File(new URL(urlString).getFile());
agentJarFile = new File(new URL(urlString).toURI());
} catch (MalformedURLException e) {
logger.error(e, "Can not locate agent jar file by url:" + urlString);
} catch (URISyntaxException e) {
logger.error(e, "Can not locate agent jar file by url:" + urlString);
}
if (agentJarFile.exists()) {
return agentJarFile.getParentFile();