healthy-tree / javapns

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

Javapns Communication exception:Connection refused to ConnectionToAppleServer #230

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I use the javapns2.2 jar for push notification in iOS devices. The java source 
run in my local tomcat server delivers the push notification to my device. When 
i try with the live url the connection gets refused. Below is my tomcat live 
server log. I tried with the other members mentioned with firewall settings and 
nothing got me worked. I cannot detect the issue since it runs good in 
localhost but not in live server. Kindly suggest me to resolve.

Server Log:

Pay load is {"aps":{"alert":"test message","sound":"default"}} 
javapns.communication.exceptions.CommunicationException: Communication 
exception: java.net.ConnectException: Connection refused at 
javapns.communication.ConnectionToAppleServer.getSSLSocket(ConnectionToAppleServ
er.java:158) at 
javapns.notification.PushNotificationManager.initializeConnection(PushNotificati
onManager.java:106) at javapns.Push.sendPayload(Push.java:171) at 
javapns.Push.payload(Push.java:149) at 
org.sabarish.model.PushMessage.sendNotification(PushMessage.java:111) at 
com.sabarish.api.Push.sendPushNotification(Push.java:56) at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:43) at java.lang.reflect.Method.invoke(Method.java:606) at 
org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactor
y$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) at 
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$
1.run(AbstractJavaResourceMethodDispatcher.java:151) at 
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.
invoke(AbstractJavaResourceMethodDispatcher.java:171) at 
org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$
ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152) at 
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.
dispatch(AbstractJavaResourceMethodDispatcher.java:104) at 
org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInv
oker.java:402) at 
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvo
ker.java:349) at 
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvo
ker.java:106) at 
org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:259) at 
org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) at 
org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) at 
org.glassfish.jersey.internal.Errors.process(Errors.java:315) at 
org.glassfish.jersey.internal.Errors.process(Errors.java:297) at 
org.glassfish.jersey.internal.Errors.process(Errors.java:267) at 
org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:
318) at 
org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:236) at 
org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:10
10) at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:373) 
at 
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:382)
 at 
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:345)
 at 
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:220)
 at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erChain.java:305) at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:210) at 
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(S
trutsPrepareAndExecuteFilter.java:81) at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erChain.java:243) at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:210) at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:2
22) at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:1
23) at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.jav
a:472) at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) 
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) 
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947) at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118
) at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at 
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor
.java:1009) at 
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractPro
tocol.java:589) at 
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
 at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
at java.lang.Thread.run(Thread.java:745) Caused by: java.net.ConnectException: 
Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at 
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) at 
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:2
00) at 
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) at 
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at 
java.net.Socket.connect(Socket.java:579) at 
sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:618) at 
sun.security.ssl.SSLSocketImpl.(SSLSocketImpl.java:407) at 
sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:88)
 at 
javapns.communication.ConnectionToAppleServer.getSSLSocket(ConnectionToAppleServ
er.java:155) ... 49 more

Original issue reported on code.google.com by mark.p1...@gmail.com on 9 Feb 2015 at 7:53