beyyar / javapns

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

Error creating connection with Apple server #108

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Deploy with app -engine
2. Send a push notif using Push.alert(alert, "keystore.p12", "myPass", false, 
"device-token");

Exception:
javapns.communication.exceptions.CommunicationException: Error creating 
connection with Apple server at 
javapns.notification.PushNotificationManager.initializeConnection(PushNotificati
onManager.java:117) at javapns.Push.sendPayload(Push.java:171) at 
javapns.Push.test(Push.java:132) at 
com.nkm.server.PushServlet.doGet(PushServlet.java:23) at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at 
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.jav
a:1166) at 
com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUplo
adFilter.java:102) at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.jav
a:1157) at 
com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter
.java:35) at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.jav
a:1157) at 
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(Transactio
nCleanupFilter.java:43) at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.jav
a:1157) at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at 
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) at 
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandle
rMap.java:249) at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at 
org.mortbay.jetty.Server.handle(Server.java:326) at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.ja
va:923) at 
com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestPa
rser.java:76) at 
org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at 
com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(Jet
tyServletEngineAdapter.java:135) at 
com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:4
22) at 
com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.j
ava:449) at 
com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:455
) at com.google.tracing.TraceContext.runInContext(TraceContext.java:695) at 
com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedConte
xtNoUnref(TraceContext.java:333) at 
com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedConte
xt(TraceContext.java:325) at 
com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453) 
at 
com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java
:251) at java.lang.Thread.run(Thread.java:679) Caused by: 
java.lang.SecurityException: SHA1 digest error for 
org/bouncycastle/jce/provider/BouncyCastleProvider.class at 
com.google.appengine.runtime.Request.process-564ccd6fc0520be4(Request.java) at 
sun.security.util.ManifestEntryVerifier.verify(ManifestEntryVerifier.java:210) 
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:218) at 
java.util.jar.JarVerifier.update(JarVerifier.java:205) at 
java.util.jar.JarVerifier$VerifierStream.read(JarVerifier.java:428) at 
sun.misc.Resource.getBytes(Resource.java:124) at 
java.net.URLClassLoader.defineClass(URLClassLoader.java:273) at 
sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source) at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:43) at java.lang.reflect.Method.invoke(Method.java:616) at 
java.lang.ClassLoader.loadClass(ClassLoader.java:266) at 
javapns.notification.PushNotificationManager.initializeConnection(PushNotificati
onManager.java:105) at javapns.Push.sendPayload(Push.java:171) at 
javapns.Push.test(Push.java:132) at 
com.nkm.server.PushServlet.doGet(PushServlet.java:23) at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at 
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.jav
a:1166) at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.jav
a:1157) at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.jav
a:1157) at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.jav
a:1157) at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at 
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at 
org.mortbay.jetty.Server.handle(Server.java:326) at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.ja
va:923) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at 
com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.j
ava:449) at 
com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:455
) at com.google.tracing.TraceContext.runInContext(TraceContext.java:695) at 
com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedConte
xtNoUnref(TraceContext.java:333) at 
com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedConte
xt(TraceContext.java:325) at 
com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453) 
... 

Original issue reported on code.google.com by joe.abi....@gmail.com on 19 Feb 2012 at 12:48

GoogleCodeExporter commented 8 years ago
Someone documented on a deprecated wiki page 
(http://code.google.com/p/javapns/wiki/Intro) that Google App Engine was not 
supported.  The exception you provided hints at the possibility that the 
BouncyCastle library (listed as a dependency of JavaPNS) is the one that is not 
compatible with Google App Engine.

Since the issue is apparently coming from a third party library and not JavaPNS 
itself, I think we should close this issue as Won't Fix...

Original comment by sype...@gmail.com on 20 Feb 2012 at 1:23

GoogleCodeExporter commented 8 years ago
Added notes on the Requirements page about Google App Engine not being 
supported by the BouncyCastle dependency.

Closing as Won't Fix.

Original comment by sype...@gmail.com on 21 Feb 2012 at 3:38

GoogleCodeExporter commented 8 years ago
This is because bouncy castle is a signed jar. If you unzip the jar and remove 
the META-INF/MANIFEST.MF then it will work.

Someone from Google mentioned this fix in another issue:
https://code.google.com/p/javapns/issues/detail?id=148&can=1&q=engine

Original comment by j...@jameslow.com on 23 Apr 2013 at 12:43

GoogleCodeExporter commented 8 years ago
Modified bundled BouncyCastle library to make it unsigned, so that it will work 
with Google App Engine.

Original comment by sype...@gmail.com on 30 Sep 2014 at 2:34

GoogleCodeExporter commented 8 years ago
Fix is in r383 (trunk)

Original comment by sype...@gmail.com on 30 Sep 2014 at 2:36