Struts 2 on GAE – Error: result ‘null’ not found


Developing Struts2 on Google App Engine, in following environment.

  1. Struts
  2. JDK 1.6
  3. Eclipse 3.7 + Google Plugin for Eclipse
  4. Google App Engine Java SDK

Just started a simple Struts2 hello world example, when access the action class, hit error “Error: result ‘null’ not found”, in both local development and real production GAE environment.

struts2 on gae - result null error


OGNL is performing some security checking, which is not support in GAE. To make Struts 2 works on GAE environment, you need to create a listener in web.xml and set the OGNL security manager to null.


Full example.

package com.mkyong.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.http.HttpSessionAttributeListener;
import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

import ognl.OgnlRuntime;

public class Struts2ListenerOnGAE implements ServletContextListener,
		HttpSessionListener, HttpSessionAttributeListener {

	public void contextInitialized(ServletContextEvent sce) {

	public void contextDestroyed(ServletContextEvent arg0) {
		// TODO Auto-generated method stub


	public void sessionCreated(HttpSessionEvent arg0) {
		// TODO Auto-generated method stub


	public void sessionDestroyed(HttpSessionEvent arg0) {
		// TODO Auto-generated method stub


	public void attributeAdded(HttpSessionBindingEvent arg0) {
		// TODO Auto-generated method stub


	public void attributeRemoved(HttpSessionBindingEvent arg0) {
		// TODO Auto-generated method stub


	public void attributeReplaced(HttpSessionBindingEvent arg0) {
		// TODO Auto-generated method stub



File : web.xml

<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns:xsi=""
	xsi:schemaLocation="" version="2.5">





  1. Issues when deploying Struts 2 on GAE

About the Author

author image
Founder of, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.


1 Comment threads
0 Thread replies
Most reacted comment
Hottest comment thread
1 Comment authors
Mohit Arvind Khakharia Recent comment authors
newest oldest most voted
Mohit Arvind Khakharia
Mohit Arvind Khakharia

Was stuck badly on this one. Thank a ton.