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

Jumblr on Google App Engine - java.lang.SecurityException #22

Closed
anuragkapur opened this issue Jul 12, 2013 · 2 comments
Closed

Jumblr on Google App Engine - java.lang.SecurityException #22

anuragkapur opened this issue Jul 12, 2013 · 2 comments
Labels

Comments

@anuragkapur
Copy link

Jumblr does not work in an app deployed on Google App Engine, owing to Gson and the way it uses/depends on Reflection.

Below is a stack trace detailing the problem:
java.lang.SecurityException: java.lang.IllegalAccessException: Reflection is not allowed on private java.lang.String java.io.File.path
at com.google.appengine.runtime.Request.process-bc4f433d60aeb55d(Request.java)
at java.lang.reflect.Field.setAccessible(Field.java:166)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:116)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
at com.google.gson.Gson.getAdapter(Gson.java:353)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.(ReflectiveTypeAdapterFactory.java:82)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:81)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:118)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
at com.google.gson.Gson.getAdapter(Gson.java:353)
at com.google.gson.Gson.fromJson(Gson.java:794)
at com.google.gson.Gson.fromJson(Gson.java:859)
at com.google.gson.Gson$2.deserialize(Gson.java:131)
at com.tumblr.jumblr.responses.PostDeserializer.deserialize(PostDeserializer.java:22)
at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:58)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:81)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:60)
at com.google.gson.Gson.fromJson(Gson.java:795)
at com.google.gson.Gson.fromJson(Gson.java:859)
at com.tumblr.jumblr.responses.ResponseWrapper.getPosts(ResponseWrapper.java:45)
at com.tumblr.jumblr.JumblrClient.blogPosts(JumblrClient.java:169)
at com.tumblr.jumblr.JumblrClient.blogPosts(JumblrClient.java:173)

@jackie-scholl
Copy link
Contributor

This might be due to the restrictions on reflection in GAE; see the restrictions at https://developers.google.com/appengine/docs/java/#The_Sandbox and a description of the problem (but serializing instead of deserializing) at http://stackoverflow.com/a/3007044/1772907. The suggested solution, I believe, was to write a custom deserializer.

@KevinTCoughlin
Copy link
Contributor

Closing this for now as it is indeed a limitation of GAE. Would welcome a PR for using a custom de/serializer if the need is there.

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

No branches or pull requests

3 participants