简体   繁体   English

远程Tomcat服务器:java.net.ConnectException:连接被拒绝

[英]remote Tomcat server : java.net.ConnectException: Connection refused

I have been trying to find an answer to my question but couldnt. 我一直在努力寻找问题的答案,但是没有找到答案。

Now, my java web application runs perfectly on my local Tomcat server (6). 现在,我的Java Web应用程序可以在本地Tomcat服务器(6)上完美运行。 It connects to a remote mysql database on db4free.net. 它连接到db4free.net上的远程mysql数据库。

When uploading my web application on eatj.com (running Tomcat server 6 too) , it gives this exception: java.net.ConnectException: Connection refused . 当在eatj.com上上传我的Web应用程序(也正在运行Tomcat服务器6)时,它会出现以下异常: java.net.ConnectException: Connection refused

Note that it runs fine when commenting the part connecting to the mysql database. 注意,在注释连接到mysql数据库的部分时,它运行良好。

I want to know what could differ between my Tomcat server and the remote Tomcat server that would lead to this error? 我想知道我的Tomcat服务器和导致此错误的远程Tomcat服务器之间可能有什么不同?

Thanks in advance. 提前致谢。

ADDITIONAL UPDATE: 额外更新:

Root Cause:
Caused by: java.security.AccessControlException: 
access denied (java.net.SocketPermission db4free.net resolve)

I want to know what could differ between my Tomcat server and the remote Tomcat server that would lead to this error? 我想知道我的Tomcat服务器和导致此错误的远程Tomcat服务器之间可能有什么不同?

It is unlikely to be a difference in the Tomcat servers themselves. Tomcat服务器本身不太可能有所不同。 If there was an issue with Tomcat, it would manifest as a different exception. 如果Tomcat存在问题,它将显示为另一个异常。

The more likely cause is some kind of firewall issue; 更可能的原因是某种防火墙问题; eg the firewall at eatj.com blocking outbound connections on the MySQL JDBC port. 例如, eatj.com的防火墙阻止MySQL JDBC端口上的出站连接。

SOLVED! 解决了!

I have contacted them. 我联系了他们。 They said since the root cause is " java.security.AccessControlException" then I have to upgrade to a paid account. 他们说因为根本原因是“java.security.AccessControlException”然后我必须升级到付费帐户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM