Open GoogleCodeExporter opened 9 years ago
Objenesis is indeed using some restricted classes. I'm not sure we can
workaround it.
Some insider information (from Google App Engine team) would be really helpful
Anyhow, we'll look into it.
Original comment by henri.tr...@gmail.com
on 7 Nov 2010 at 2:51
Original comment by henri.tr...@gmail.com
on 7 Nov 2010 at 2:58
Original comment by henri.tr...@gmail.com
on 7 Nov 2010 at 2:59
It also a problem for lamdaj
Original comment by grego...@gmail.com
on 10 Aug 2011 at 6:10
Original comment by henri.tr...@gmail.com
on 23 Jan 2013 at 10:32
Was there any chance on making Objenesis work with GAE? If we implement our own
version of sun.reflect.ReflectionFactory, would be a work-around?
Original comment by xyb...@gmail.com
on 4 Apr 2013 at 8:49
I would of course be interested. Can someone try Unsafe.allocateInstance? I
will as soon as I have the time but I can't say when.
Then, if someone has an answer, I'm listening.
Original comment by henri.tr...@gmail.com
on 4 Apr 2013 at 10:55
(Disclaimer: I'm a Googler, but I have no particular insider knowledge of App
Engine)
I had a bit of time, so I tried Unsafe.allocateInstance in a simple AppEngine
app - it fails with an Exception similar to the above:
Unsafe.allocateInstance(TestAllocateInstance.class):
java.lang.NoClassDefFoundError: sun.misc.Unsafe is a restricted class. Please
see the Google App Engine developer's guide for more details.
at com.google.apphosting.runtime.security.shared.stub.sun.misc.Unsafe.<clinit>(Unsafe.java)
I also tried the ObjectStreamClass.newInstance() method that Objenesis can use;
this fails when tweaking the accessibility of the method:
java.lang.SecurityException: java.lang.IllegalAccessException: Reflection is
not allowed on java.lang.Object java.io.ObjectStreamClass.newInstance() throws
java.lang.InstantiationException,java.lang.reflect.InvocationTargetException,jav
a.lang.UnsupportedOperationException
at com.google.appengine.runtime.Request.process-4e7d974abb397f1b(Request.java)
at java.lang.reflect.Method.setAccessible(Method.java:135)
Interestingly, this latter approach works fine in the dev appserver but fails
when running in the production App Engine environment.
As I understand it, it'd probably be considered a failure of App Engine's
sandbox for these sorts of techniques to work.
Original comment by i...@google.com
on 16 Apr 2013 at 10:17
[deleted comment]
Original comment by henri.tr...@gmail.com
on 21 Aug 2013 at 9:01
Original issue reported on code.google.com by
mario.fu...@gmail.com
on 9 Oct 2010 at 10:34