Announcement Announcement Module
Collapse
No announcement yet.
nested exception is java.lang.NullPointerException: null Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • nested exception is java.lang.NullPointerException: null

    Null Pointer Exception is coming:

    I have a jsp file with two submit buttons namely "add" and
    "submit"...while clicking the submit button i have to display
    "enterAddress.jsp" page and if click the "add" button i need to
    perform "addName" method which is in Action class....

    My EnterName.jsp file is given below:

    <input type="submit" name="_eventId_add" value="Add" />
    <input type="submit" name="_eventId_submit" value="Submit" />

    And the web-flow.xml file is given below:
    ------------------------------------------------
    <view-state id="enterName" view="enterName">
    <transition on="submit" to="enterAddress">
    <action bean="multiPageFormAction" method="bindAndValidate" />
    </transition>
    <transition on="add" to="addName" />
    <action bean="multiPageFormAction" method="bindAndValidate" />
    </transition>
    </view-state>

    <action-state id="addName">
    <action name="addName" bean="multiPageFormAction"/>
    <transition on="addName.success" to="enterName"/>
    </action-state>

    -----------------------------------------------------------------------

    Above "addName" is a method in the Action class.......

    And i am getting the following error:

    ------------------------------------

    javax.servlet.ServletException: Exception thrown executing action 'org.springframework.samples.multipage.MultiPageFo rmAction@1bc1fb9' in state 'addName' of flow 'MultiPage'; nested exception is java.lang.NullPointerException: null
    org.apache.struts.action.RequestProcessor.processE xception(RequestProcessor.java:523)
    org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:421)
    org.springframework.web.struts.BindingRequestProce ssor.process(BindingRequestProcessor.java:112)
    org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1194)
    org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java:432)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:709)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:802)


    root cause

    org.springframework.web.flow.ActionExecutionExcept ion: Exception thrown executing action 'org.springframework.samples.multipage.MultiPageFo rmAction@1bc1fb9' in state 'addName' of flow 'MultiPage'; nested exception is java.lang.NullPointerException: null
    org.springframework.web.flow.ActionState$ActionExe cutor.execute(ActionState.java:442)
    org.springframework.web.flow.ActionState.doEnter(A ctionState.java:363)
    org.springframework.web.flow.State.enter(State.jav a:164)
    org.springframework.web.flow.Transition.execute(Tr ansition.java:269)
    org.springframework.web.flow.TransitionableState.o nEvent(TransitionableState.java:202)
    org.springframework.web.flow.execution.impl.FlowEx ecutionImpl.signalEvent(FlowExecutionImpl.java:317 )
    org.springframework.web.flow.execution.FlowExecuti onManager.onEvent(FlowExecutionManager.java:289)
    org.springframework.web.flow.struts.FlowAction.doE xecuteAction(FlowAction.java:142)
    org.springframework.web.struts.TemplateAction.exec ute(TemplateAction.java:177)
    org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:419)
    org.springframework.web.struts.BindingRequestProce ssor.process(BindingRequestProcessor.java:112)
    org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1194)
    org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java:432)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:709)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:802)

    -----------------------------------------------------------------------

    Here the "addName" method is not executing............

  • #2
    First of all: why are you posting this in the 'Announcements' forum!?!?!?

    Regarding your problem. Which version of SWF are you using? You're getting an exception on line 442 of ActionState.java, but the recent versions of ActionState.java only have 351 lines...Make sure you're running PR5.

    If switching to PR5 doesn't solve your problem, just do a bit of debugging in the ActionState class to find out why the NPE is happening: put a breakpoint in the doEnter() method.

    Erwin

    Comment

    Working...
    X