You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Grant Smith <wo...@gmail.com> on 2005/11/17 23:04:39 UTC
Re: Exception
You'll have to provide more information, perhaps your web.xml and faces
config etc...
But from what I can see immediately is that you have com.sun.* stuff in your
setup. I presume you're trying to use myfaces exclusively. In that case make
sure you dont have any Sun JSF jars anywhere.. and then clean out all the
Tomcat work/temp files. I'll assume you're using Tomcat.
Really though, you need to provide MUCH more information when asking
questions like this, in ANY forum.
On 11/17/05, Katareek <ka...@vp.pl> wrote:
>
> Hi,
>
> I have got the following exception and I do not know where is the problem:
> Can You help me ?
>
> javax.servlet.ServletException: javax.servlet.jsp.JspException: null
> org.apache.jasper.runtime.PageContextImpl.doHandlePageException(
> PageContextImpl.java:844)
> org.apache.jasper.runtime.PageContextImpl.handlePageException(
> PageContextImpl.java:781)
> org.apache.jsp.test.myfaces_005fdt_jsp._jspService(
> org.apache.jsp.test.myfaces_005fdt_jsp:125)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java
> :322)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> com.sun.faces.context.ExternalContextImpl.dispatch(
> ExternalContextImpl.java:322)
> com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java
> :130)
> 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)
>
> *root cause*
>
> java.lang.NullPointerException
> com.sun.faces.renderkit.html_basic.CommandLinkRenderer.getHiddenFieldName(
> CommandLinkRenderer.java:136)
> com.sun.faces.renderkit.html_basic.CommandLinkRenderer.encodeEnd(
> CommandLinkRenderer.java:318)
> javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:720)
>
> org.apache.myfaces.custom.datascroller.HtmlDataScrollerRenderer.renderFacet
> (HtmlDataScrollerRenderer.java:294)
>
> org.apache.myfaces.custom.datascroller.HtmlDataScrollerRenderer.renderScroller
> (HtmlDataScrollerRenderer.java:236)
> org.apache.myfaces.custom.datascroller.HtmlDataScrollerRenderer.encodeEnd(
> HtmlDataScrollerRenderer.java:207)
> javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:720)
> com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(
> HtmlBasicRenderer.java:443)
> com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(
> GridRenderer.java:233)
> javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java
> :701)
> com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(
> HtmlBasicRenderer.java:435)
> com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(
> GroupRenderer.java:130)
> javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java
> :701)
> javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.java:607)
> javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:544)
> com.sun.faces.taglib.html_basic.PanelGroupTag.doEndTag(PanelGroupTag.java
> :116)
> org.apache.jsp.test.myfaces_005fdt_jsp._jspx_meth_h_panelGroup_0(
> org.apache.jsp.test.myfaces_005fdt_jsp:197)
> org.apache.jsp.test.myfaces_005fdt_jsp._jspx_meth_f_view_0(
> org.apache.jsp.test.myfaces_005fdt_jsp:153)
> org.apache.jsp.test.myfaces_005fdt_jsp._jspService(
> org.apache.jsp.test.myfaces_005fdt_jsp:112)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java
> :322)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> com.sun.faces.context.ExternalContextImpl.dispatch(
> ExternalContextImpl.java:322)
> com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java
> :130)
> 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)
>
>
> regards
>
--
Grant Smith
Re: Exception
Posted by Mike Kienenberger <mk...@gmail.com>.
If I understand correctly (and I don't use much JSP), c:foreach is
only interpreted when the component tree is build, not during each
render phase.
You're better off using <t:dataList> instead, which will be updated
each request.
Also, since clientList is request-scoped, you're going to have
problems when you submit the page again, unless you use
<t:saveState id="savedClientList " value="#{clientList}"/>
On 11/17/05, Katareek <ka...@vp.pl> wrote:
> Katareek wrote:
>
> >I want to use SUN JSF and MyFaces both
> >
> >Now the result page is ok, I do not have any exception, but dataTable do
> >not see my datas from bean.
> >Bean is ok. I tested it :
> >(result as CachedRowSet)
> >
> ><c:forEach items="${clientList.list}" var="cl" >
> > <c:out value="${cl.nip}"></c:out>
> > <c:out value="${cl.name}"></c:out>
> ></c:forEach>
> >
> >
> >
> I checked my application ones again. I have done another tests and I
> notice that "my MyFaces :) " can not use CachedRowSet.
> I checked log, and as value="#{data.list}" (var="kk") is ok - it gets
> CachedRowSet object, but when I try to get data from CachedRowSet ->
> KK.nam ( KK.getString(nam)) it do not invoke it.
> Maybe I do something bad I do not now
>
> regards,
>
Re: Exception
Posted by Katareek <ka...@vp.pl>.
Katareek wrote:
>I want to use SUN JSF and MyFaces both
>
>Now the result page is ok, I do not have any exception, but dataTable do
>not see my datas from bean.
>Bean is ok. I tested it :
>(result as CachedRowSet)
>
><c:forEach items="${clientList.list}" var="cl" >
> <c:out value="${cl.nip}"></c:out>
> <c:out value="${cl.name}"></c:out>
></c:forEach>
>
>
>
I checked my application ones again. I have done another tests and I
notice that "my MyFaces :) " can not use CachedRowSet.
I checked log, and as value="#{data.list}" (var="kk") is ok - it gets
CachedRowSet object, but when I try to get data from CachedRowSet ->
KK.nam ( KK.getString(nam)) it do not invoke it.
Maybe I do something bad I do not now
regards,
Re: Exception
Posted by Katareek <ka...@vp.pl>.
Grant Smith wrote:
> You'll have to provide more information, perhaps your web.xml and
> faces config etc...
>
> But from what I can see immediately is that you have com.sun.* stuff
> in your setup. I presume you're trying to use myfaces exclusively. In
> that case make sure you dont have any Sun JSF jars anywhere.. and then
> clean out all the Tomcat work/temp files. I'll assume you're using Tomcat.
>
I want to use SUN JSF and MyFaces both
Now the result page is ok, I do not have any exception, but dataTable do
not see my datas from bean.
Bean is ok. I tested it :
(result as CachedRowSet)
<c:forEach items="${clientList.list}" var="cl" >
<c:out value="${cl.nip}"></c:out>
<c:out value="${cl.name}"></c:out>
</c:forEach>
but:
Below is test jsp file :
<%@ page session="false" contentType="text/html;charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<html>
<body>
<f:view>
<h:form>
<t:dataTable id="data"
styleClass="scrollerTable"
headerClass="standardTable_Header"
footerClass="standardTable_Header"
rowClasses="standardTable_Row1,standardTable_Row2"
columnClasses="standardTable_Column,standardTable_ColumnCentered,standardTable_Column"
var="car"
value="#{clientList.list}"
preserveDataModel="true"
rows="10"
rowId="#{car.nip}"
rowOnClick="alert('rowId: ' + this.id)"
preserveSort="true">
<h:column>
<f:facet name="header"></f:facet>
<h:outputText value="#{car.nip}" />
</h:column>
<h:column>
<f:facet name="header">
<t:commandSortHeader columnName="type" arrow="true"
immediate="false">
<h:outputText value="BB" />
</t:commandSortHeader>
</f:facet>
<h:outputText value="#{car.name}" />
</h:column>
</t:dataTable>
<h:panelGrid columns="1" styleClass="scrollerTable2"
columnClasses="standardTable_ColumnCentered" >
<t:dataScroller id="scroll_1"
for="data"
fastStep="10"
pageCountVar="pageCount"
pageIndexVar="pageIndex"
styleClass="scroller"
paginator="true"
paginatorMaxPages="9"
paginatorTableClass="paginator"
paginatorActiveColumnStyle="font-weight:bold;">
<f:actionListener type="test.DataScrollerActionListener"/>
<f:facet name="first" >
<t:graphicImage url="images/arrow-first.gif" border="1" />
</f:facet>
<f:facet name="last">
<t:graphicImage url="images/arrow-last.gif" border="1" />
</f:facet>
<f:facet name="previous">
<t:graphicImage url="images/arrow-previous.gif"
border="1" />
</f:facet>
<f:facet name="next">
<t:graphicImage url="images/arrow-next.gif" border="1" />
</f:facet>
<f:facet name="fastforward">
<t:graphicImage url="images/arrow-ff.gif" border="1" />
</f:facet>
<f:facet name="fastrewind">
<t:graphicImage url="images/arrow-fr.gif" border="1" />
</f:facet>
</t:dataScroller>
</h:panelGrid>
</h:form>
</f:view>
</body>
</html>
---------------------------------- below is web.xml ----------------
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>pieczarki_02</display-name>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>setup</servlet-name>
<servlet-class>application.SetupServlet</servlet-class>
<init-param>
<param-name>dataSource</param-name>
<param-value>java:/comp/env/jdbc/postgres</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
</web-app>
-------------------------------- below is faces-config.xml
<?xml version="1.0"?>
<!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>
<managed-bean>
<description>ClientList</description>
<managed-bean-name>clientList</managed-bean-name>
<managed-bean-class>application.database.ClientList</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<description>Client</description>
<managed-bean-name>client</managed-bean-name>
<managed-bean-class>application.database.Client</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<application>
<message-bundle>
bundle.Messages.Message
</message-bundle>
<locale-config>
<default-locale>pl</default-locale>
</locale-config>
</application>
</faces-config>
-------------------
reagrds,