myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Yee <richard.k....@gmail.com>
Subject Re: NullPointerException in trinidadinternal [TRINIDAD]
Date Mon, 25 Oct 2010 02:11:55 GMT
I think name is null in your sayHello method.

Richard

Sent from my iPhone

On Oct 24, 2010, at 5:06 PM, "Micah Klitgaard" <mk@micah-co.com> wrote:

> Hi,
> 
> 
> 
> I have been searching the forum but haven't found any hints on what's wrong
> and the reason why this exception is thrown. 
> 
> The example I provided is cut down to the basics. An action returning null
> or "" should be possible right?
> 
> 
> 
> I would really appreciate if someone could take a look into this. Thanks!
> 
> 
> 
> jdk1.6.0_21
> 
> myfaces-core-2.0.1-bin\lib\commons-beanutils-1.7.0.jar
> 
> myfaces-core-2.0.1-bin\lib\commons-codec-1.3.jar
> 
> myfaces-core-2.0.1-bin\lib\commons-collections-3.2.jar
> 
> myfaces-core-2.0.1-bin\lib\commons-digester-1.8.jar
> 
> myfaces-core-2.0.1-bin\lib\commons-discovery-0.4.jar
> 
> myfaces-core-2.0.1-bin\lib\commons-logging-1.1.1.jar
> 
> myfaces-core-2.0.1-bin\lib\myfaces-api-2.0.1.jar
> 
> myfaces-core-2.0.1-bin\lib\myfaces-impl-2.0.1.jar
> 
> jakarta-taglibs-standard-1.1.2\lib\jstl.jar
> 
> jakarta-taglibs-standard-1.1.2\lib\standard.jar
> 
> 
> 
> On apache-tomcat-6.0.29
> 
> 
> 
> 
> 
> SEVERE: An exception occurred
> 
> javax.faces.FacesException: java.lang.NullPointerException
> 
>               at
> org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.wrap(ExceptionHa
> ndlerImpl.java:241)
> 
>               at
> org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.handle(Exception
> HandlerImpl.java:156)
> 
>               at
> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:258)
> 
>               at
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)
> 
>               at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:290)
> 
>               at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:206)
> 
>               at
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(
> TrinidadFilterImpl.java:247)
> 
>               at
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(Trini
> dadFilterImpl.java:157)
> 
>               at
> org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.ja
> va:92)
> 
>               at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:235)
> 
>               at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:206)
> 
>               at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> va:233)
> 
>               at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> va:191)
> 
>               at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127
> )
> 
>               at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102
> )
> 
>               at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> :109)
> 
>               at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
> 
>               at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
> 
>               at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http
> 11Protocol.java:588)
> 
>               at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
> 
>               at java.lang.Thread.run(Thread.java:619)
> 
> Caused by: java.lang.NullPointerException
> 
>               at
> org.apache.myfaces.trinidadinternal.application.StateManagerImpl._removeTran
> sientComponents(StateManagerImpl.java:844)
> 
>               at
> org.apache.myfaces.trinidadinternal.application.StateManagerImpl.saveView(St
> ateManagerImpl.java:166)
> 
>               at
> org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(F
> aceletViewDeclarationLanguage.java:1170)
> 
>               at
> org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.ja
> va:264)
> 
>               at
> javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.jav
> a:59)
> 
>               at
> org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(V
> iewHandlerImpl.java:212)
> 
>               at
> org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseEx
> ecutor.java:85)
> 
>               at
> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:239)
> 
>               ... 18 more
> 
> 
> 
> 
> 
> I have briefly included my files:
> 
> 
> 
> commandButton.xhtml
> 
> 
> 
> <ui:composition xmlns="http://www.w3.org/1999/xhtml"
> 
>                xmlns:ui="http://java.sun.com/jsf/facelets"
> 
>                xmlns:tr="http://myfaces.apache.org/trinidad"
> 
>                template="template.xhtml">
> 
> 
> 
>    <ui:define name="centerContents">
> 
>        <tr:inputText label="Your name" value="#{commandButtonBean.name}"/>
> 
> <!-- commandButtonBean.sayHello causing exception -->
> 
>        <tr:commandButton text="Say Hello"
> action="#{commandButtonBean.sayHello}"/>
> 
> 
> 
>        <tr:commandButton text="Go to page1.xhtml" action="success"/>
> 
>        <tr:commandButton text="Go to gpstracer" action="gpstracer"/>
> 
>        <tr:outputText value="#{commandButtonBean.message}"/>
> </ui:define>
> 
> 
> 
> </ui:composition>
> 
> 
> 
> 
> 
> faces-config.xml
> 
> <faces-config 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-facesconfig_2_0.xsd"
> 
>              version="2.0">
> 
> 
> 
>  <application>
> 
>    <!-- Use the Trinidad RenderKit -->
> 
>    <default-render-kit-id>
> 
>      org.apache.myfaces.trinidad.core
> 
>    </default-render-kit-id>
> 
> ...
> 
>    <navigation-rule>
> 
>      <from-view-id>/pages/commandButton.xhtml</from-view-id>
> 
>      <navigation-case>
> 
>        <from-outcome>success</from-outcome>
> 
>        <to-view-id>/page1.xhtml</to-view-id>
> 
>        <redirect/>
> 
>      </navigation-case>
> 
>        <navigation-case>
> 
>          <from-outcome>gpstracer</from-outcome>
> 
>          <to-view-id>/pages/gpstracer.xhtml</to-view-id>
> 
>          <redirect/>
> 
>        </navigation-case>
> 
>    </navigation-rule>
> 
> ...
> 
> 
> 
> 
> 
> CommandButtonBean.java
> 
> ...
> 
>    public String sayHello() {
> 
>        message="Hello "+name+"!";
> 
>        return null;
> 
>    }
> 
> ...
> 
> 
> 
> 
> 
> template.xml
> 
> 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> 
> <tr:document xmlns:ui="http://java.sun.com/jsf/facelets"
> 
>             xmlns:h="http://java.sun.com/jsf/html"
> 
>             xmlns:f="http://java.sun.com/jsf/core"
> 
>             xmlns:c="http://java.sun.com/jstl/core"
> 
>             xmlns:tr="http://myfaces.apache.org/trinidad"
> 
>             xmlns:trh="http://myfaces.apache.org/trinidad/html">
> 
> 
> 
>    <f:facet name="metaContainer">
> 
>        <meta name="title" content="navigationHandler.currentPageTitle"/>
> 
>        <meta name="robots" content="index, follow"/>
> 
>    </f:facet>
> 
> 
> 
>    <tr:form id="mainForm">
> 
>        <div class="centerContents">
> 
>            <ui:insert name="centerContents"/>
> 
>        </div>
> 
>    </tr:form>
> 
>    <ui:debug/>
> 
> 
> 
> </tr:document>
> 
> 
> 
> -Micah
> 

Mime
View raw message