Addy is in software development at UBS working on ETD trade management systems. He has previously worked in technical consultancy for 10 years and have enjoyed working with clients/verticals ranging from media, hospitality, energy to finance. In his spare time he loves trying out new Java based technologies especially open source frameworks like Apache and Spring. Aditya has posted 4 posts at DZone. You can read more from them at their website. View Full User Profile

Using JSF 2 with Google App Engine

  • submit to reddit

Since last week I have been playing with Google App Engine (GAE) and some of the frameworks that we normally use in enterprise applications. After developing some basic servlets to get comfortable with appspot I decided to use JSF 2. I wanted to see how well it fits in GAE aware of the fact that there are quite a few caveats mentioned on GAE website regarding JSF. I followed the obvious steps mentioned on the help pages but I think they are a bit outdated.

I decided to compile a list that one can follow to successfully get JSF 2.0.1 (Mojarra) working on GAE 1.2.6. If you have followed steps provided elsewhere and are still getting the following errors beware that you might have missed one or more of the setting provided.


  1. Will it play in GAE - Gives of list of technologies which are supported on GAE
  2. Configuring JSF 2 in GAE - Configuration provided by Google but this doesn't work straightaway
  3. JSF 2 Compatibility Issues - Compatibility issues with JSF 2
  4. JSF 2 impl jar fix - Josh has kindly provided a fix for JSF impl jar which resolves the startup problem

Setup steps:

  • Follow the steps provided in the jsf configuration guide on GAE website (see Resources:2)
  • Replace the jsf-impl.jar with provided on Josh's blog page . Stack trace fixed


WARNING: Error starting handlers Throwable occurred:


  • Now you app should start up on dev box but it when you deploy it on GAE you will get the following stack trace (lower the level to debug or warning)


Nested in javax.servlet.ServletException: java.lang.RuntimeException: java.lang.ClassNotFoundException: void:
java.lang.RuntimeException: java.lang.ClassNotFoundException: void
 at org.mortbay.jetty.servlet.AbstractSessionManager.getHttpSession(
 at org.mortbay.jetty.Request.getSession(
 at com.sun.faces.application.WebappLifecycleListener.syncSessionScopedBeans(


  • In order to fix the above exception make sure following configuration are in web.xml (These are recommendations from GAE JSF2 compatibility issues: see Resources:3)


<!-- Seems like GAE 1.2.6 cannot handle server side session management. At least for JSF 2.0.1 -->
<!-- Recommendation from GAE pages  -->


  • Finally, I have noticed that sometimes objects kept in session loose data. For instance, I created a session scoped managed bean called CustomerBean and added customer name and email to it. When I move to second view, the name and email address stored in the managed bean are lost. Now this happens only on appspot not on the dev server so I can't debug and I haven't yet figured out why it this happens. I am working on a strange hack which put a token key value in the session in every request which solves the issue but I am sure why.
    If anyone has any clue why please post a comment.

Hopefully, these setting will get you started on your first JSF 2 app on Google App Engine.

Published at DZone with permission of its author, Aditya Bhardwaj.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)


Jose Maria Arranz replied on Wed, 2009/11/25 - 11:53am

When I move to second view, the name and email address stored in the managed bean are lost. Now this happens only on appspot not on the dev server so I can't debug and I haven't yet figured out why it this happens

Fixing this bug could help you, please vote for it.


Sergio Valdez replied on Tue, 2011/01/25 - 1:49pm

Thanks a lot, This is helpfully

Gilberto Da Sil... replied on Sun, 2011/09/04 - 3:46pm

Good post, but I have the same problem of lost of data.

Vamsi Krishna replied on Sun, 2014/11/02 - 7:24am

Its a great post google app engine is really helpful ssc results 2015 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.