myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan-Kees van Andel (JIRA)" <...@myfaces.apache.org>
Subject [jira] Created: (TRINIDAD-118) NullPointerException when using an inputDate without form
Date Sun, 22 Jul 2007 19:10:06 GMT
NullPointerException when using an inputDate without form
---------------------------------------------------------

                 Key: TRINIDAD-118
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-118
             Project: MyFaces Trinidad
          Issue Type: Bug
    Affects Versions: 1.2.1-core
         Environment: Apache Tomcat 6.0.13, JDK 1.6.02, Facelets 1.1.11, Trinidad 1.2.1, MyFaces
1.2.0, Ajax4jsf 1.0.6
            Reporter: Jan-Kees van Andel
            Priority: Minor


When I place an inputDate component on my (Facelets) page, I get a NPE when the tag is not
inside a form tag.

This is the part of my page causing the error:
		<fieldset>
			<legend>#{sampleBean.title} Edited by: #{sampleBean.user} on #{sampleBean.date}</legend>
			<tr:panelFormLayout>
				<tr:inputDate label="Date" value="#{sampleBean.date}" required="true" />
			</tr:panelFormLayout>
		</fieldset>

The stack trace:
java.lang.NullPointerException
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.EditableValueRenderer.addOnSubmitConverterValidators(EditableValueRenderer.java:206)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleInputTextRenderer.encodeAllAsElement(SimpleInputTextRenderer.java:105)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleInputListOfValuesRenderer.renderTextField(SimpleInputListOfValuesRenderer.java:197)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleInputListOfValuesRenderer.encodeAllAsElement(SimpleInputListOfValuesRenderer.java:154)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleInputDateRenderer.encodeAllAsElement(SimpleInputDateRenderer.java:194)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.FormElementRenderer.encodeAll(FormElementRenderer.java:109)
	at org.apache.myfaces.trinidad.render.CoreRenderer.delegateRenderer(CoreRenderer.java:318)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.InputLabelAndMessageRenderer.renderFieldCellContents(InputLabelAndMessageRenderer.java:142)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.LabelAndMessageRenderer._renderFieldCell(LabelAndMessageRenderer.java:375)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.LabelAndMessageRenderer.encodeAll(LabelAndMessageRenderer.java:270)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.InputLabelAndMessageRenderer.encodeAll(InputLabelAndMessageRenderer.java:120)
	at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:208)
	at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:733)
	at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:287)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer._encodeFormItem(PanelFormLayoutRenderer.java:746)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer._encodeFormColumns(PanelFormLayoutRenderer.java:672)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer._encodeChildren(PanelFormLayoutRenderer.java:313)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer.encodeAll(PanelFormLayoutRenderer.java:199)
	at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:208)
	at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:733)
	at org.apache.myfaces.trinidad.component.UIXComponentBase.__encodeRecursive(UIXComponentBase.java:1271)
	at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeAll(UIXComponentBase.java:753)
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:247)
	at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:578)
	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:45)
	at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:174)
	at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:101)
	at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:221)
	at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
	at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:208)
	at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:165)
	at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138)
	at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
	at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Thread.java:619)

When I change the page to something like this:
		<fieldset>
			<legend>#{sampleBean.title} Edited by: #{sampleBean.user} on #{sampleBean.date}</legend>
			<tr:form>
				<tr:panelFormLayout>
					<tr:inputDate label="Date" value="#{sampleBean.date}" required="true" />
				</tr:panelFormLayout>
			</tr:form>
		</fieldset>

the error is gone.

Maybe some error reporting in EditableValueRenderer which checks if the variable fData is
empty? This is the method:
      if (requiredField ||
          (converter != null) ||
          validators.hasNext())
      {

        FormData fData = arc.getFormData();

        boolean immediate = isImmediate(bean);
        ((CoreFormData) fData).addOnSubmitConverterValidators(component,
                                             converter,
                                             validators,
                                             getClientId(context, component),
                                             immediate,
                                             requiredField,
                                             getRequiredMessageKey());

      }


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message