-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Objenesis can't work on the Google Apps Engine #15
Comments
Comment #1 originally posted by henri-tremblay on 2010-11-07T14:51:57.000Z: 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. |
Comment #4 originally posted by henri-tremblay on 2011-08-10T18:10:38.000Z: It also a problem for lamdaj |
Comment #6 originally posted by henri-tremblay on 2013-04-04T20:49:37.000Z: 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? |
Comment #7 originally posted by henri-tremblay on 2013-04-04T22:55:53.000Z: 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. |
Comment #8 originally posted by henri-tremblay on 2013-04-16T10:17:59.000Z: (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): 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,java.lang.UnsupportedOperationException 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. |
Comment #9 originally posted by henri-tremblay on 2013-08-03T13:08:30.000Z: reflections.0.9.9-RC1.jar (https://code.google.com/p/reflections/) |
No perfect solution seems possible so far. I've implemented the best I could so far https://github.com/easymock/objenesis/blob/master/SupportedJVMs.md |
Original issue 12 created by henri-tremblay on 2010-10-09T10:34:41.000Z:
Trying to use objenesis on GAE the following exception is thrown
java.lang.NoClassDefFoundError: sun.reflect.ReflectionFactory is a restricted class.
Please see the Google App Engine developer's guide for more details.
at com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:51)
at org.objenesis.instantiator.sun.SunReflectionFactoryInstantiator.<init>(SunReflectionFactoryInstantiator.java:40)
at org.objenesis.strategy.StdInstantiatorStrategy.newInstantiatorOf(StdInstantiatorStrategy.java:85)
at org.objenesis.ObjenesisBase.getInstantiatorOf(ObjenesisBase.java:90)
at org.objenesis.ObjenesisBase.newInstance(ObjenesisBase.java:73)
The text was updated successfully, but these errors were encountered: