Graeme, It's not a Facelets problem - the issue is that your train in the second example isn't inside of a form. So, easy to fix. But the train is being very bad here - it should be logging a descriptive warning, not blowing up. If you could log a JIRA issue on that problem so we don't lose track of it, that'd be much appreciated. Thanks, Adam On 12/13/06, Graeme Steyn wrote: > Good Afternoon, > > I am currently experiencing a problem with the use of the Trinidad > tr:train component, tomahawk (t:inputDate) and facelets 1.1.11. I am > using a snapshot built today from the faces-1_2-061113 branch in SVN. > The problem that I am experiencing is that in the first test instance > below (example 1), the use of tr:train works correctly and renders the > train correctly. However, when I embed the tr:train in a facelets > template, as in example 2, I get the following error: > > java.lang.NullPointerException > at > org.apache.myfaces.trinidadinternal.renderkit.core.desktop.TrainRenderer > $Train.(TrainRenderer.java:913) > at > org.apache.myfaces.trinidadinternal.renderkit.core.desktop.TrainRenderer > .encodeAll(TrainRenderer.java:175) > at > org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.j > ava:181) > at > org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComp > onentBase.java:712) > at > org.apache.myfaces.trinidad.component.UIXCollection.encodeEnd(UIXCollect > ion.java:490) > at > org.apache.myfaces.trinidad.component.UIXComponentBase.__encodeRecursive > (UIXComponentBase.java:1258) > at > org.apache.myfaces.trinidad.component.UIXComponentBase.encodeAll(UIXComp > onentBase.java:732) > at javax.faces.component.UIComponent.encodeAll(UIComponent.java:889) > at > com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:5 > 78) > at > javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper > .java:178) > at > org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderVi > ew(ViewHandlerImpl.java:171) > at > com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase. > java:133) > at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:244) > at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140) > at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245) > at > org.apache.catalina.core.ApplicationFilterChain.servletService(Applicati > onFilterChain.java:397) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica > tionFilterChain.java:303) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt > erChain.java:184) > at > org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoF > ilter(TrinidadFilterImpl.java:327) > at > org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterI > mpl(TrinidadFilterImpl.java:291) > at > org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(T > rinidadFilterImpl.java:214) > at > org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilte > r.java:90) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica > tionFilterChain.java:216) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt > erChain.java:184) > at > org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFil > ter.java:144) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica > tionFilterChain.java:216) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt > erChain.java:184) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv > e.java:276) > at > org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java > :566) > at > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5 > 36) > at > org.apache.catalina.core.StandardContextValve.invokeInternal(StandardCon > textValve.java:240) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv > e.java:179) > at > org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java > :566) > at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java > :182) > at > org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java > :566) > at > com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipelin > e.java:120) > at > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. > java:137) > at > org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java > :566) > at > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5 > 36) > at > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939) > at > org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239) > at > com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(Pro > cessorTask.java:667) > at > com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked > (ProcessorTask.java:574) > at > com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(Processor > Task.java:844) > at > com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(R > eadTask.java:287) > at > com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:2 > 12) > at > com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252) > at > com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.j > ava:75) > > Note: that without tr:train in the template, the pages render correctly. > I have made no changed to web.xml file or faces-config.xml file. Both > pages are being executed from the same context and packaged in the same > WAR file. Would anyone now what could potentially cause this problem? > > Thank you. > > Graeme > > Example 2: > > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > xmlns="http://www.w3.org/1999/xhtml" > xmlns:ui="http://java.sun.com/jsf/facelets" > xmlns:f="http://java.sun.com/jsf/core" > xmlns:h="http://java.sun.com/jsf/html" > xmlns:t="http://myfaces.apache.org/tomahawk" > xmlns:tr="http://myfaces.apache.org/trinidad" > lang="en" > xml:lang="en"> > > http-equiv="Content-Type" > content="text/html; charset=ISO-8859-1" /> > name="description" > content="description" /> > name="keywords" > content="keyword phrase1, keyword phrase 2, etc." /> > > <ui:insert name="title">Default Title</ui:insert> > > > >
> > > > var="foo" > value="#{processTrainMenuModel}"> > > text="#{foo.label}" > action="#{foo.getOutcome}" > immediate="#{processTrainMenuModel.immediate}" > readOnly="#{processTrainMenuModel.readOnly}" /> > > > > > > > > >
> >
> > > > > Example 1: > > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > xmlns="http://www.w3.org/1999/xhtml" > xmlns:ui="http://java.sun.com/jsf/facelets" > xmlns:f="http://java.sun.com/jsf/core" > xmlns:h="http://java.sun.com/jsf/html" > xmlns:tr="http://myfaces.apache.org/trinidad" > lang="en" > xml:lang="en"> > > http-equiv="Content-Type" > content="text/html; charset=ISO-8859-1" /> > name="description" > content="description" /> > name="keywords" > content="keyword phrase1, keyword phrase 2, etc." /> > > Header > > > > value="<h1>Quick Details</h1>" > escape="false" /> > > > > var="foo" > value="#{processTrainMenuModel}"> > > text="#{foo.label}" > action="#{foo.getOutcome}" > immediate="#{processTrainMenuModel.immediate}" > readOnly="#{processTrainMenuModel.readOnly}" /> > > > > > > > > > > > > > >