caelum/vraptor — Issue #409: objenesis doesn't work on GAE
Author: sergiolopes
Created: 2011-10-15 06:45:38+00:00
State: open
Labels: bug

Objenesis dies with an exception:

[code]
java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.reflect)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:166)
at java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1512)
at java.lang.ClassLoader$1.run(ClassLoader.java:330)
at java.security.AccessController.doPrivileged(Native Method)
at java.lang.ClassLoader.checkPackageAccess(ClassLoader.java:328)
at org.objenesis.instantiator.sun.SunReflectionFactoryInstantiator.(SunReflectionFactoryInstantiator.java:24)
at org.objenesis.strategy.StdInstantiatorStrategy.newInstantiatorOf(StdInstantiatorStrategy.java:69)
at org.objenesis.ObjenesisBase.getInstantiatorOf(ObjenesisBase.java:75)
at org.objenesis.ObjenesisBase.newInstance(ObjenesisBase.java:58)
at br.com.caelum.vraptor.proxy.ObjenesisInstanceCreator.instanceFor(ObjenesisInstanceCreator.java:34)
at br.com.caelum.vraptor.proxy.CglibProxifier.proxify(CglibProxifier.java:71)
at br.com.caelum.vraptor.util.test.MockResult.use(MockResult.java:78)
at br.com.caelum.vraptor.validator.DefaultValidator.onErrorUse(DefaultValidator.java:83)
at br.com.caelum.vraptor.validator.AbstractValidator.onErrorUsePageOf(AbstractValidator.java:57)
at br.com.caelum.site.contato.ContatoController.formulario(ContatoController.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:100)
at br.com.caelum.vraptor.interceptor.ExecuteMethodInterceptor.intercept(ExecuteMethodInterceptor.java:61)
... 66 more
[/code]

We should remove objenesis.jar from vraptor-blank-project-gae