Struts 2 on GAE – java.security.AccessControlException: access denied

Problem

Developing Struts2 (v 2.3.1.2) on Google App Engine (SDK v1.6.3.1), local development, hit “java.security.AccessControlException: access denied” error?

struts 2 on gae access denied error struts 2 on gae access denied error

Solution

Normally, this is because you turn the “devMode on” in struts.xml file.

File : struts.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
 
<struts>
<constant name="struts.devMode" value="true" />
//...
</struts>

When you turn devMode on, Struts2 will try to write to the disk for logging, which is denied by GAE, it can only write to Google data store.

To solve it, you have to delete the devMode statement in your struts.xml file.

Note
In short, Struts 2 devMode is not support in GAE environment.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s