webtier@glassfish.java.net

Re: Can JSF 1.2_13 work in GAE?

From: <webtier_at_javadesktop.org>
Date: Sun, 19 Jul 2009 11:49:09 PDT

Today, I tried a very example of jsf 1.2_13 and facelets 1.1.15.B1 on gae/j. It worked with the appengine on my machine, but didn't work when I updated it to the web. The error

Error: Server Error
The server encountered an error and could not complete your request.

If the problem persists, please report your problem and mention this error message and the query that caused it.

didn't help at all.

This is my app structure:[code]
-- WEB-INF
      |---- lib
             |---- jsf-facelets-1.1.15.B1.jar
             |---- el-ri-1.2.jar
             |---- jsf-api-1.2_13.jar
             |---- jsf-impl-1.2_13.jar
      |---- appengine-web.xml
      |---- faces-config.xml
      |---- web.xml
-- index.html
-- index.xhtml[/code]
This is the appengine-web.xml[code]
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <application>dang-vuth</application>
    <version>1</version>
    <sessions-enabled>true</sessions-enabled>
</appengine-web-app>[/code]
This is the faces-config.xml[code]
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faces-config PUBLIC
        "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
        "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
    <application>
        <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
    </application>
</faces-config>[/code]
This is the web.xml[code]
<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5">
    <display-name>Archetype Created Web Application</display-name>
    
    <context-param>
        <param-name>facelets.REFRESH_PERIOD</param-name>
        <param-value>2</param-value>
    </context-param>
    <context-param>
        <param-name>facelets.DEVELOPMENT</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.xhtml</param-value>
    </context-param>
    <context-param>
        <description>
            Set this flag to true if you want the JavaServer Faces
            Reference Implementation to validate the XML in your
            faces-config.xml resources against the DTD. Default
            value is false.
        </description>
        <param-name>com.sun.faces.validateXml</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <description>
            Set this flag to true if you want the JavaServer Faces
            Reference Implementation to verify that all of the application
            objects you have configured (components, converters,
            renderers, and validators) can be successfully created.
            Default value is false.
        </description>
        <param-name>com.sun.faces.verifyObjects</param-name>
        <param-value>false</param-value>
    </context-param>

    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
</web-app>[/code]
This is the index.html[code]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Your Page Title</title>
<meta http-equiv="REFRESH" content="0;url=index.jsf"></HEAD>
<BODY>
You're re-directed to index.jsf.
</BODY>
</HTML>[/code]
This is the index.jsf[code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
    <title>Facelets: Number Guess Tutorial</title>
    <style type="text/css">
        body {
            font-family: sans-serif;
            font-size: small;
        }
    </style>
</head>

<body>
This is facelets!
</body>

</html>[/code]
Does anybody have any idea why this application runs in my local machine, but doesn't run when I update it to appspot?

If I use jsp and servlets then it works. That means my update method is correct.

Thank you.
[Message sent by forum member 'dxxvi' (dxxvi)]

http://forums.java.net/jive/thread.jspa?messageID=356473