Problem with JSF: strange exception !

Hello friends :)
i have a web application with JSF1.2 with the next libraries:
- jsf-api-1.2_07.jar  (SUN-RI)
- jsf-impl-1.2_07.jar (SUN-RI)
- jsf-facelets-1.1.14.jar
- tomahawk-1.1.6 (apache.myfaces)
I have in my application a custom tag that was developed based on tomahawk-1.1.6 library. This tag displayes
a form that is obtained by web services.
So, when i run the application, i have a index.jsp that redirect to form.jspx (here is the tag) and i can see the form well and in this point it is right, the custom tag works ok. But when i push a bottom to refresh or save the form, and the request arrives to server, it response me with the following exception: (not reach the controller)
*20/10/2009 11:58:13 [http-8080-Processor24] INFO fuentes.ListenerFase - Estamos en el método beforePhase RESTORE_VIEW 1*
*20-oct-2009 11:58:13 com.sun.faces.renderkit.ResponseStateManagerImpl getTreeStructureToRestore*
GRAVE: Not in GZIP format
**java.io.IOException: Not in GZIP format**
     at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:132)
     at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:58)
     at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:68)
     at com.sun.faces.renderkit.ResponseStateManagerImpl.getTreeStructureToRestore
(ResponseStateManagerImpl.java:172)
*GRAVE: JSF1054: (Phase ID: RESTORE_VIEW 1, View ID: ) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@14510ac]*
*20/10/2009 11:58:13 [http-8080-Processor24] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[pruebaLibreriasCliente].[Faces Servlet] - Servlet.service() para servlet Faces Servlet lanzó excepción*
java.io.IOException: Not in GZIP format
     at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:132)
     at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:58)
     at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:68)
     at com.sun.faces.renderkit.ResponseStateManagerImpl.getTreeStructureToRestore
(ResponseStateManagerImpl.java:172)
I dont understand why this happening. It seems as if the server dont understand the format data request.
I think the custom tag is ok and it is not the problem. Maybe the problem is configuration, but i dont know.
Thank you so much for you help!

This component or custom tag has worked well in others similar projects (somebody told me that).
But, where does it define the component state? what do i need to define it?
It is de custom tag:
*<viaform:formulario clienteHandler="#{formularioPageBean.formularioHandler}"*
*     action="#{formularioPageBean.actionFormularioEnd}"*
*     actionListener="#{formularioPageBean.actionFormularioRefresh}" />*
Thank you very much

