Hosting Apache Tapestry5.1 on GAE (Google App Engine)

Assalam Alikom

In this post, I'll try to explain the steps I took to host Tapestry5.1 on google app engine.

First of all here is my application.

A very good place to start is here. This page will help you know what will, won't or will partially work on Google app engine.

Now straight to tapestry5.1 stuff ..

public class AppModule {
public static void contributeApplicationDefaults(MappedConfiguration config)   {
  config.add(SymbolConstants.PRODUCTION_MODE, "false"); //This mainly affects how exceptions are reported, I'm   not sure - and I don't think - its vital to host tapestry   on GAE.
  config.add("tapestry.thread-pool-enabled", "false"); //Now this is a must !, GAE restriction.
  config.add(SymbolConstants.APPLICATION_VERSION, "0.1");// This is to override the random number generated by tapestry in assets paths

2)There as a compatibility issue between tapestry5 and GAE, that's why your are obviously here !, this issue has been patched and the patch is applied to the online tapestry5 trunk here
  1. Check it out (No, actually check-it out !)
  2. Compile it, skip the tests that maven runs if you face problems (and this is your own responsibility to do so.)
  3. Replace the tapestry jar files you're using with the ones you just compiled.
3)If you are using eclipse, I encourage you to download and install the Google app engine eclipse  plug-in. Specially if you'll use JDO which is explained by Google regarding it's utilization in the GAE environment.

4)Now there are some issues regarding tapestry components static files:
The following image is a snapshot for tapestry 5.0.18 hosted on GAE (It's sometimes showed properly but I got lucky catching this snapshot to demonstrate my point) :

As you can see, the style is broken, because the .css stylesheet file url is broken !
The online website is here.

I REALLY hope tapestry becomes fully compatible with GAE. It's literally like a dream come true. A magnificent development environment and a free, reliable and powerful host like GAE !!
Haward..PLEASE make Tapestry fully compatible with GAE XD

Thank you all for reading I hope you made use of this :)


  1. 5.2 is already compatible with GAE! :)

  2. Yup, And I'm already using it :)

    This post was written like 8 months ago. Back then it was only 5.1 :)

  3. It works locally for me but not on the cloud. I got this error with GAE4J 1.3.8/1.3.7 with Tapestry 5.2.0/5.2.1 -

    Failed startup of context{/,/base/data/home/apps/cloudserviceapi/1.345576400327946165}
    java.lang.RuntimeException: Exception constructing service 'ComponentClassResolver': Error invoking service builder method, InvalidationEventHub) (at (for service 'ComponentClassResolver'): Error invoking constructor, ComponentInstantiatorSource, ClassNameLocator, String, String, Collection) (at (for service 'ComponentClassResolver'): Exception constructing service 'FactoryDefaults': Error invoking constructor (at via ...(truncated)...

    Any idea how to fix it?


  4. Make sure all your jars are included in your web-inf/lib folder. Some unclear exceptions could be thrown due to the absence of a class (i.e. jar) or the duplication of one. So also make sure you don't have more than one jar that carries the same class. From the stack trace, my best guess is that you have more than one jar with the same logging class in these jars.

  5. If I included everything, I will have the following error and I don't use Spring and Hibernate (I use JDO) -

    java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext


    Exception constructing service 'ValueEncoderSource': Error invoking service builder method, InvalidationEventHub) (at (for service 'ValueEncoderSource'): Error invoking service contribution method org.apache.tapestry5.hibernate.HibernateModule.contributeValueEncoderSource(MappedConfiguration, boolean, HibernateSessionSource, Session, TypeCoercer, PropertyAccess, LoggerSource): Exception constructing service 'HibernateSessionSource': Error invoking service builder method org.apache.tapestry5.hibernate.HibernateCoreModule.buildHibernateSessionSource(Logger, List, RegistryShutdownHub) (at (for service 'HibernateSessionSource'): org/hibernate/cfg/AnnotationConfiguration

    Thus I excluded tapestry-spring-5.2.1.jar and tapestry-hibernate*.jar and it works locally but why not once deployed?

  6. I didn't mean to include every available tapestry module, I meant every jar you included in your class path, of course along with tapestry modules needed to run your application. And this includes maven dependencies.

  7. Would you kindly list out exactly what are the jar files inside your WEB-INF/lib? Thanks!

  8. I don't have T5.1 now as I'm using T5.2, here are the needed jars for a basic usage I suppose.


  9. 10/19/2010 01:01 AM 936,744 gwt-servlet.jar
    10/16/2010 12:00 PM 148,846 gwtx-1.5-20081912.jar
    10/16/2010 12:00 PM 91,794 inject-16.jar
    10/16/2010 12:00 PM 371,264 javamail-141.jar
    10/18/2010 11:27 PM 644,148 javassist-3.12.1.GA.jar
    10/19/2010 12:36 AM 192,820 jdo2-api-2.3-eb.jar
    10/16/2010 12:00 PM 302,347 jiql.jar
    10/19/2010 12:36 AM 8,082 jsr107cache-1.1.jar
    10/18/2010 11:27 PM 367,444 log4j-1.2.14.jar
    10/16/2010 12:00 PM 1,935,873 quercus.jar
    10/16/2010 12:00 PM 4,694,704 resin1.jar
    10/16/2010 12:00 PM 3,022,757 resin2.jar
    10/18/2010 11:27 PM 17,384 slf4j-api-1.5.2.jar
    10/18/2010 11:27 PM 9,501 slf4j-log4j12-1.5.2.jar
    10/19/2010 09:30 AM 0 t
    10/18/2010 11:27 PM 1,679,278 tapestry-core-5.2.1.jar
    10/18/2010 11:27 PM 47,865 tapestry-func-5.2.1.jar
    10/18/2010 11:27 PM 459,859 tapestry-ioc-5.2.1.jar
    10/18/2010 11:27 PM 24,395 tapestry-json-5.2.1.jar
    10/19/2010 07:48 AM 466,554 tapestry-test-5.2.1.jar
    10/18/2010 11:27 PM 17,110 tapestry5-annotations-5.2.1.jar
    52 File(s) 48,976,340 bytes
    2 Dir(s) 67,724,955,648 bytes free

    The latest error I see -

    Page OrderStart did not generate any markup when rendered. This could be because its template file could not be located, or because a render phase method in the page prevented rendering.
    Hide uninteresting stack frames Stack trace$36.handle(

    Do you see anything fishy or anything else that I missed? I have the same like yours.

  10. Please send me your mail. I will not publish your post so your mail should be safe.


Post a Comment

Popular posts from this blog

Testing SOAP services using pingdom