14 Replies Latest reply: Jan 24, 2010 3:57 PM by Marcin Zajaczkowski RSS

Seam + Google App Engine = ?

Lex Siman Newbie

Such as Google App Engine now supports Java, I am intresting
is it possible to use Seam with Google App Engine?

  • 1. Re: Seam + Google App Engine = ?
    Dan Allen Master

    Give it a try! I would start by using a plain old tomcat example since they are saying they only have select Java EE APIs, such as the servlet API, JPA, and JavaMail. That means disabling Seam's transaction management. Not sure about how to configure JPA. Do they have JNDI for doing data sources? Otherwise, you might have to define the JDBC connection properties using JPA properties.

  • 2. Re: Seam + Google App Engine = ?
    Mikael Andersson Master

    Have anyone gotten it to run via the Eclipse plugin on localhost?


    I just gave it a quick try and got the error below. I'll keep looking.


    9-Apr-2009 11:08:24 org.jboss.seam.security.permission.PersistentPermissionResolver initPermissionStore
    WARNING: no permission store available - please install a PermissionStore with the name 'org.jboss.seam.security.jpaPermissionStore' if persistent permissions are required.
    09-Apr-2009 11:08:29 com.google.apphosting.utils.jetty.JettyLogger warn
    WARNING: failed com.google.apphosting.utils.jetty.DevAppEngineWebAppContext@cfe049{/,C:\dev\eclipse_workspaces\playgroundews\gae\war}
    java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;
         at com.sun.faces.config.ConfigureListener.registerELResolverAndListenerWithJsp(ConfigureListener.java:557)
         at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:212)
         at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:530)
         at org.mortbay.jetty.servlet.Context.startContext(Context.java:135)
         at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218)
         at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500)
         at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
         at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
         at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
         at org.mortbay.jetty.Server.doStart(Server.java:217)
         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
         at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:147)
         at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:115)
         at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:205)
         at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:136)
         at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
         at com.google.appengine.tools.development.DevAppServerMain.<init>(DevAppServerMain.java:90)
         at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:84)
    09-Apr-2009 11:08:29 com.google.apphosting.utils.jetty.JettyLogger warn
    WARNING: failed JettyContainerService$ApiProxyHandler@1778d0c
    java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;
         at com.sun.faces.config.ConfigureListener.registerELResolverAndListenerWithJsp(ConfigureListener.java:557)
         at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:212)
         at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:530)
         at org.mortbay.jetty.servlet.Context.startContext(Context.java:135)
         at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218)
         at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500)
         at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
         at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
         at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
         at org.mortbay.jetty.Server.doStart(Server.java:217)
         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
         at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:147)
         at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:115)
         at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:205)
         at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:136)
         at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
         at com.google.appengine.tools.development.DevAppServerMain.<init>(DevAppServerMain.java:90)
         at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:84)
    09-Apr-2009 11:08:29 com.google.apphosting.utils.jetty.JettyLogger warn
    WARNING: Error starting handlers
    java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;
         at com.sun.faces.config.ConfigureListener.registerELResolverAndListenerWithJsp(ConfigureListener.java:557)
         at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:212)
         at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:530)
         at org.mortbay.jetty.servlet.Context.startContext(Context.java:135)
         at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218)
         at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500)
         at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
         at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
         at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
         at org.mortbay.jetty.Server.doStart(Server.java:217)
         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
         at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:147)
         at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:115)
         at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:205)
         at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:136)
         at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
         at com.google.appengine.tools.development.DevAppServerMain.<init>(DevAppServerMain.java:90)
         at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:84)
    


  • 3. Re: Seam + Google App Engine = ?
    Ronald van Kuijk Apprentice

    Sounds more like a question for the google app engine forum

  • 5. Re: Seam + Google App Engine = ?
    Lex Siman Newbie

    I briefly read Google App Engine docs and found there many limitations for Java EE. One of them:



    An application cannot write to the file system.

    Also Google App Engine for Java group says:



    While we do not support the entirety of the Java EE specification, we support many of its individual components.


    • Java Naming and Directory Interface (JNDI) - Not supported.




    • Enterprise Java Beans (EJB) - Not supported. Alternatives to entity beans include JDO and JPA.




    • Hibernate - You cannot currently use Hibernate directly. The differences between the App Engine datastore and SQL were too great to get the standard Hibernate up and running under App Engine. However, App Engine does support JPA, so you may be able to convert your Hibernate code to use JPA.



    This means that we cannot use Hibernate, Hibernate Search (Lucene) and other interesting stuff... So is there any chance to turn up Seam framework to be used with Google App Engine?


  • 6. Re: Seam + Google App Engine = ?
    Dan Allen Master

    It strikes me as odd that they support JPA and not Hibernate. What that means is that they have their own JPA provider for BigTable and likely it is fairly crippled. No one can write a complete JPA implementation without bugs in such a short amount of time because the domain is too complex (okay, it is Google, but we have bright folks at JBoss too).


    Overall, it sounds to me pretty crippled. If you are a believer in Java EE (think JBoss AS, not Tomcat) then you are really going to be let down. That's why I said start with the plain old Tomcat Seam apps and see if you can get those running, at least.

  • 7. Re: Seam + Google App Engine = ?
    demetrio812 Apprentice

    Hi,
    I've made a fast try using JSF 1.1 and it worked perfectly (I used the JBoss Tools template), here the steps to do that and here the online demo.


    I will try with JSF 1.2 and RichFaces...about Seam I will try but I think it will not work out-of-the-box as it gives a limited support for J2EE specifications (for now!)...


    Demetrio

  • 8. Re: Seam + Google App Engine = ?
    demetrio812 Apprentice

    Hi,
    I'm trying with JSF 1.2 and Facelets but it doesn't start, it gives me this error:



    WARNING: Failed startup of context com.google.apphosting.utils.jetty.DevAppEngineWebAppContext@5ff5aa{/,/Users/denny/workspace2009/FirstApp/war}
    com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! access denied (java.lang.RuntimePermission modifyThread)
         at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:213)
         at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:196)
         at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:530)
         at org.mortbay.jetty.servlet.Context.startContext(Context.java:135)
         at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218)
         at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500)
         at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
         at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
         at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
         at org.mortbay.jetty.Server.doStart(Server.java:217)
         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
         at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:147)
         at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:115)
         at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:205)
         at com.google.appengine.tools.development.gwt.AppEngineLauncher.start(AppEngineLauncher.java:86)
         at com.google.gwt.dev.HostedMode.doStartUpServer(HostedMode.java:365)
         at com.google.gwt.dev.HostedModeBase.startUp(HostedModeBase.java:590)
         at com.google.gwt.dev.HostedModeBase.run(HostedModeBase.java:397)
         at com.google.gwt.dev.HostedMode.main(HostedMode.java:232)
    Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThread)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
         at java.security.AccessController.checkPermission(AccessController.java:427)
         at java.util.concurrent.ThreadPoolExecutor.shutdown(ThreadPoolExecutor.java:893)
         at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:301)
         at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:203)
         ... 20 more




    It raises the exception during the call:


                try {
                    CONFIG_PROCESSOR_CHAIN.process(getConfigDocuments(sc));
                } catch (Exception e) {
                    // clear out any configured factories
                    releaseFactories();
                    if (LOGGER.isLoggable(Level.FINE)) {
                        LOGGER.log(Level.FINE,
                                   "Unsanitized stacktrace from failed start...",
                                   e);
                    }              
                    Throwable t = unwind(e);
                    throw new ConfigurationException("CONFIGURATION FAILED! " + t.getMessage(),
                                                     t);
                }



    If you debug the code the call that raises the exception is inside the method:



    private static Document[] getConfigDocuments(ServletContext sc) {
           ExecutorService executor =
                 Executors.newFixedThreadPool(NUMBER_OF_TASK_THREADS);
    
           ..... code .....
    
           executor.shutdown(); <!-- ERROR -->
    
           ..... return code .....
    }



    I think there is a security problem on thread managing (some App Engine limitation)...


    Is there someone that understand this code better than me and figure out how to fix this?


    Thanks


    Demetrio

  • 9. Re: Seam + Google App Engine = ?
    Mikael Andersson Master

    I tried both Mojarra and MyFaces 1.2 without any luck.


    Currently got myfaces 1.1 working (with facelets and richfaces 3.1.6).


    Haven't gotten around to try with Seam yet, not sure which the latest version supporting jsf 1.1.

  • 10. Re: Seam + Google App Engine = ?
    Mikael Andersson Master

    Does anyone know which the latest Seam version is that works with JSF 1.1?


    Just tried it with the latest Seam but that doesn't seem to work.


    Cheers,
    Micke

  • 11. Re: Seam + Google App Engine = ?
    Thomas Hug Newbie

    Running both JSF 1.2 RI as well as Seam requires a couple of patches. I managed to get something very basic running on App Engine, some more details here (still contains a couple of quick hacks :-).

  • 12. Re: Seam + Google App Engine = ?
    Lex Siman Newbie

    Very cool! Thanx for your article.


    But running Seam on GAE is so tricky... so many ugly hacks... E.g. how to implement full-text search based on Lucene (Hibernate Search)? Is there any simple approach to store search indexes into the Google datastore (e.g. using JPA?)?


    And it seems like Seam app for GAE is not portable.

  • 13. Re: Seam + Google App Engine = ?
    I need a real name Newbie

    Lex Siman wrote on Apr 20, 2009 15:04:


    E.g. how to implement full-text search based on Lucene (Hibernate Search)? Is there any simple approach to store search indexes into the Google datastore (e.g. using JPA?)?

    And it seems like Seam app for GAE is not portable.


    i also need hibernate search in gae... any ides like the above how to manage this?!

  • 14. Re: Seam + Google App Engine = ?
    Marcin Zajaczkowski Newbie

    I need a real name wrote on Apr 26, 2009 12:29:

    i also need hibernate search in gae... any ides like the above how to manage this?!


    As an alternative you can take a look at Compass Project which has similar features and can work with pure JPA (and with much more).
    See post on its author's blog:

    http://www.kimchy.org/searchable-google-appengine-with-compass/


    Marcin