webpro2 / javapns

Automatically exported from code.google.com/p/javapns
0 stars 0 forks source link

java.net.SocketException: Bad address: connect #30

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
pushManager.initializeConnection("gateway.sandbox.push.apple.com", 2195, 
certificatePath, certificatePassword, SSLConnectionHelper.KEYSTORE_TYPE_PKCS12);

when these code run, java.net.SocketEcetption happened.
until oct. these code wort well. but recently make an error 
why????

Original issue reported on code.google.com by jupar...@gmail.com on 4 Oct 2010 at 9:52

GoogleCodeExporter commented 9 years ago
Need more info.

Are you asking if Apple did something? Can't say, we're not affiliated with 
Apple.

Did your cert expire? can't say, we don't have your cert.

What is the stack trace?

Original comment by idbill.p...@gmail.com on 5 Oct 2010 at 4:49

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
My   Push SSL Certificate IS
Development Push SSL Certificate Enabled  Dec 28, 2010 

when I run

http://localhost/apnsSend.do

tomcat stack trace like follow:

java.net.SocketException: Bad address: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(Unknown Source)
    at javapns.back.SSLConnectionHelper.getSSLSocket(Unknown Source)
    at javapns.back.PushNotificationManager.initializeConnection(Unknown Source)
    at com.jbt.util.ApnsManager.provider(ApnsManager.java:37)
    at com.jbt.controller.WebController.apnsSend(WebController.java:1817)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:259)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
    at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
    at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
    at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
    at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
    at java.lang.Thread.run(Unknown Source)

Original comment by jupar...@gmail.com on 5 Oct 2010 at 8:35

GoogleCodeExporter commented 9 years ago
What happens when type this in a terminal:
telnet gateway.sandbox.push.apple.com 2195

Do you get:
Trying 17.149.34.141...
Connected to gateway.sandbox.push-apple.com.akadns.net.
Escape character is '^]'.

or nothing? 

If nothing... verify why your machine cannot reach that address.

Original comment by idbill.p...@gmail.com on 5 Oct 2010 at 3:17

GoogleCodeExporter commented 9 years ago
when i trace router to gateway.sandbox.push.apple.com

 3     6 ms     5 ms     5 ms  222.106.74.93
 4     5 ms     8 ms     4 ms  112.189.31.21
 5     5 ms     5 ms     4 ms  112.189.28.1
 6     7 ms     5 ms     5 ms  112.174.17.233
 7     5 ms     5 ms     5 ms  112.174.81.6
 8     5 ms     5 ms     5 ms  112.174.83.14
 9   131 ms   130 ms   156 ms  112.174.87.130
10   155 ms   150 ms   146 ms  so-7-0-1.edge4.SanJose1.Level3.net [4.53.26.1]
11   160 ms   157 ms   153 ms  ae-2-79.edge2.SanJose1.Level3.net [4.68.18.79]
12       *        *       *    
13       *        *       *

I can't reach that, oh My.
what happened at networks....

Original comment by jupar...@gmail.com on 6 Oct 2010 at 12:53

GoogleCodeExporter commented 9 years ago
Traceroute isn't a valid test, because it requires an ICMP echo, which ICMP 
echo to be disabled. (makes sense)

What does telnet show?

Original comment by idbill.p...@gmail.com on 6 Oct 2010 at 3:47

GoogleCodeExporter commented 9 years ago
Thanks.

I Con't connect to gateway.sandbox.push.apple.com 2195 using telnet.

C:\Users\Administrator>telnet gateway.sandbox.push.apple.com 2195
Connecting To gateway.sandbox.push.apple.com...
Could not open connection to thehost, on port 2195: Connect failed

Original comment by jupar...@gmail.com on 6 Oct 2010 at 4:10

GoogleCodeExporter commented 9 years ago
Just to verify... do you have another machine [say with a different IP, same 
datacenter] that you can run that command from?

And if that doesn't work, what if you were to use another machine [say with a 
different isp]... a home connection would work equally well.

There is a note in the Apple docs, that indicates they will block connections 
if they receive too many to fast... just trying to rule out who is doing the 
blocking.

Original comment by idbill.p...@gmail.com on 6 Oct 2010 at 4:15

GoogleCodeExporter commented 9 years ago
Old issue with no recent update, which is most likely related to the user's 
network environment and not the library itself.  Please feel free to re-open if 
the issue is still valid.

Original comment by sype...@gmail.com on 7 Sep 2011 at 1:09