keenlabs / KeenClient-Java

Official Java client for the Keen IO API. Build analytics features directly into your Java apps.
https://keen.io/docs
MIT License
74 stars 43 forks source link

SDK crashes in Google App Engine #58

Closed Geeber closed 9 years ago

Geeber commented 9 years ago

We have received a report that trying to use this SDK inside a Google App Engine app causes a crash. The error appeared to be a NoClassDefFoundError while loading KeenLogging. I suspect that the static initialization block is failing for some reason.

Geeber commented 9 years ago

I was able to reproduce this with a simple test app of my own; same error as reported (NoClassDefFoundError while loading KeenLogging). Looking into a fix now.

Geeber commented 9 years ago

Here's what's causing the crash:

java.lang.ExceptionInInitializerError at
io.keen.client.java.test.TestServlet.doGet(TestServlet.java:24) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at
...
Caused by: java.security.AccessControlException: access denied ("java.util.logging.LoggingPermission" "control") at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:382) at
java.security.AccessController.checkPermission(AccessController.java:572) at
java.lang.SecurityManager.checkPermission(SecurityManager.java:549) at
com.google.apphosting.runtime.security.CustomSecurityManager.checkPermission(CustomSecurityManager.java:56) at
java.util.logging.LogManager.checkPermission(LogManager.java:1414) at
java.util.logging.Handler.checkPermission(Handler.java:301) at
java.util.logging.Handler.setLevel(Handler.java:256) at
io.keen.client.java.KeenLogging.setLogLevel(KeenLogging.java:88) at
io.keen.client.java.KeenLogging.disableLogging(KeenLogging.java:61) at
io.keen.client.java.KeenLogging.<clinit>(KeenLogging.java:37) ... 35 more

Basically, it looks like GAE won't let us call Handler.setLevel.

Geeber commented 9 years ago

Should be fixed in the 2.1.2 release.