Similar Messages

  • Very big problem with JSF about FORM and "id=" for HTML form's elements and

    I have discovered a very big problem with JSF about FORM and "id=" for HTML form's elements and java instruction "request.getParameterNames()".
    Suppose you have something like this, to render some datas form a Java Beans :
    <h:dataTable value="#{TablesDb2Bean.myDataDb2ListSelection}" var="current" border="2" width="50%" cellpadding="2" cellspacing="2" style="text-align: center">
    <h:column>
    <f:facet name="header">
    <h:outputText value="Name"/>
    </f:facet>
    <h:outputText id="nameTableDb2" value="#{current.db2_name_table}"/>
    </h:column>
    </h:dataTable>
    Everything works fine...
    Suppose you want to get the name/value pairs for id="nameTableDb2" and #{current.db2_name_table} to process them in a servlet. Here is the HTML generated :
    <td><span <span class="attribute-name">id=<span class="attribute-value">"j_id_jsp_1715189495_22:0:nameTableDb2">my-table-db2-xxxxx</span></td>
    You think you can use the java instructions :
    Enumeration NamesParam = request.getParameterNames();
    while (NomsParam.hasMoreElements()) {
    String NameParam = (String) NamesParam.nextElement();
    out.println("<h4>"++NameParam+ "+</h4>);
    YOU ARE WRONG : request.getParameterNames() wants the syntax *name="nameTableDb2" but JSF must use id="nameTableDb2" for "<h:outputText"... So, you can't process datas in a FORM generated with JSF in a Servlet ! Perhaps I have made an error, but really, I wonder which ?
    Edited by: ungars on Jul 18, 2010 12:43 AM
    Edited by: ungars on Jul 18, 2010 12:45 AM

    While I certainly appreciate ejb's helpful responses, this thread shows up a difference in perspective between how I read the forum and how others do. Author ejb is correct in advising you to stay inside JSF for form processing if form processing is what you want to do.
    However, I detect another aspect to this post which reminds me of something Marc Andreesen once said when he was trying to get Netscape off the ground: "there's no such thing as bad HTML."
    In this case, I interpret ungar's request as a new feature request. Can I phrase it like this?
    "Wouldn't it be nice if I could render my nice form with JSF but, in certain cases, when I REALLY know what I'm doing" just post out to a separate servlet? I know that in this case I'll be missing out on all the nice validation, conversion, l10n, i18n, ajax, portlet and other features provided by JSF".
    If this is the case, because it really misses the point of JSF, we don't allow it, but we do have an issue filed for it
    https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=127
    If you can't wait for it to be fixed, you could decorate the FormRenderer to fix what you want.
    I have an example in my JSF book that shows how to do this decoration. http://bit.ly/edburnsjsf2
    Ed

  • Problems with JSF and included subviews

    Hi everybody,
    I' ve got a problem with JSF and included subviews which makes me going
    crazy. I've got no clue why my web-pages are represent wrongly. The only
    tip I've got is that it must be connected with the kind I do include my JSF-pages.
    When I use <%@file="sub.jsp"%> my pages are are represent right. When I use <jsp:include page="Sub.jsp" /> or <c:import url="Sub.jsp" /> ( mark: the usage of flush="true" or flush="false" doesn't matter )
    my pages are represent wrongly.
    The usage of tags like f:facet or f:verbatim were also included but didn't point to an solution.
    I searched the whole Sun Developer Forum and some other web-sites for any solution for my problem but the given hints and clues didn't help. Now I'm trying to post my problem directly in Sun's Forum in hope to get help.
    My environment is the following:
    JAVA JDK 1.5 Update 4
    Tomcat 5.5.9
    JSLT 1.1
    Sun JSF 1.1
    Win 2K
    Here's my code:
    Main.jsp
    <%@ page language="java"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%
              String path = request.getContextPath();
              String basePath = request.getScheme() + "://" + request.getServerName()
                        + ":" + request.getServerPort() + path + "/";
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
         <base href="<%=basePath%>">
         <meta http-equiv="pragma" content="no-cache">
         <meta http-equiv="cache-control" content="no-cache">
         <meta http-equiv="expires" content="0">   
         <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
         <meta http-equiv="description" content="This is my page">
         <link rel="stylesheet" href="stil.jsp" type="text/css" />
    </head>
    <body>
         <f:view>
              <h:form>
                   <div class="table">
                        <div class="tr">
                             <h:outputText styleClass="tdleft" value="value 1"/>
                             <h:outputText styleClass="tdinfo" value="value 2"/>
                        </div>
                        <div class="tr">
                             <h:outputText styleClass="tdleft" value="value 3"/>
                             <h:outputText styleClass="tdinfo" value="value 4"/>
                        </div>
                   </div>
              </h:form>     
              <jsp:include page="Sub.jsp" />
         </f:view>
    </body>
    </html>Sub.jsp
    <%@ page language="java"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <f:subview id="subview">
         <h:form>
              <div class="table">
                   <div class="tr">
                             <h:outputText styleClass="tdleft" value="value 11"/>
                             <h:outputText styleClass="tdinfo" value="value 22"/>
                   </div>
                   <div class="tr">
                        <h:outputText styleClass="tdleft" value="value 33"/>
                        <h:outputText styleClass="tdinfo" value="value 44"/>
                   </div>
              </div>
         </h:form>
    </f:subview>stil.jsp
    <%@page contentType="text/css"%>
    <%
        String  schwarz     = "#000000",
                grau1       = "#707070",
                grau2       = "#c0c0c0",
                grau3       = "#e0e0e0",
                grau4       = "#e8e8e8",
                grau5       = "#fdfdfd",
                blau        = "#0000dd",
                tuerkis     = "#00cfff";
        String  liniendicke = "1px",
                linienart   = "solid";
        String allgemeineTextFarbe           = schwarz;
        String allgemeineHintergrundFarbe    = grau3;
        String infoTextFarbe                 = blau;
        String fieldsetRandFarbe             = blau;
        String fieldsetRandDicke             = liniendicke;
        String fieldsetRandArt               = linienart;
        String hrLinienFarbe                 = blau;
        String hrLinienDicke                 = liniendicke;
        String hrLinienArt                   = linienart;
        String inputAktivHintergrundFarbe    = grau5;
        String inputReadonlyHintergrundFarbe = grau4;
        String inputPassivHintergrundFarbe   = grau4;
        String inputPassivFarbe              = schwarz;
        String inputRandFarbe1               = grau1;
        String inputRandFarbe2               = grau5;
        String inputRandDicke                = liniendicke;
        String inputRandArt                  = linienart;
        String inputButtonHintergrundFarbe   = grau3;
        String legendenFarbe                 = blau;
        String linkFarbe                     = blau;
        String linkAktivFarbe                = tuerkis;
        String linkBesuchtFarbe              = blau;
        String linkFocusFarbe                = tuerkis;
        String objectGitterFarbe             = grau5;
        String objectGitterDicke             = liniendicke;
        String objectGitterArt               = linienart;
        String tabellenGitterFarbe           = grau5;
        String tabellenGitterDicke           = liniendicke;
        String tabellenGitterArt             = linienart;
    %>
    <%-- ----------------------------------------------- --%>
    <%-- Textdarstellung mittels der Display-Eigenschaft --%>
    <%-- in den Tags div und span                        --%>
    <%-- ----------------------------------------------- --%>
    *.table {
        display:table;
        border-collapse:collapse;
    *.tbody {
        display:table-row-group;
    *.tr {
        display:table-row;
    *.td,*.tdright,*.tdleft,*.tdinfo,*.th {
        display:table-cell;
        padding:3px;
        vertical-align:middle;
    *.td,*.th {
        text-align:center;
    *.tdright {
        text-align:right;
    *.tdleft {
        text-align:left;
    *.tdinfo {
        color:<%=infoTextFarbe%>;
        text-align:right;
    *.th {
        color:<%=infoTextFarbe%>;
        font-weight:bold;
    }thanks in advance
    benjamin

    Hello Zhong Li,
    many thanks for your post, but it didn't work.
    My problem is that the JSF-Components im my included or imported
    JSP-Pages does not accept any kind of style or styleClass for
    designing. The components take over the informations for colors
    but not for alignment.
    When I take a look at the generated JAVA-Source in $TOMCAT/WORK/WEBAPP for my sub.jsp ( sub.java )
    it seems that the resulting HTML-page would be presented correctly.
    But later when I start the application via Firefox or Mozilla the html-sourcecode is totally wrong.
    In my example I create a simple grid with 2 rows and 2 columns.
    Both columns contains JSF-Outtext-Components and are included with div-tags.
    The generated Sub.java shows that the text would be setted in the div-tags. Unfortunately the html-sourcecode represented by my browser shows that jsf-text is not setted in the tags but in the <h:form> tags. The div-tags are neither rounded by <h:form> nor containing the JSF-OutText-Components.
    Any clue?
    Many thanks Benjamin
    Here is the html-code from Firefox:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
         <base href="http://polaris21:8080/webtest/">
         <meta http-equiv="pragma" content="no-cache">
         <meta http-equiv="cache-control" content="no-cache">
         <meta http-equiv="expires" content="0">   
         <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
         <meta http-equiv="description" content="This is my page">
         <link rel="stylesheet" href="stil.jsp" type="text/css" />
    </head>
    <body>
         <form id="_id0" method="post" action="/webtest/Main.faces" enctype="application/x-www-form-urlencoded">
              <div class="table">
                   <div class="tr">
                        <span class="tdleft">value 1</span>
                        <span class="tdinfo">value 2</span>
                   </div>
                   <div class="tr">
                        <span class="tdleft">value 3</span>
                        <span class="tdinfo">value 4</span>
                   </div>
              </div>
              <input type="hidden" name="_id0" value="_id0" />
         </form>     
          <form id="SUB:_id5" method="post" action="/webtest/Main.faces" enctype="application/x-www-form-urlencoded">
               <span class="tdleft">value 11</span>
              <span class="tdinfo">value 22</span>
              <span class="tdleft">value 33</span>
              <span class="tdinfo">value 44</span>
              <input type="hidden" name="SUB:_id5" value="SUB:_id5" />
         </form>
         <div class="table">
              <div class="tr">
              </div>
              <div class="tr">
              </div>
         </div>
    </body>
    </html>

  • Problem with jsf DataTable

    when data is fetch using user criteria:
    i have a problem with jsf DataTable. I use e request bean to populate the datatable and i insert a commandButton column. The data dispay successfully into the datatable, but when a push the button on the row...the page simply refresh and notinhg else
    when data is fetch using constants:
    The data dispay successfully into the datatable, when a push the button on the row...the action execute OK

    Hi,
    I don't think that with this description only anybody on this list is able to help you.
    I use e request bean to populate the datatable and i insert a commandButton column
    What is a command button column and what does it do ?
    but when a push the button on the row...the page simply refresh and notinhg else
    What did you do to debug the problem ?
    when data is fetch using constants
    What does this mean ?
    Frank

  • Tunneling and problem with unknown host exception

    hello! i've got a problem with https. i use jdk 1.5.0, jboss-4.0.4.ga-patch1, soap.
    and i'm going crasy.. i've testet my client code at our network and it works fine. but if i want to get jobs from the server of our customer, my client throw an "unknown host exception: firm".
    i wonder why it hasn't the full host. the url may look like this: https://firm.sub.com:443/ and while the client connects to the server, i depugged it and the host is correct: firm.sub.
    but after the connection, when the client want to get something from the server (when it wants to communicate with the server over soap) it crashs.
    my client code looks like this:
    private ClientInterfaceEndpoint getClientInterface() throws ServiceException {
    QName serviceQName = new QName(DOCSERVER_NAMESPACE, CLIENT_INTERFACE_SERVICENAME);
    URL wsdlUrl = getClientInterfaceWsdlUrl();
    log.info("*******WSDLURL host: " + wsdlUrl.getHost()); // out: firm.sub
    log.info("*******WSDLURL port: " + wsdlUrl.getPort()); // out: 443
    URL mapping = getClass().getClassLoader().getResource("META-INF/DocumentServer_Mapping.xml");
    log.info("*******MappingURL path: " + mapping.getPath());
    if (wsdlUrl.toString().toLowerCase().contains("https")) {
    if (null == getConfig().getTruststore() || getConfig().getTruststore().equalsIgnoreCase("")) {
    throw new RuntimeException("No or incorrect TruststorePath in the docclient-config");
    File tmp = new File(getConfig().getTruststore());
    if (!tmp.isFile() || !tmp.canRead()) {
    throw new RuntimeException("The truststore at the 'TruststorePath' isn't a file or can't be read.");
    System.setProperty(SYS_PROPERTY_KEY_TRUST, getConfig().getTruststore());
    System.setProperty(SYS_PROPERTY_KEY_TRUST_PW, config.getTruststorePass());
    ServiceFactoryImpl factory = null;
    factory = (ServiceFactoryImpl) ServiceFactory.newInstance();
    Service clientInterfaceService = null;
    try {// create the service for the ClientInterface
    clientInterfaceService = factory.createService(wsdlUrl, serviceQName, mapping, new URL(config.getServerURL())); //, new URL(config.getServerURL())
    log.info("*******ClientInterFaceService WSDL URL Host: " + clientInterfaceService.getWSDLDocumentLocation().getHost()); // out:firm.sub
    log.info("*******ClientInterFaceService WSDL URL Port: " + clientInterfaceService.getWSDLDocumentLocation().getPort()); // out: 443
    } catch (ServiceException e) {
    log.error(e.getMessage());
    throw new RuntimeException(e.getMessage());
    } catch (MalformedURLException e) {
    log.error(e.getMessage());
    throw new RuntimeException(e.getMessage());
    } catch (Exception e) {
    log.error(e.getMessage());
    throw new RuntimeException(e.getMessage());
    }// getting the ClientInterfaceEndpoint
    ClientInterfaceEndpoint clientInterface = (ClientInterfaceEndpoint) clientInterfaceService.getPort(ClientInterfaceEndpoint.class);
    return clientInterface;
    protected URL getClientInterfaceWsdlUrl() {
    URL url = null;
    String urlString = getConfig().getServerURL() + CLIENT_INTERFACE_URI + "?wsdl";
    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    Properties properties = System.getProperties();
    String handlers = System.getProperty(SYS_PROPERTY_KEY_PKGS);
    if (handlers == null) {
    properties.put(SYS_PROPERTY_KEY_PKGS, SYS_PROPERTY_VALUE_PKGS);
    else {
    properties.put(SYS_PROPERTY_KEY_PKGS, SYS_PROPERTY_VALUE_PKGS.concat("|").concat(handlers));
    try {
    url = new URL(urlString);
    log.info("*******URL host: " + url.getHost());
    log.info("*******URL port: " + url.getPort());
    log.info("*******URL path: " + url.getPath());
    } catch (MalformedURLException e) {
    log.fatal("DocumentProvider SOAP configured incorrectly. DocServer URL malformed: " + urlString);
    throw new RuntimeException("DocumentProvider SOAP configured incorrectly. DocServer URL malformed: " + urlString, e);
    System.setProperties(properties);
    return url;
    }if it's usefull: the customer use a apache server (not tomcat) where a the server is and the client at another system the jboss.
    The customer told me: if i want to connect the client via http i have to tunnel.. maybe i have to tunnel using https too?
    have i to generate the endpoint classes a second time, extra for https?
    or doesn't soap like host like "firm.sub"?
    can anyone help me please?!
    sorry, my english isn't very well...

    sorry, it's not the same error. The output is: Unable to connect to any host due to exception: java.net.socket.exception: java.net.socket.exception: Unregcognized windows socket error: 10106: create.

  • How to solve problem with JSF table's border (style) ??

    Hi, I would like to create table in JSF like this
                   <table  align="center"
                             width="250"
                             style="border-collapse: collapse; border: 1px black solid;" >
                   <tr>
                        <td align="center"
                             colspan="2"
                             style="border: 1px black solid;">
                             Header A
                        </td>               
                   </tr>
                   <tr>
                        <td> a1 </td>
                        <td> a2 </td>
                   </tr>
                   <tr>
                        <td> b1 </td>
                        <td> b2 </td>
                   </tr>
                   <tr>
                        <td align="center"
                             colspan="2"
                             style="border: 1px black solid;" >                          
                             <BUTTON value="12" > button1 </BUTTON>
                             <BUTTON value="12">  button2 </BUTTON>
                        </td>
                   </tr>
                   </table>I don't know how to create borders like this with JSF's components.
    I know how to create table and collspan, but I have a problem with
    border and style.
    below is example that I creat it, but borders are not OK
    IF ANYONE FIND SOLUTION I WILL BE TANKFUL
    JSF:
    <hx:panelBox id="box1"
               layout="pageDirection"
               bgcolor="silver"
               align="center"
               style="border: 1px red solid;"
               border="0">
              <hx:panelBox id="box2" layout="pageDirection" width="100%" bgcolor="#aec74e" height="100%" align="center" style="border: 1px black solid;">
                   <center>
                        <h:outputText styleClass="outputText" id="text9" value="Prazniki"></h:outputText>
                   </center>                         
              </hx:panelBox>
              <h:panelGrid styleClass="panelGrid" id="grid1" columns="3">
                   <h:outputText styleClass="outputText" id="text4" value="#{msgs.planDan}">
                   </h:outputText>
                   <h:inputText styleClass="inputText" id="text3" value="#{pc_Koledar.praznikBean.dan}">
                   </h:inputText>
                   <f:verbatim></f:verbatim>
                   <h:outputText styleClass="outputText" id="text5" value="#{msgs.planMesec}">
                   </h:outputText>
                   <h:selectOneMenu styleClass="selectOneMenu" id="menu1" value="#{pc_Koledar.praznikBean.selectedMesec}">          
                    <f:selectItems value="#{pc_Koledar.praznikBean.meseci}" />          
                   </h:selectOneMenu>
                   <f:verbatim></f:verbatim>
                   <h:outputText styleClass="outputText" id="text6" value="#{msgs.planLeto}">
                   </h:outputText>
                   <h:inputText styleClass="inputText" id="text2" value="#{pc_Koledar.praznikBean.leto}">
                   </h:inputText>
                   <f:verbatim></f:verbatim>
                   <h:outputText styleClass="outputText" id="text7" value="#{msgs.nazivPraznika}">
                   </h:outputText>
                   <h:inputText styleClass="inputText" id="text1" value="#{pc_Koledar.praznikBean.nazivPraznika}">
                   </h:inputText>
                   <f:verbatim></f:verbatim>
              </h:panelGrid>
              <hx:panelBox id="box3"           
                         align="center"
                         layout="lineDirection"
                         width="100%"
                         style="border: 1px black solid;" bgcolor="#aec74e">
                        <center>
                          <hx:commandExButton type="submit" value="Dodaj" id="button1" action="#{pc_Koledar.doButton1Action}" lang="CP1250">
                          </hx:commandExButton>
                           <hx:commandExButton type="submit" id="button3" action="#{pc_Koledar.doButton3Action}" value="Prika�">
                          </hx:commandExButton>
                        </center>
              </hx:panelBox>
    </hx:panelBox>

    Couldn't you use styleClass or id for CSS?

  • Problem with JSF components

    I am having problem with myfaces tomhawk components in a portal environment
    They work fine as a standalone web application
    When we make it a portlet, they render properly, but the pagination and links in the calendar components are not working
    They submit the page to the server, but does nothing

    Hi,
    WLP 9.2 will be using the Sun RI for JSF portlets. We are going to certify with Apache MyFaces post GA.
    The Beta drop of WLP 9.2 is coming soon and you will be able to do more around development.
    We appreciate you taking the time to review the product and provide feedback.
    Regards,
    --alex                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Problem with JSF

    Hello,
    I have a problem with finishing my project which is based on JSF, Hibernate and EJB technologies. The matter is that I�ve built the application which manages a group of reports and assign sections and reports to the single user. I have two types of users, simple users and administrators. Simple user log in to the system and is able to generate reports which were assigned to him by admin. In the system can be more than just a one administrator. The problem is when one administrator is on-line and another log in to the system. Then both of them are working on the same instances of classes. In JSF files I�m working on created session beans which are defined in faces-config file. I�m new in JSF so maybe my attitude to this technology is not correct. If anyone know how to solve my problem please help me �
    Regards
    krabu

    Akash_Ganga wrote:
    The same instance of LoginBean.class is used by both of administrators and this is the problem ...The above statement is wrong. There are two different sessions for the two users. You are probably seeing data because its persisted in the database by one user and when the next user logs in, the application fetches data from the DB and displays it. Its more of a design problem if you do not want the second user to see the data which the first user has entered.Akash,
    I think we do not understand each other. My application is really simple. Simple user is able to see some links to reports when log in to the system or not. It depends on administrator which is able, in the form I've mentioned before, to assign the right to see a report by a user or not. I don't know what do you mean by saying "There are two different sessions for the two users".
    To explain you what the problem is try to follow such a situation. Let say we have two classes : LoginBean.class and EditForm.class. Based on that classes we create two session beans : loginBean and editForm in faces-config file as follows:
            <managed-bean>
              <managed-bean-name>
              loginBean</managed-bean-name>
              <managed-bean-class>
              log.LoginBean</managed-bean-class>
              <managed-bean-scope>
              session</managed-bean-scope>
         </managed-bean>
         <managed-bean>
              <managed-bean-name>
              editForm</managed-bean-name>
              <managed-bean-class>
              log.EditForm</managed-bean-class>
              <managed-bean-scope>
              session</managed-bean-scope>
         </managed-bean> We have also created two JSF files, one login.jsf which include authorization component based on loginBean and second: editForm.jsf which include a SelectOneMenu component to choose a user and a form to assign selected user a report based on editForm bean.
    We log in to the system as a administration. We are after authorization and enter the editForm.jsf file. We choose a user from SelectOneMenu component and make some changes in the form. But we do not submit anything and do NOT send it to the database. In this moment another administrator log-in, go to the editForm.jsf file and after that he sees that in his selectOneMenu component a user is chosen and the form is filled with data entered by prevoius administrator.
    I'm new in JSF but I've thought that when I create a session bean a new instance of bean ( new instance of class ) is created for all users which try to use it, or maybe I'm doing something wrong or should write some additional code to achieve such a function ...

  • Problem with JSF nad sessionid in URL

    Hello,
    I'm useing NetBeans with Tomcat (JSF), and I have a problem with URL. I don't know how to remove the following part of ULR: ";sessionid=#ED..." form my browser. It is a big problem with security.
    Thanks for Your answers

    are you using the GET method? try using POST

  • Reflection problems with null pointer exception

    I am having a problem with reflection. I keep getting a NullPointerException and can't figure out why.
    It is happening when I call this:
    ResponseObject result = (ResponseObject)method.invoke(classInstance, argArray);
    I can't figure out what the problem is. I had this reflection working, and then I made some changes to how the argument array was created. In the end, the argarray is the same.
    Any ideas?

    Also, the API for the method class says that a
    NullPointerException is thrown if the object in the
    first argument is null. I have tested for this, and
    it is not null.does it? read again, because giving 'null' as the first argument is perfectly legal. how else would you reflectively invoke a static method, since you might not have an actual instance of the class to pass

  • CPU utilization problem with JSF

    Hi,
    I am using MyFaces 1.1.4 and tomahawk 1.1.3.
    I am using EJB 2.0 and weblogic server 9.2
    I have a problem with the performance of my application. The response time for 500 concurrent users is arnd 10sec. However, the CPU utilization normally hits *95-97%.*
    I have disabled all the logging to reduce the file IO. Also, all the code has been optimised. Still the problem exists. Now, I cannot think of any way to overcome this. My project is getting delayed because of this.
    Request you all to pls help.
    Regards,
    Milan.

    What type of server or servers are you using. I am assuming which I hate to do is that your EJB's are for CRUD and you a connection pool. Have tried to optimize the DB connection pool's ?.

  • Problem with JSF AJAX portlets

    I am seeing the following issues with JSF portlets
    1) When you AJAX enable the portlet, they will not work. There are some javascript errors on the component we are using. They work fine if we don't AJAX enable them
    2) I had 2 portlets. 1 JSF and 1 pageflow portlet. If I click on a link in pageflow portlet and after the page gets refreshed, nothing will work in JSF potlet. Again javacript errors
    If we had only 1 portlet on the page, JSF portlet works fine
    Do you think the prototype javacript library used in the portal causing any issues?

    I tried with <naming:namingContainer> immediatly after the f:view tag , but still getting same errors
    I am psoting the generated html and javascript error
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
         <head>
    <title>New Portal Desktop</title><meta name="bea-portal-meta-skeleton" content="/framework/skeletons/default"><meta name="bea-portal-meta-skin" content="/framework/skins/default"><meta name="bea-portal-meta-skin-images" content="/framework/skins/default/images"><link rel="stylesheet" type="text/css" href="/sampleWeb/framework/skins/default/css/body.css"><link type="text/css" href="/sampleWeb/framework/skins/default/css/button.css" rel="stylesheet"><link href="/sampleWeb/framework/skins/default/alert/css/window-alert.css" rel="stylesheet" type="text/css"><link href="/sampleWeb/framework/skins/default/css/window.css" rel="stylesheet" type="text/css"><link type="text/css" rel="stylesheet" href="/sampleWeb/framework/skins/default/plain/css/window-plain.css"><link type="text/css" rel="stylesheet" href="/sampleWeb/framework/skins/default/css/portlet.css"><link type="text/css" rel="stylesheet" href="/sampleWeb/framework/skins/default/css/book.css"><link type="text/css" rel="stylesheet" href="/sampleWeb/framework/skins/default/css/layout.css"><link href="/sampleWeb/framework/skins/default/css/form.css" rel="stylesheet" type="text/css"><script src="/sampleWeb/framework/skins/shared/js/console.js" type="text/javascript"></script><script src="/sampleWeb/framework/skins/shared/js/cookies.js" type="text/javascript"></script><script src="/sampleWeb/framework/skins/shared/js/state.js" type="text/javascript"></script><script src="/sampleWeb/framework/skins/default/js/util.js" type="text/javascript"></script><script type="text/javascript" src="/sampleWeb/framework/skins/default/js/skin.js"></script><script src="/sampleWeb/framework/skins/default/js/menu.js" type="text/javascript"></script><script src="/sampleWeb/framework/skins/default/js/delete.js" type="text/javascript"></script><script src="/sampleWeb/framework/skins/default/js/float.js" type="text/javascript"></script><script type="text/javascript" src="/sampleWeb/framework/skins/default/js/menufx.js"></script>
         </head>
    <body
    class="bea-portal-body"
    onload="initSkin();"
    ><div class="bea-portal-body-content">
    <div
    class="bea-portal-body-header"
    >
    </div>
    <div
    class="bea-portal-book-primary"
    >
    <div class="bea-portal-ie-table-buffer-div">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
    <td class="bea-portal-book-primary-menu-single-container" align="left" nowrap="nowrap">
    <ul
    class="bea-portal-book-primary-menu-single"
    ><li class="bea-portal-book-primary-menu-single-item">Page 1</li><li class="bea-portal-book-primary-menu-single-item">New Book</li><li class="bea-portal-book-primary-menu-single-item-active"><span>New Book</span></li></ul>
    </td>
    </tr>
    </table>
    </div>
    <div
    class="bea-portal-book-primary-content"
    >
    <div
    class="bea-portal-book-invisible"
    >
    <div class="bea-portal-ie-table-buffer-div">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
    <td class="bea-portal-book-menu-single-container" align="left" nowrap="nowrap">
    <ul
    class="bea-portal-book-menu-single"
    ><li class="bea-portal-book-menu-single-item-active"><span>New Page</span></li></ul>
    </td>
    </tr>
    </table>
    </div>
    <div
    class="bea-portal-book-content"
    >
    <div
    class="bea-portal-book-page"
    >
    <table
    class="bea-portal-layout-grid"
    cellspacing="0"
    >
    <tr>
    <td class="bea-portal-layout-placeholder-container"
    width="30%"
    >
    <div
    class="bea-portal-layout-placeholder"
    >
    <div
    class="bea-portal-window"
    width="100%"
    >
    <div
    class="bea-portal-window-titlebar"
    >
    <div class="bea-portal-ie-table-buffer-div">
    <table class="bea-portal-window-titlebar-container" cellspacing="0">
    <tr>
    <td class="bea-portal-window-titlebar-title" nowrap="nowrap">Untitled</td>
    <td class="bea-portal-window-titlebar-buttons" nowrap="nowrap">
    </td>
    </tr>
    </table>
    </div>
    </div>
    <div
    class="bea-portal-window-content"
    >
    <html>
    <head>
    </head>
    <body>
         <p>Beehive NetUI-JavaServer Faces Page - /sampleWeb/sample1/index.faces</p>
    <form id="portletInstance_6:_id1" method="post" action="http://localhost:7001/sampleWeb/sample.portal?_nfpb=true&_windowLabel=portletInstance_6&_nffvid=%2FsampleWeb%2Fsample1%2Findex.faces&_pageLabel=defaultDesktopLabel_page_2" enctype="application/x-www-form-urlencoded">
    <a href="# onclick="document.forms['portletInstance_6:_id1'['portletInstance_6:_id1:_idcl'].value='portletInstance_6:_id1:_id2'; document.forms['portletInstance_6:_id1'].submit(); return false;">sample</a>
    <input type="hidden" name="portletInstance_6:_id1" value="portletInstance_6:_id1" /></form>
    </body>
    </html>
    </div>
    </div>
    </div>
    </td>
    <td class="bea-portal-layout-placeholder-container"
    width="70%"
    >
    <div
    class="bea-portal-layout-placeholder"
    >
    <div
    class="bea-portal-window"
    width="100%"
    >
    <div
    class="bea-portal-window-titlebar"
    >
    <div class="bea-portal-ie-table-buffer-div">
    <table class="bea-portal-window-titlebar-container" cellspacing="0">
    <tr>
    <td class="bea-portal-window-titlebar-title" nowrap="nowrap">Untitled</td>
    <td class="bea-portal-window-titlebar-buttons" nowrap="nowrap">
    </td>
    </tr>
    </table>
    </div>
    </div>
    <div
    class="bea-portal-window-content"
    >
    <html>
    <head>
    </head>
    <body>
         <p>Beehive NetUI-JavaServer Faces Page - /sampleWeb/sample1/index.faces</p>
    <form id="portletInstance_5:_id1" method="post" action="http://localhost:7001/sampleWeb/sample.portal?_nfpb=true&_windowLabel=portletInstance_5&_nffvid=%2FsampleWeb%2Fsample1%2Findex.faces&_pageLabel=defaultDesktopLabel_page_2" enctype="application/x-www-form-urlencoded">
    <a href="#" onclick="document.forms['portletInstance_5:_id1']['portletInstance_5:_id1:_idcl'].value='portletInstance_5:_id1:_id2'; document.forms['portletInstance_5:_id1'].submit(); return false;">sample</a>
    <input type="hidden" name="portletInstance_5:_id1" value="portletInstance_5:_id1" /><input type="hidden" name="portletInstance_5:_id1:_idcl" /></form>
    </body>
    </html>
    </div>
    </div>
    </div>
    </td>
    </tr>
    </table>
    </div>
    </div>
    </div>
    </div>
    </div>
    <div
    class="bea-portal-body-footer"
    >
    </div>
    </div></body>
    </html>
    Javascript error
    Line: 292
    Char: 1
    Error: 'portletinstance_6_id1:_idcl' is null or not an object
    Code: 0
    URL: http://localhost:7001/sampleWeb/sample.portal?_nfpb=true&_windowLabel=
    portletInstance_5&_nffvid=%2FsampleWeb%2Fsample1%2Findex.faces&_pageLabel=
    defaultDesktopLabel_page_2

  • Problem with JSF tags, org.apache.jasper.JasperException: Exception in JSP:

    I am a beginner to JSF , I am getting the following error when I try to invoke using the following URL
    http://localhost:8080/Loginjsf/
    I have copied web.xml,faces-config.xml,index.jsp, userLogin.jsp and also the list of jars I am using.
    java version I am using jdk1.5.0_14
    tomcat version 5.5.25
    JSF Version 1.1_01
    ---------------------------------------------------------------------this is the error------------------------------------------------------------------
    exception
    org.apache.jasper.JasperException: Exception in JSP: /index.jsp:7
    4: </head>
    5: <body>
    6: </body>
    7: <jsp:forward page="userLogin.jsp"></jsp:forward>
    8: </html>
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    org.apache.jasper.JasperException: Exception in JSP: /userLogin.jsp:15
    12: </head>
    13:
    14: <body>
    15:      <f:view>
    16:           <h:form id="UserName">
    17:           <f:loadBundle basename ="com.demo.MessageBundle" var="bundle"/> <br>
    18:                     <h:inputText></h:inputText>
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:686)
         org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:656)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:50)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    javax.servlet.ServletException: Cannot find FacesContext
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
         org.apache.jsp.userLogin_jsp._jspService(userLogin_jsp.java:92)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:686)
         org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:656)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:50)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    javax.servlet.jsp.JspException: Cannot find FacesContext
         javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:399)
         com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:105)
         org.apache.jsp.userLogin_jsp._jspx_meth_f_005fview_005f0(userLogin_jsp.java:107)
         org.apache.jsp.userLogin_jsp._jspService(userLogin_jsp.java:82)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:686)
         org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:656)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:50)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    THE WEB.XML FILE I AM USING IS
    The web.xml, faces-config.xml files which I am using ,
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config.xml</param-value>
    </context-param>
    <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
    </context-param>
    <context-param>
    <param-name>com.sun.faces.validateXml</param-name>
    <param-value>true</param-value>
    <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>
    </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>*.faces</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <!--Tomcat 5 Workaround: Listener used to initialize JSF on startup-->
         <listener>
              <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
         </listener>
    </web-app>
    THE FACES-CONFIG.XML I AM USING
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config >
         <application>
              <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
         </application>
         <managed-bean>
              <managed-bean-name>UserBean</managed-bean-name>
              <managed-bean-class>com.demo.bean.UserBean</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
              <managed-property>
                   <property-name>userName</property-name>
                   <property-class>java.lang.String</property-class>
                   <value></value>
              </managed-property>
              <managed-property>
                   <property-name>password</property-name>
                   <property-class>java.lang.String</property-class>
                   <value></value>
              </managed-property>
         </managed-bean>
         <navigation-rule>
              <from-view-id>/userLogin.jsp</from-view-id>
              <navigation-case><from-outcome>failure</from-outcome>
                   <to-view-id>/loginForm.jsp</to-view-id>
              </navigation-case>
              <navigation-case>
                   <from-action>success</from-action>
                   <to-view-id>/userLoginSuccess.jsp</to-view-id>
              </navigation-case></navigation-rule>
         <navigation-rule>
              <from-view-id>/userLoginSuccess.jsp</from-view-id>
         </navigation-rule>
         <navigation-rule>
              <from-view-id>/loginForm.jsp</from-view-id>
         </navigation-rule>
         </faces-config>
    THE INDEX.JSP I AM USING
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
    <head>
    </head>
    <body>
    </body>
    <jsp:forward page="userLogin.jsp"></jsp:forward>
    </html>
    THE USERLOGIN.JSP is
    <%@ page language="java" pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="/WEB-INF/html_basic.tld" prefix="h"%>
    <%@ taglib uri="/WEB-INF/jsf_core.tld" prefix="f"%>
    <html>
    <head>
    <title>My JSF 'userLogin' starting page</title>
         <!--
         <link rel="stylesheet" type="text/css" href="styles.css">
         -->
    </head>
    <body>
    <f:view>
    <h:form id="UserName">
         <f:loadBundle basename ="com.demo.MessageBundle" var="bundle"/> <br>
              <h:inputText></h:inputText>
              <h:outputLabel value="UserName"></h:outputLabel>
              <h:inputText></h:inputText>
              <h:outputLabel for="Password" value="Password" id="Password"></h:outputLabel>
    </h:form>
    </f:view>
    </body>
    </html>
    THE JAR FILES LOCATED AT tomcat-5.5\webapps\Loginjsf\WEB-INF\lib
    commons-beanutils.jar
    commons-collections.jar
    commons-digester.jar
    commons-logging.jar
    el-api.jar
    el-ri.jar
    jsf-api.jar
    jsf-facelets.jar
    jsf-impl.jar
    jstl.jar
    standard.jar
    It would be great if you could help me in resolving this problem, what is that I am doing wrong?

    Thanks for your suggestions, I updated the web.xml and index.jsp accordingly but this time I am getting a different kind of error as below
    org.apache.jasper.JasperException: Exception in JSP: /index.jsp:6
    3: <head>
    4: </head>
    5: <body>
    6: <jsp:forward page="userLogin.faces"></jsp:forward>
    7: </body>
    8: </html>
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    javax.servlet.ServletException: Error Parsing /userLogin.jsp: Error Traced[line: 1] The markup in the document preceding the root element must be well-formed.
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:202)
         org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:686)
         org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:656)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:49)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    com.sun.facelets.FaceletException: Error Parsing /userLogin.jsp: Error Traced[line: 1] The markup in the document preceding the root element must be well-formed.
         com.sun.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:234)
         com.sun.facelets.compiler.Compiler.compile(Compiler.java:105)
         com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:197)
         com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:144)
         com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:95)
         com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:496)
         com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:546)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:686)
         org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:656)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:49)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

  • Problem with JSF 1.2 and Tomcat 6

    Hello guys,
    I have here:
    Tomcat 6.0.10
    JSF 1.2_04_b10_p01
    I followed these steps without success:
    http://forum.java.sun.com/thread.jspa?threadID=787962
    http://forum.java.sun.com/thread.jspa?threadID=5156242
    Here what I did:
    1) Removed the following line in $TOMCAT_HOME/conf/server.xml
    <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />2) Add the following lines to $TOMCAT_HOME/conf/web.xml
         <context-param>
         <param-name>com.sun.faces.expressionFactory</param-name>
         <param-value>org.apache.el.ExpressionFactoryImpl</param-value>
         </context-param>3) Add the following libs to $TOMCAT_HOME/lib
    jsf-api.jar
    jsf-impl.jar
    jstl-1.2.jar
    4) Add the following lines to $MYAPP/WEB-INF/web.xml
         <listener>
              <listener-class>
                   com.sun.faces.config.ConfigureListener
              </listener-class>
         </listener>
         <listener>
              <listener-class>
                   com.sun.faces.application.WebappLifecycleListener
              </listener-class>
         </listener>And here is "the final product":
    INFO: Initializing Sun's JavaServer Faces implementation (1.2_04-b10-p01) for context '/protocolo'
    10/04/2007 08:18:47 com.sun.faces.config.ConfigureListener registerELResolverAndListenerWithJsp
    SEVERE: Error Instantiating ExpressionFactory
    java.lang.ClassCastException: org.apache.el.ExpressionFactoryImpl cannot be cast to javax.el.ExpressionFactory
         at com.sun.faces.config.ConfigureListener.registerELResolverAndListenerWithJsp(ConfigureListener.java:1563)
         at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:419)
         at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4336)
         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)
         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)
         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
         at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
         at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)What I need to do? Someone can help me?
    Thank you.

    Thank you for the answer rlubke,
    Well this happened because I had compiled the project with the jstl-1.1
    The workaround to make jsf 1.2 run on tomcat 6 really works.
    But now I have a problem because the JNDI tree in tomcat is read-only ( ro )
    and I need to bind a object in the JNDI so an exception happens:
    WARNING: Ocorreu um erro inexperado:
    javax.naming.NamingException: Context is read only
             at org.apache.naming.NamingContext.checkWritable(NamingContext.java:903)
             at org.apache.naming.NamingContext.bind(NamingContext.java:831)
             at org.apache.naming.NamingContext.bind(NamingContext.java:171)
             at org.apache.naming.NamingContext.bind(NamingContext.java:187)
             at org.apache.naming.SelectorContext.bind(SelectorContext.java:171)
             at javax.naming.InitialContext.bind(InitialContext.java:400)Here is the code:
    try{
         Context newContext = new InitialContext();
         newContext.bind( dataSourceWrappedID, wrappedDs );
         newContext.close();
    }catch(NameAlreadyBoundException nabe){
         // ok no problem..
    }catch(NamingException ne){
         if ( log.isWarnEnabled() ){
              log.warn("Ocorreu um erro inexperado:", ne);
    }You know how to make the JNDI tree in tomcat read-write ?
    Thank you a ton. :-)

  • Problem with JSF provided Validator

    Hi,
    I am running following code using Java Web Services Developers Pack 1.3. and it's giving me exception. Anybody has any insight to this problem? I appreciate your time and help.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <title>A Simple Java Server Faces Application</title>
    </head>
    <body>
    <f:use_faces>
    <h:form id="loginForm" formName="loginForm">
    <h3>Please enter your name and password.</h3>
    <table>
    <tr>
    <td>Name:</td>
    <td>
    <h:input_text id="username" valueRef="user.name"/>
                        <f:validate_required/>
                   </h:input_text>
    </td>
                   <td>
                   <h:output_errors for="username" color="red"/>
                   </td>
    </tr>
    <tr>
    <td>Password:</td>
    <td>
    <h:input_secret id="userpwd" valueRef="user.password"/>
                        <f:validate_required/>
                        <f:validate_length minimum="6"/>
                   </h:input_secret>
    </td>
                   <td>
                   <h:output_errors for="userpwd" color="red"/>
                   </td>
    </tr>
    </table>
    <p>
    <h:command_button label="Login" commandName="" action="login"/>
    </p>
    </h:form>
    </f:use_faces>
    </body>
    </html>
    Exception is as follows:
    exception
    java.lang.ClassCastException
         javax.faces.validator.RequiredValidator.validate(RequiredValidator.java:56)
         javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:998)
         javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:990)
         com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:85)
         com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:185)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:169)

    It sounds like you have not followed the instructions to replace the EA4 version of JavaServer Faces (bundled in JWSDP 1.3) with the beta release -- there is no such thing as javax.faces.validator.RequiredValidator any longer (this is done by different means now).
    http://java.sun.com/j2ee/javaserverfaces/docs/Installation.html
    Craig McClanahan

Maybe you are looking for