Announcement Announcement Module
Collapse
No announcement yet.
NullPointerException on transition Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • NullPointerException on transition

    Good day, everyone.

    I'm getting the following NullPointerException when I make a transition in a flow. I'm trying to select a row from a <h:dataTable> element through a <sf:commandLink>, just like the Spring examples.

    Code:
    org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.webflow.execution.FlowExecutionException: Exception thrown in state 'verUsuarios' of flow 'adminUsuario'
    
    javax.faces.FacesException: java.lang.NullPointerException
    My application is based off the swf-booking-faces example, but just in case, here are the relevant parts of my files:

    adminUsuario-flow.xml
    Code:
    <view-state id="verUsuarios">
        <on-render>
            <evaluate expression="adminUsuarioService.getUsuarios()" result="viewScope.listaUsuarios" result-type="dataModel" />
        </on-render>
        <transition on="editar" to="adminUsuarioDatos">
            <set name="flowScope.usuarioFila" value="listaUsuarios.selectedRow" />
        </transition>
    </view-state>
    verUsuarios.xhtml
    Code:
    <ui:define name="contenido">
        <h:form>
            <h:dataTable var="usuario" value="#{listaUsuarios}">
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="#{i18n['gms.documento']}" />
                    </f:facet>
                    <h:outputText value="#{usuario.usuDocumento}" />
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="#{i18n['gms.nombre']}" />
                    </f:facet>
                    <h:outputText value="#{usuario.usuNombre}" />
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="#{i18n['gms.apellido']}" />
                    </f:facet>
                    <h:outputText value="#{usuario.usuApellido}" />
                </h:column>
                <h:column>
                    <sf:commandLink value="Editar" action="editar" />
                </h:column>
            </h:dataTable>
        </h:form>
    </ui:define>
    I really don't know what the problem could be, I tried almost everything and nothing seems to work, I keep getting the same exception, even if I reduce the functionality to the bare minimum. Does anyone have any recommendation? Thanks for your time!

  • #2
    Not sure if this is the problem, but I've seen some wonky behavior with the sf commandLink in the past. Check to see if it works with other components, like regular commandLinks, or even a sf commandButton.

    Comment


    • #3
      Thanks for the answer Falcon... However, I have already tried with normal JSF commandLink/commandButton and with my JSF library of choice OpenFaces, and get exactly the same result... This is very weird indeed, and I'm really worried about it...

      Comment


      • #4
        Ok, so it turns out I had two flowHandlerControllers defined in my configuration and my current flow was not using the appropiate JSF controller, so I was getting a NullPointerException when the JSF components were called...

        However, I still can't get OpenFaces to work... PrimeFaces works flawlessly, but no dice with OpenFaces, does anyone know if there is some compatibility issues?

        Comment

        Working...
        X