voyent
google App Engine and Icefaces  XML
Forum Index -> General Help Go to Page: 1, 2 Next 
Author Message
georges.goebel@pch.etat.l


Joined: 23/Jun/2007 00:00:00
Messages: 276
Offline


Hi,

I tried to deploy the component showcase to the google app engine service and had (and still have) some problems.

I took the jsp part of the sample in the 1.8 distribution : ICEfaces-1.8.0-bin/icefaces/samples/component-showcase/jsp

I had to replace the jsf libs from version 1.2 to 1.1

The appengine-web.xml is ass follows :
Code:
 <?xml version="1.0" encoding="utf-8"?>
 <appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
     <application>georges-goebel</application>
     <version>2</version>
     
     <sessions-enabled>true</sessions-enabled>
     
      <static-files>
         <include path="/**.xml" />
     </static-files>
     <resource-files>
         <include path="/**.xml" />
     </resource-files>
 
 </appengine-web-app>
 


Localy it works (./dev_appserver.sh ~/apache-tomcat-6.0.18/webapps/component-showcase)

But uploading the files to Google produces the following exception :

Code:
 Failed startup of context com.google.apphosting.utils.jetty.RuntimeAppEngineWebAppContext@fd4662{/,/base/data/home/apps/georges-goebel/2.332684204379043860}
 java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)
 	at java.security.AccessControlContext.checkPermission(Unknown Source)
 	at java.security.AccessController.checkPermission(Unknown Source)
 	at java.lang.SecurityManager.checkPermission(Unknown Source)
 	at com.google.apphosting.utils.security.SecurityManagerInstaller$CustomSecurityManager.checkAccess(SecurityManagerInstaller.java:72)
 	at java.lang.ThreadGroup.checkAccess(Unknown Source)
 	at java.lang.Thread.init(Unknown Source)
 	at java.lang.Thread.<init>(Unknown Source)
 	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$Listener$1.<init>(SessionDispatcher.java:216)
 	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$Listener.contextInitialized(SessionDispatcher.java:215)
 	at com.icesoft.faces.util.event.servlet.ContextEventRepeater.contextInitialized(ContextEventRepeater.java:204)
 	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 com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:190)
 	at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:167)
 	at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:113)
 	at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:235)
 	at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4547)
 	at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4545)
 	at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
 	at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:359)
 	at com.google.net.rpc.impl.Server$2.run(Server.java:792)
 	at com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56)
 	at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:489)
 	at com.google.net.rpc.impl.Server.startRpc(Server.java:748)
 	at com.google.net.rpc.impl.Server.processRequest(Server.java:340)
 	at com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:422)
 	at com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:319)
 	at com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:290)
 	at com.google.net.async.Connection.handleReadEvent(Connection.java:419)
 	at com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:733)
 	at com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:207)
 	at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:101)
 	at com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:249)
 	at com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run(JavaRuntime.java:373)
 	at java.lang.Thread.run(Unknown Source)
 


I think Google does not permit to start threads.

Does anybody have already tried google app engine or have any clues to configure icefaces for google app.

Georges
[Email]
philip.breau


Joined: 08/May/2006 00:00:00
Messages: 2989
Offline


Hi Georges,
No, you're right. You can't start Threads with the Google App Engine, and that's one of the downsides.

"...an app cannot spawn threads, write data to the local file system or make arbitrary network connections..." 


The ICEfaces SessionDispatcher needs to start a new Thread for session monitoring.

Philip

.
georges.goebel@pch.etat.l


Joined: 23/Jun/2007 00:00:00
Messages: 276
Offline


Hi,

Are there any thoughts to make a Google app engin compatible icefaces lib ? Even if some components won't work ?

Georges
[Email]
ted.goddard

Joined: 26/Oct/2004 00:00:00
Messages: 874
Offline


It will be interesting to try component-showcase as well; for now, here's the auctionMonitor:

http://icefacesauction.appspot.com/

Several changes to the ICEfaces core were necessary relating to java.lang.Thread and java.net.InetAddress. These are not critical changes, so it should be possible to produce a functional version of ICEfaces that supports the app engine. Ajax Push is not working yet, however; that will require further investigation.
[Email]
georges.goebel@pch.etat.l


Joined: 23/Jun/2007 00:00:00
Messages: 276
Offline


Hi,

Thanks a lot, do you have the icefaces libs already available somewhere ?

Georges
[Email]
ted.goddard

Joined: 26/Oct/2004 00:00:00
Messages: 874
Offline


Here's a JIRA for Google App Engine support:

http://jira.icefaces.org/browse/ICE-4394

Please build ICEfaces from the current trunk; the changes supporting auctionMonitor have been checked in. (Note that the changes to auctionMonitor itself have not been checked in, please consult the JIRA for that.)

[Email]
georges.goebel@pch.etat.l


Joined: 23/Jun/2007 00:00:00
Messages: 276
Offline


Hi,

Tried it today but I get an exception

Code:
 com.icesoft.faces.context.View servePage: Problem encountered during View.servePage 
 javax.faces.FacesException: Can't find stream for /showcase.jspx.jsp
 


