Announcement Announcement Module
Collapse
No announcement yet.
java.lang.NullPointerException when inserting values into a database Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • java.lang.NullPointerException when inserting values into a database

    Hi,

    I'm getting a nullpointerexception when trying to implement a JdbcTemplate update table statement.

    The thing is, i'm using 2 forms in my table, one to submit search values and another to update/insert/delete rows in my table.

    This is the error i'm getting:

    exception

    org.springframework.web.util.NestedServletExceptio n: Request processing failed; nested exception is java.lang.NullPointerException
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:408)
    org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:360)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:709)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:802)


    root cause

    java.lang.NullPointerException
    web.BalanceAdjustmentController.onSubmit(BalanceAd justmentController.java:150)
    org.springframework.web.servlet.mvc.SimpleFormCont roller.processFormSubmission(SimpleFormController. java:258)
    org.springframework.web.servlet.mvc.AbstractFormCo ntroller.handleRequestInternal(AbstractFormControl ler.java:250)
    org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(AbstractController.java:153)
    org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:45)
    org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:806)
    org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:736)
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:396)
    org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:360)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:709)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:802)



    my code is :

    Code:
        if (request.getParameter("submit.Search") != null) {
           "search code"
        }
        if  (request.getParameter("submit.Add") != null){
           logger.info("Submitting add values");
           int state = ppMan.addNewPP(vara, varb, varc, vard, vare, varf, varg, varh, vari); 
           logger.info("After Submit");
           .
           .
           .
        }

    My search form is working, my add form also... in my logg i have the "Submitting add values" but not the "After Submit" one.
    No other class is called (as you can see in the log).
    Line 150 is the "int state = ppMan.addNewPP...."

    Any ideas?

    Thankx
Working...
X