2 Replies Latest reply on Aug 11, 2009 11:34 AM by Aram Murguía

    Exception with rich:pickList and Tomahawk Sandbox

    Aram Murguía Newbie

      Hello!

      I just tried to add Tomahawk-Sandbox 1.1.9 to my RichFaces-based application. When I try to access the pages that use rich:pickList, I get this exception:


      java.lang.NullPointerException
      at org.ajax4jsf.util.ELUtils.getContainerClass(ELUtils.java:167)
      at org.richfaces.component.UIPickList.getConverterForValue(UIPickList.java:93)
      at org.richfaces.component.UIPickList.getConverter(UIPickList.java:72)
      at org.richfaces.renderkit.PickListRenderer.encodeRows(PickListRenderer.java:245)
      at org.richfaces.renderkit.PickListRenderer.encodeSourceRows(PickListRenderer.java:359)
      at org.richfaces.renderkit.html.PickListRendererGen.doEncodeChildren(PickListRendererGen.java:371)
      at org.richfaces.renderkit.html.PickListRendererGen.doEncodeChildren(PickListRendererGen.java:279)
      at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:120)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:810)
      at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:277)
      at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)
      at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:220)
      at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:215)
      at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:120)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:810)
      at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:271)
      at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:242)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:810)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:884)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:890)
      at org.richfaces.renderkit.html.LayoutRenderer.renderLayout(LayoutRenderer.java:62)
      at org.richfaces.renderkit.html.LayoutRenderer.doEncodeChildren(LayoutRenderer.java:45)
      at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:120)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:810)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:884)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:890)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:890)
      at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
      at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
      at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:134)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:248)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
      at org.apache.myfaces.custom.ppr.PPRLifecycleWrapper.render(PPRLifecycleWrapper.java:84)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
      at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:341)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      at com.ixe.fondos.sairsi.web.filter.AuthorizationFilter.doFilter(AuthorizationFilter.java:124)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:26)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3393)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(Unknown Source)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2140)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2046)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1366)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)

      Without the tomahawk-sandbox JAR, rich:pickList works fine.

      I'm using 3.3.1.GA, Sun's JSF 1.2, Tomahawk 1.1.9 and WebLogic 10.0.

      Anyone knows a workaround for this exception?

      Hope you can help me and thanks in advance.

        • 2. Re: Exception with rich:pickList and Tomahawk Sandbox
          Aram Murguía Newbie

          Here is the code:

          <?xml version="1.0" encoding="ISO-8859-1" ?>
          <html xmlns="http://www.w3.org/1999/xhtml"
           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:a4j="http://richfaces.org/a4j"
           xmlns:rich="http://richfaces.org/rich"
           xmlns:t="http://myfaces.apache.org/tomahawk"
           xmlns:p="http://primefaces.prime.com.tr/ui"
           xmlns:s="http://myfaces.apache.org/sandbox">
           <ui:composition template="/WEB-INF/layout/layout.xhtml">
           <ui:define name="title">SAIRSI ~ Tipos de cambio</ui:define>
           <ui:define name="headerTitle">SAIRSI ~ Tipos de cambio</ui:define>
           <ui:define name="body">
           <t:saveState id="fechaInicio" value="#{tiposCambio.fechaInicio}" />
           <t:saveState id="fechaFin" value="#{tiposCambio.fechaFin}" />
           <t:saveState id="monedasSeleccionadas"
           value="#{tiposCambio.monedasSeleccionadas}" />
           <t:saveState id="monedasDisponibles"
           value="#{tiposCambio.monedasDisponibles}" />
           <t:saveState id="monedas" value="#{tiposCambio.monedas}" />
           <t:saveState id="model" value="#{tiposCambio.model}" />
           <t:saveState id="sortOrder" value="#{tiposCambio.sortOrder}" />
           <h:form id="buscarTiposCambio">
           <rich:layout>
           <rich:layoutPanel position="left">
           <h:panelGrid styleClass="formulario">
           <f:facet name="header">
           <h:outputText value="Criterios de búsqueda" />
           </f:facet>
           <h:panelGrid columns="2" columnClasses="etiquetas,componentes"
           style="width: 100%;">
           <h:outputLabel for="fechaInicio" value="Fecha de inicio" />
           <h:panelGrid columns="1">
           <rich:calendar id="fechaInicio"
           value="#{tiposCambio.fechaInicio}"
           dataModel="#{tiposCambio.calendarDM}" mode="ajax"
           showWeeksBar="false" required="true">
           </rich:calendar>
           <rich:message for="fechaInicio" />
           </h:panelGrid>
          
           <h:outputLabel for="fechaFin" value="Fecha de término" />
           <h:panelGrid columns="1">
           <rich:calendar id="fechaFin" value="#{tiposCambio.fechaFin}"
           dataModel="#{tiposCambio.calendarDM}" mode="ajax"
           showWeeksBar="false" required="true">
           </rich:calendar>
           <rich:message for="fechaFin" />
           </h:panelGrid>
           </h:panelGrid>
          
           <rich:panel header="Monedas">
           <rich:pickList id="monedas"
           value="#{tiposCambio.monedasSeleccionadas}" label="Monedas"
           copyAllControlLabel="Agregar todas" copyControlLabel="Agregar"
           removeControlLabel="Quitar"
           removeAllControlLabel="Quitar todas" required="true">
           <t:selectItems value="#{tiposCambio.monedasDisponibles}"
           var="moneda" itemLabel="#{moneda.descripcion}"
           itemValue="#{moneda.idMoneda}" />
           </rich:pickList>
           <rich:message for="monedas" />
           </rich:panel>
          
           <f:facet name="footer">
           <h:panelGroup>
           <a4j:commandButton action="#{tiposCambio.nuevaBusqueda}"
           value="Reiniciar" status="procesando"
           reRender="buscarTiposCambio" />
           <a4j:commandButton action="#{tiposCambio.list}" value="Buscar"
           status="procesando" reRender="panelTC" />
           </h:panelGroup>
           </f:facet>
           </h:panelGrid>
           </rich:layoutPanel>
           <rich:layoutPanel id="panelTC" position="center">
           <rich:dataTable id="tablaTC" value="#{tiposCambio.model}"
           var="tipoCambio" rows="10" rowClasses="oddRow, evenRow"
           style="width: 1%;" align="center"
           rendered="#{tiposCambio.model != null}">
          
           <f:facet name="header">
           <h:panelGroup>
           <h:commandButton id="exportarExcel"
           image="/img/ico_file_excel.png">
           <rich:toolTip for="exportarExcel" value="Exportar a Excel" />
           <p:dataExporter type="xls" target="tablaTC"
           fileName="TiposDeCambio"
           postProcessor="#{excelProcessor.postProcess}" />
           </h:commandButton>
           </h:panelGroup>
           </f:facet>
          
           <f:facet name="footer">
           <rich:datascroller for="tablaTC" />
           </f:facet>
          
           <rich:column sortable="true" sortBy="#{tipoCambio[0].id.fecha}"
           sortOrder="ASCENDING">
           <f:facet name="header">
           <h:outputText value="Fecha" />
           </f:facet>
           <h:outputText value="#{tipoCambio[0].id.fecha}">
           <f:convertDateTime type="date" dateStyle="short" />
           </h:outputText>
           </rich:column>
          
           <rich:columns value="#{tiposCambio.monedas}" var="moneda"
           index="index" id="column#{index}" styleClass="currency"
           sortable="true" sortBy="#{tipoCambio[index].tipoCambio}"
           sortOrder="#{tiposCambio.sortOrder[moneda.cveMoneda]}">
           <f:facet name="header">
           <h:outputText value="#{moneda.cveMoneda}" />
           </f:facet>
           <h:outputText value="#{tipoCambio[index].tipoCambioTxt}" />
           </rich:columns>
           </rich:dataTable>
           </rich:layoutPanel>
           </rich:layout>
           </h:form>
           </ui:define>
           </ui:composition>
          </html>