You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Philip Luppens <ph...@gmail.com> on 2009/08/24 10:41:18 UTC

Re: Convention/XWork on GAE: unable to get members (SecurityException)

On Mon, Aug 24, 2009 at 10:11 AM, Jeromy
Evans<je...@blueskyminds.com.au> wrote:
>
> On 24/08/2009, at 1:29 PM, Jeromy Evans wrote:
>
>>
>> As a work-around (guess), I changed it to cimpl.getDeclaredClasses()
>> instead which is permitted (I don't know if this has the same effect on the
>> ClassLoader).  That got me past the issue above, but the same
>> SecurityException occurs in XWork's
>> ContainerImpl$ConstructorInjector.findConstructorIn():
>> SecurityException: Unable to get members for Class
>> o.a.s.v.v.VelocityManager
>>
>
> This exception occurs within Google App Engine because XWork eagerly loads
> the VelocityManager Class for the bean struts-default.xml.  VelocityManager
> uses the VelocityToolbox optional dependency (in velocity-tools) which is
> not deployed with the application by default.  I presume the GAE ClassLoader
> checks all imported classes against the whitelist and fails if the class is
> not found.
> It's overcome by deploying the application velocity.
>
> I now have Struts 2.1.8-snapshot with Convention, Sitemesh and JSON, within
> a Guice2 servlet filter for IOC, running within GAE.
>
> The mandatory work-around are:
>  - to still use a ServletContextListener to disable the OgnlRuntime security
> manager.  If not done, an IllegalAccessException occurs in
> OgnlUtil.setProperty(String) at run-time.  This exception is swallowed, but
> it typically results in an NPE in ServletRedirectResult.isPathUrl(String)
> because location cannot be set.
>  - the velocity dependencies need to be deployed with the application even
> if not in use.  If not done, a security exception occurs while getting the
> members of VelocityManager because VelocityManager imports VelocityToolbox
> and VelocityEngine.
>
> I don't think any S2 code changes are required at this time.
>
> regards,
>  Jeromy Evans

Just to make sure it doesn't get lost, I've added it to the FAQ on GAE.

http://cwiki.apache.org/confluence/display/WW/Google+App+Engine+%28GAE%29

Feel free to clean up/clarify.

Phil

-- 
"We cannot change the cards we are dealt, just how we play the hand."
- Randy Pausch

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Convention/XWork on GAE: unable to get members (SecurityException)

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
On 25/08/2009, at 2:28 AM, Musachy Barroso wrote:

> would it help to have a maven archetype for S2 and GAE?
>
> musachy


Yes, but not yet I think.  The GAE team only support an ant build  
process and I'd like to see the maven-based build converge a little  
more. At the moment everyone rolls their own pom and there isn't a  
robust solution yet [1],[2],[3]

[1] http://code.google.com/p/maven-gae-plugin/
[2] http://gae-j-maven.appspot.com/
[3] http://www.sonatype.com/people/2009/04/my-google-app-engine-maven-plugin-wishlist/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Convention/XWork on GAE: unable to get members (SecurityException)

Posted by Musachy Barroso <mu...@gmail.com>.
would it help to have a maven archetype for S2 and GAE?

musachy

On Mon, Aug 24, 2009 at 1:41 AM, Philip Luppens<ph...@gmail.com> wrote:
> On Mon, Aug 24, 2009 at 10:11 AM, Jeromy
> Evans<je...@blueskyminds.com.au> wrote:
>>
>> On 24/08/2009, at 1:29 PM, Jeromy Evans wrote:
>>
>>>
>>> As a work-around (guess), I changed it to cimpl.getDeclaredClasses()
>>> instead which is permitted (I don't know if this has the same effect on the
>>> ClassLoader).  That got me past the issue above, but the same
>>> SecurityException occurs in XWork's
>>> ContainerImpl$ConstructorInjector.findConstructorIn():
>>> SecurityException: Unable to get members for Class
>>> o.a.s.v.v.VelocityManager
>>>
>>
>> This exception occurs within Google App Engine because XWork eagerly loads
>> the VelocityManager Class for the bean struts-default.xml.  VelocityManager
>> uses the VelocityToolbox optional dependency (in velocity-tools) which is
>> not deployed with the application by default.  I presume the GAE ClassLoader
>> checks all imported classes against the whitelist and fails if the class is
>> not found.
>> It's overcome by deploying the application velocity.
>>
>> I now have Struts 2.1.8-snapshot with Convention, Sitemesh and JSON, within
>> a Guice2 servlet filter for IOC, running within GAE.
>>
>> The mandatory work-around are:
>>  - to still use a ServletContextListener to disable the OgnlRuntime security
>> manager.  If not done, an IllegalAccessException occurs in
>> OgnlUtil.setProperty(String) at run-time.  This exception is swallowed, but
>> it typically results in an NPE in ServletRedirectResult.isPathUrl(String)
>> because location cannot be set.
>>  - the velocity dependencies need to be deployed with the application even
>> if not in use.  If not done, a security exception occurs while getting the
>> members of VelocityManager because VelocityManager imports VelocityToolbox
>> and VelocityEngine.
>>
>> I don't think any S2 code changes are required at this time.
>>
>> regards,
>>  Jeromy Evans
>
> Just to make sure it doesn't get lost, I've added it to the FAQ on GAE.
>
> http://cwiki.apache.org/confluence/display/WW/Google+App+Engine+%28GAE%29
>
> Feel free to clean up/clarify.
>
> Phil
>
> --
> "We cannot change the cards we are dealt, just how we play the hand."
> - Randy Pausch
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org