It's probably only an error in the web.xml but I don't fid it. I also played around with the defaultsuffix and servlet mapping without any luck

Any hint ?

Georges
[Email]
georges.goebel@pch.etat.l


Joined: 23/Jun/2007 00:00:00
Messages: 276
Offline


Hi

I managed to get the component showcase working on google app engine. There are some components not working and the layout is also somewhat corrupt but I starts without errors (finally)

http://georges-goebel.appspot.com

Georges
[Email]
georges.goebel@pch.etat.l


Joined: 23/Jun/2007 00:00:00
Messages: 276
Offline


Hi,

By the way here is the icefaces.jar I used and also the app engine config file

Georges
 Filename icefaces.jar [Disk] Download
 Description icefaces used
 Filesize 1075 Kbytes
 Downloaded:  306 time(s)

 Filename appengine-web.xml [Disk] Download
 Description app engine config file
 Filesize 522 bytes
 Downloaded:  613 time(s)

[Email]
ted.goddard

Joined: 26/Oct/2004 00:00:00
Messages: 874
Offline


What else did you have to modify? I see that index.jsp is implemented differently for component-showcase and auctionMonitor, was that a factor?
[Email]
ted.goddard

Joined: 26/Oct/2004 00:00:00
Messages: 874
Offline



We will need help from google to get Ajax Push working on the App Engine. Please vote here if you are interested:

http://code.google.com/p/googleappengine/issues/detail?id=377
[Email]
georges.goebel@pch.etat.l


Joined: 23/Jun/2007 00:00:00
Messages: 276
Offline


Hi,

I had to modify some classes and also to rename the "showcase.jspx" to "showcase.jspx.jsp" du to my problem explained in the previous post. But I am sure I did some mistake in the web.xml with the default suffix

In the class com.icesoft.util.MonitorRunner

Code:
 public MonitorRunner(final long interval) {
                 System.out.println("monitorrunner disabled");
 
                 /*
         try {
             Thread thread = new Thread("Monitor Runner") {
                 public void run() {
                     while (run) {
                         try {
                             Thread.sleep(interval);
                             Iterator i = new ArrayList(monitors).iterator();
                             while (i.hasNext()) {
                                 Runnable monitor = (Runnable) i.next();
                                 try {
                                     monitor.run();
                                 } catch (Throwable t) {
                                     log.warn("Failed to run monitor: " + monitor);
                                 }
                             }
                         } catch (InterruptedException e) {
                             //do nothing
                         }
                     }
                 }
             };
             thread.setDaemon(true);
             thread.start();
         } catch (Exception e)  {
             log.error("Unable to initialize Monitor Runner ", e);
         }
         */
     }
 


In the class com.icesoft.util.ServerUtility

Code:
 private static String localAddress;
     static {
                 /*
         try {
             localAddress = InetAddress.getLocalHost().getHostAddress();
         } catch (UnknownHostException exception) {
             localAddress = "127.0.0.1";
         } catch (NoClassDefFoundError e)  {
             //Google App Engine
             localAddress = "GAE";
         }*/
 
         localAddress = "GAE";
     }
 
 


In the class com.icesoft.util.IdGenerator

Code:
 public IdGenerator(String seed) {
         this.seed = seed.trim();
         this.counter = 0;
 /*
         try {
             md5 = MessageDigest.getInstance("MD5");
             ipAddress = InetAddress.getLocalHost().getHostAddress();
         } catch (NoSuchAlgorithmException e) {
             throw new RuntimeException(e);
         } catch (UnknownHostException e) {
             throw new RuntimeException(e);
         } catch (NoClassDefFoundError e)  {
             //Google App Engine
             ipAddress = "GAE";
         }
 */
             ipAddress = "GAE";
     }
 


I think that were all the modifications I had to do. But some components like the tree don't work but I do not have the time (at least not at the moment) to check why


Georges
[Email]
markbakker

Joined: 07/Sep/2006 00:00:00
Messages: 6
Offline


I found out why the Tree is not working.
It depends on javax.swing.tree classes which are not on the White list.
There is an issue for those classes, please all vote on it to have it resolved (add an star).
http://code.google.com/p/googleappengine/issues/detail?id=1313

The other solution is to copy the code of this classes to an own classes and use this in the Tree (not very nice).
[Email]
averri

Joined: 25/Mar/2007 00:00:00
Messages: 33
Offline


Hi guys, why are you so interested in make your applications coupled with Google App Engine??

My experience with it has ended, for the moment at least. The performance is too bad!!! Many seconds to show a simple JSP...

I would like to better understand the advantages you see in deploying your application to GAE (beyond the fact of been free hosting).
mores

Joined: 15/Nov/2006 00:00:00
Messages: 7
Offline


Is there a downloadable war file that has icefaces 1.8.1 and works on googles app engine ?

I have a working JSF on google app engine, but when I try to add icefaces I get:

java.lang.NullPointerException
at com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:268)
 
Forum Index -> General Help Go to Page: 1, 2 Next 
Go to:   
Powered by JForum 2.1.7ice © JForum Team