首页 > 代码库 > Could not synchronize with target

Could not synchronize with target

运行java应用程序

#bash LauncherJavaMainClass.sh
Could not synchronize with target


查看错误java命令启动时定向到的stderr日志:

Error: Exception thrown by the agent : java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: h003018.xxx.com: h003018.xxx.com

解决:

方法一、

#vim /etc/hosts
添加:192.168.1.202 h003018.xxx.com

192.168.1.202为启动java应用的主机IP

方法二、

查看LauncherJavaMainClass.sh,注释掉如下JMX启动参数

#JAVA_OPS="-Dsun.rmi.transport.tcp.readTimeout=5000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.server.exceptionTrace=true -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=22446 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"

Could not synchronize with target