Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8032219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:19:31+00:00 2026-06-05T01:19:31+00:00

my error java.lang.NullPointerException. MyDAO$2.setValues org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:680) org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:454) org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:676) org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:738) net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:694) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:639)

  • 0

my error

 java.lang.NullPointerException.
 MyDAO$2.setValues
    org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:680)
    org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:454)
    org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:676)
    org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:738)

net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:694)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:639)

my code is

     this.jdbcTemplate.update(SOME_SQL_UPDATE, new PreparedStatementSetter() {
                    public void setValues(PreparedStatement ps) throws SQLException {
                        ps.setBoolean(1, myObj.isVal1());
                        ps.setString(2, myObj.getVal2().toString());
                    }
                });

public class myObj {
    private boolean val1;
    private Enum val2;
}

my db column for boolean is number(1,0) and my set string column is varchar.

Note: I am using spring 1.2 and currently upgrading to spring 3.

What could be wrong?

How can i fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:19:32+00:00Added an answer on June 5, 2026 at 1:19 am

    Are you sure myObj is not null? It looks like it could be the only object that could be null in that statement. Could you do a simple null check on the object inside the method to confirm?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

[2012-01-25 17:03:09,186] WARN - jetbrains.buildServer.SERVER - Failed to start build: null, error: java.lang.NullPointerException I
I have a failure in my JUnit testing testing trace. The error is java.lang.NullPointerException
Getting the following error : java.lang.NullPointerException: Module 'null' not found. <?xml version=1.0 encoding=UTF-8 ?>
07-30 21:02:39.260: ERROR/AndroidRuntime(7961): java.lang.NullPointerException 07-30 21:02:39.260: ERROR/AndroidRuntime(7961): at com.fttech.gameIT.shoppingClass$1.onClick(shoppingClass.java:45) 07-30 21:02:39.260: ERROR/AndroidRuntime(7961): at android.view.View.performClick(View.java:3110)
We're getting this error java.lang.NullPointerException at java.util.ArrayList.<init>(Unknown Source) at de.mystuff.ExtendedArrayList.<init>(ExtendedArrayList.java:38) where ExtendedArrayList:38 is new
Can anyone tell me why am i getting error message java.lang.NullPointerException in following code??
The following code is giving me this error: java.lang.NullPointerException java.io.FileOutputStream.(Unknown Source) java.io.FileOutputStream.(Unknown Source) java.io.FileWriter.(Unknown
I'm running into 'Error: Java heap space, java.lang.OutOfMemoryError: Java heap space' when compiling an
I'm catching all exceptions within: java.lang.Throwable /page.xhtml java.lang.Error /page.xhtml But what If I get
I am not sure why I get this error: Caused by: java.lang.RuntimeException: Deferred binding

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.