Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
GoogleCodeExporter opened this issue Apr 27, 2015 · 10 comments
Closed

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

GoogleCodeExporter opened this issue Apr 27, 2015 · 10 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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
Copy link
Author

[deleted comment]

1 similar comment
@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

  • Changed state: WontFix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant