可以ping通服务器 但connect to host返回 ehostunreach (no route to host)

java - No route to host - connect(2) (Errno::EHOSTUNREACH) - Stack Overflow
to customize your list.
Announcing Stack Overflow Documentation
We started with Q&A. Technical documentation is next, and we need your help.
Whether you're a beginner or an experienced developer, you can contribute.
Where can i find configuration to the SMTP server?
**************/usr/lib/ruby/1.8/net/smtp.rb:551:in `initialize': No
route to host - connect(2) (Errno::EHOSTUNREACH)
/usr/lib/ruby/1.8/net/smtp.rb:551:in `open'
/usr/lib/ruby/1.8/net/smtp.rb:551:in `do_start'
/usr/lib/ruby/1.8/timeout.rb:67:in `timeout'
/usr/lib/ruby/1.8/timeout.rb:101:in `timeout'
/usr/lib/ruby/1.8/net/smtp.rb:551:in `do_start'
/usr/lib/ruby/1.8/net/smtp.rb:525:in `start'
/usr/lib/ruby/gems/1.8/gems/mail-2.5.4/lib/mail/network/delivery_methods/smtp.rb:112:in
`deliver!'
/usr/lib/ruby/gems/1.8/gems/mail-2.5.4/lib/mail/message.rb:248:in
`deliver!'
12.4k62145
You appear to be using the Ruby "Mail" library :
From my reading of the documentation, there is no configuration file.
Instead, the library (optionally) configured in Ruby code.
If you don't do any configuration, the library defaults to using the mail server that is listening on "localhost" port 25.
In that case, a "EHOSTUNREACH: No route to host" error most likely means that:
your computer either has a bad "hosts" entry for "localhost", or
the local host IP device is not properly configured.
Either way, is a system management problem not a programming problem.
That's off-topic for SO ... and you haven't provided enough information to help us to diagnose / solve it anyway.
Otherwise, your code will somewhere contains something like this:
Mail.defaults do
delivery_method :smtp, { :address =& "",
:port =& 587,
:domain =& 'your.host.name',
:user_name =& '&username&',
:password =& '&password&',
:authentication =& 'plain',
:enable_starttls_auto =& true }
The problem will be that the ":address" entry is pointing to a server that you can't talk to.
If the entry has the wrong value in it, fix it.
Otherwise this is a system (or network) management problem, not a programming problem.
378k43400726
Did you find this question interesting? Try our newsletter
Sign up for our newsletter and get our top new questions delivered to your inbox ().
Subscribed!
Success! Please click the link in the confirmation email to activate your subscription.
The error Errno::EHOSTUNREACH: No route to host - connect(2) indicates
a routing problem and has probably something to do with a wrong IP address. You might have specified a wrong IP in /etc/hosts (the
which maps hostnames to IP addresses) or elsewhere, for instance in config/deploy.rb, etc.. If you use a local network with a DHCP server, the IP adresses can change frequently.
# problematic code
rescue Errno::EHOSTUNREACH
# log the error
# let the User know
# handle other exceptions
3,53832043
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled安卓程序,访问网络时路径正确,但是却得不到资源
[问题点数:35分]
安卓程序,访问网络时路径正确,但是却得不到资源
[问题点数:35分]
不显示删除回复
显示所有回复
显示星级回复
显示得分回复
只显示楼主
匿名用户不能发表回复!|
每天回帖即可获得10分可用分!小技巧:
你还可以输入10000个字符
(Ctrl+Enter)
请遵守CSDN,不得违反国家法律法规。
转载文章请注明出自“CSDN(www.csdn.net)”。如是商业用途请联系原作者。新手园地& & & 硬件问题Linux系统管理Linux网络问题Linux环境编程Linux桌面系统国产LinuxBSD& & & BSD文档中心AIX& & & 新手入门& & & AIX文档中心& & & 资源下载& & & Power高级应用& & & IBM存储AS400Solaris& & & Solaris文档中心HP-UX& & & HP文档中心SCO UNIX& & & SCO文档中心互操作专区IRIXTru64 UNIXMac OS X门户网站运维集群和高可用服务器应用监控和防护虚拟化技术架构设计行业应用和管理服务器及硬件技术& & & 服务器资源下载云计算& & & 云计算文档中心& & & 云计算业界& & & 云计算资源下载存储备份& & & 存储文档中心& & & 存储业界& & & 存储资源下载& & & Symantec技术交流区安全技术网络技术& & & 网络技术文档中心C/C++& & & GUI编程& & & Functional编程内核源码& & & 内核问题移动开发& & & 移动开发技术资料ShellPerlJava& & & Java文档中心PHP& & & php文档中心Python& & & Python文档中心RubyCPU与编译器嵌入式开发驱动开发Web开发VoIP开发技术MySQL& & & MySQL文档中心SybaseOraclePostgreSQLDB2Informix数据仓库与数据挖掘NoSQL技术IT业界新闻与评论IT职业生涯& & & 猎头招聘IT图书与评论& & & CU技术图书大系& & & Linux书友会二手交易下载共享Linux文档专区IT培训与认证& & & 培训交流& & & 认证培训清茶斋投资理财运动地带快乐数码摄影& & & 摄影器材& & & 摄影比赛专区IT爱车族旅游天下站务交流版主会议室博客SNS站务交流区CU活动专区& & & Power活动专区& & & 拍卖交流区频道交流区
UID7667247空间积分0 积分667阅读权限20帖子精华可用积分667 信誉积分473 专家积分0 在线时间262 小时注册时间最后登录
丰衣足食, 积分 667, 距离下一级还需 333 积分
帖子主题精华可用积分667 信誉积分473 专家积分0 在线时间262 小时注册时间最后登录
论坛徽章:0
两个VMWARE虚拟机 都是centos5.4 相互都ping通,
但自己写的连接程序connect后返回EHOSTUNREACH (No route to host)错误,知道怎么解决么?
只在网上查到:
引发了ICMP目的不可达错误,这认为是软错误。client核心保存消息并且荏苒发送SYN。。如果超出一个确定的时间。保存的ICMP错误返回给进程 EHOSTUNREACH或者ENETUNREACH。ENETUNREACH被认为是过时的。所以返回的应该是EHOSTUNREACH。
&&nbsp|&&nbsp&&nbsp|&&nbsp&&nbsp|&&nbsp&&nbsp|&&nbsp
UID空间积分0 积分4979阅读权限50帖子精华可用积分4979 信誉积分1452 专家积分20 在线时间6117 小时注册时间最后登录
小富即安, 积分 4979, 距离下一级还需 21 积分
帖子主题精华可用积分4979 信誉积分1452 专家积分20 在线时间6117 小时注册时间最后登录
论坛徽章:0
先用telnet ip port试试
UID7667247空间积分0 积分667阅读权限20帖子精华可用积分667 信誉积分473 专家积分0 在线时间262 小时注册时间最后登录
丰衣足食, 积分 667, 距离下一级还需 333 积分
帖子主题精华可用积分667 信誉积分473 专家积分0 在线时间262 小时注册时间最后登录
论坛徽章:0
telnet显示telnet: Unable to connect to remote host: No route to host
关闭了防火墙,设置了路由 还是不行
UID7240278空间积分0 积分5817阅读权限70帖子精华可用积分5817 信誉积分260 专家积分35 在线时间1404 小时注册时间最后登录
富足长乐, 积分 5817, 距离下一级还需 2183 积分
帖子主题精华可用积分5817 信誉积分260 专家积分35 在线时间1404 小时注册时间最后登录
论坛徽章:0
看看你的虚拟机网卡是否安装了,ip地址设置的是否合理
请用你知道的去帮助别人,就像别人当初帮助你一样!
UID空间积分0 积分4979阅读权限50帖子精华可用积分4979 信誉积分1452 专家积分20 在线时间6117 小时注册时间最后登录
小富即安, 积分 4979, 距离下一级还需 21 积分
帖子主题精华可用积分4979 信誉积分1452 专家积分20 在线时间6117 小时注册时间最后登录
论坛徽章:0
telnet显示telnet: Unable to connect to remote host: No route to host
关闭了防火墙,设置了路由 还是不 ...
hippies 发表于
这样提示应该ping都不通啊
UID空间积分0 积分1069阅读权限30帖子精华可用积分1069 信誉积分102 专家积分0 在线时间404 小时注册时间最后登录
家境小康, 积分 1069, 距离下一级还需 931 积分
帖子主题精华可用积分1069 信誉积分102 专家积分0 在线时间404 小时注册时间最后登录
论坛徽章:0
矛盾啊,怎么会ping通
UID空间积分0 积分517阅读权限20帖子精华可用积分417 信誉积分611 专家积分48 在线时间3374 小时注册时间最后登录
丰衣足食, 积分 517, 距离下一级还需 483 积分
帖子主题精华可用积分417 信誉积分611 专家积分48 在线时间3374 小时注册时间最后登录
论坛徽章:0
VM网络连接方式是什么?
Before you go to sleep, Say a little prayer,Every day in every way, it's getting better and better.
UID7667247空间积分0 积分667阅读权限20帖子精华可用积分667 信誉积分473 专家积分0 在线时间262 小时注册时间最后登录
丰衣足食, 积分 667, 距离下一级还需 333 积分
帖子主题精华可用积分667 信誉积分473 专家积分0 在线时间262 小时注册时间最后登录
论坛徽章:0
能ping通 putty也可以连接两个虚拟机,用的网桥方式
UID7240278空间积分0 积分5817阅读权限70帖子精华可用积分5817 信誉积分260 专家积分35 在线时间1404 小时注册时间最后登录
富足长乐, 积分 5817, 距离下一级还需 2183 积分
帖子主题精华可用积分5817 信誉积分260 专家积分35 在线时间1404 小时注册时间最后登录
论坛徽章:0
两个虚拟机在不在一个网段?
请用你知道的去帮助别人,就像别人当初帮助你一样!
UID7667247空间积分0 积分667阅读权限20帖子精华可用积分667 信誉积分473 专家积分0 在线时间262 小时注册时间最后登录
丰衣足食, 积分 667, 距离下一级还需 333 积分
帖子主题精华可用积分667 信誉积分473 专家积分0 在线时间262 小时注册时间最后登录
论坛徽章:0
在一个网段 ,另外一个不同网段的机器还能正常访问这两个虚拟机查看: 660|回复: 12
K1路由器HTTP注射器设置寻求帮助
本帖最后由 crinsgod 于
08:50 编辑
放弃解决,跑自己的流量好了
这个算是免流成功了,还是没成功??
OPENVPN免成功,可爬墙
HTTP注射器免成功,不可爬墙&
[上午10:59] Problem in SSH connection thread during connecting - There was a problem while connecting to agsh.ngrok.cc:*****
[上午10:59] 无法启动 I/O 连接: failed to connect to /10.0.0.127 (port 80) after 90000ms: isConnected failed: EHOSTUNREACH (No route to host)
这样是哪里错了,内网穿了啊
内网穿透只能玩玩,毕竟转发端口有限,几十次能抢到一个端口就不错了&
这个算是免流成功了,还是没成功??
OPENVPN免成功,可爬墙
HTTP注射器免成功,不可爬墙
http配置能贴上来参看看看么&
按理说iphone和安卓的openvpn设置应该是一样的啊,怎么会iphone行,安卓不行呢,你是哪个地区哪个运营商?
顺便问一下,http注射器是在路由上搭建的吗?怎么搭建的?
OPENVPN免成功,可爬墙
HTTP注射器免成功,不可爬墙
http配置能贴上来参看看看么
楼主,注射器有效荷载和代理怎么填写?ssh有了
你注射器配置可否发我一份,我这边是通过ngrok内网穿透搭建好服务器,但是ssh不知道如何设置?无法连接
楼主咋搞的?有教程吗?我怎么搞都没用,教教我吧
分享一下教程吧!
能免不错~~~~~
路由器可以的,首先在路由器上开启ssh登陆,然后关闭防火墙,用花生壳域名,端口22,账户名密码为登陆路由器客户端的账号密码
[上午10:59] Problem in SSH connection thread during connecting - There was a problem while connectin ...
内网穿透只能玩玩,毕竟转发端口有限,几十次能抢到一个端口就不错了
Powered byRate this:
Hello Sir,
In my project i have to get data's from either url-1 or url-2 webservice which has same stored procedure but different data's.whenever i connect to any one of this url at first time it get connected and fetch data from the webservice but if i give another url it returns exception, eventhough my device wifi connectivity is also high.
It works once i changed the wifi turn off and on.
what actually happens......i cant solve is problem......pls help
This is my error
java.net.SocketException: No route to host
at org.apache.harmony.luni.platform.OSNetworkSystem.connectStreamWithTimeoutSocketImpl(Native Method)
at org.apache.harmony.luni.platform.OSNetworkSystem.connect(OSNetworkSystem.java:115)
at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:244)
at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:533)
at java.net.Socket.connect(Socket.java:1055)
at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.&init&(HttpConnection.java:62)
at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:88)
at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHTTPConnection(HttpURLConnectionImpl.java:927)
at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:909)
at org.ksoap2.transport.ServiceConnectionSE.connect(ServiceConnectionSE.java:46)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:68)
at com.mobile.project.callsdue.activity.NewWebServiceCall.WebServiceUserList(NewWebServiceCall.java:88)
at com.mobile.project.callsdue.activity.CallsDueLoginPage$5.onItemSelected(CallsDueLoginPage.java:659)
at android.widget.AdapterView.fireOnSelected(AdapterView.java:864)
at android.widget.AdapterView.access$200(AdapterView.java:42)
at android.widget.AdapterView$SelectionNotifier.run(AdapterView.java:830)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4914)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
Posted 6-Nov-11 19:41pm
Solution 1
Try by calling one service at a time. Check are you able to connect to both your Web Services one at a time. From the Exception details it sounds to be your Service is unreachable from the Device.
You may also post your Question on Android Developers Forum.
Posted 6-Nov-11 20:03pm
Solution 2
[](Results The solution is to set in off the WiFi capabilities, and then re-open WiFi, no problem results) &---Chinese site
Posted 6-Nov-11 20:24pm
<button class="toolbar" onclick="InsertText('&l' + 't;');" title="Insert HTML Extended Character Code For &&&
Strip HTML
Encode HTML
Paste as-is
Code block
Quoted Text
Best guess
When answering a question please:
Read the question carefully.
Understand that English isn't everyone's first language so be lenient of bad
spelling and grammar.
If a question is poorly phrased then either ask for clarification, ignore it, or
edit the question and fix the problem. Insults are not welcome.
Let's work to help developers, not make them feel stupid.
This content, along with any associated source code and files, is licensed under
Last Updated 7 Nov 2011
Copyright & ,
All Rights Reserved.
CodeProject,
503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada
+1 416-849-8900 x 100

我要回帖

更多关于 rmhostconnect 的文章

 

随机推荐