总结一下在配置idea部署项目到远程服务器时遇到的一些问题,希望各位同学能少走弯路
本文主要是解决出现的问题,具体配置连接可以参考其他博客
环境:ubuntu16 tomcat8
1、Error: Exception thrown by the agent : java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: Willianfu: Willianfu: Name or service not known
-------启动./catalina.sh run报的是不知道本地主机名,于是找到 /etc/hostname 和 /etc/hosts ,打开
将hosts文件中xxxx处添加主机名与hostname文件中一致,然后重启服务器
2、IDEA报unable to connect to xx.xx.xx.xx
----------无法连结到远程服务器端口,
---请检查IDEA配置给tomcat启动连接的端口与catalina.sh中的配置是否相同,例如我是1099
---如果是云服务器,请查看是否给服务器设置的安全组中禁用了该端口或者本机禁用,具体配置查看提供商文档
---查看端口是否被占用 lsof -i:1099, 然后干掉占用进程
3、IDEA报Unable to connect to the xxx.xx.xx.xx:1099, reason: java.rmi.ConnectException: Connection refused to host: xxx.xx.xx.xx; nested exception is: java.net.ConnectException: Connection timed out: conne
--------请检查catalina.sh配置
CATALINA_OPTS="-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.rmi.port=1099
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Djava.rmi.server.hostname=xx.xx.xx.xx"
export CATALINA_OPTS
--------请确保拥有这条配置 -Dcom.sun.management.jmxremote.rmi.port=1099
IDEA配置如下
sftp配置