Announcement Announcement Module
No announcement yet.
Getting java.lang.IllegalArgumentException: SQL must not be null Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting java.lang.IllegalArgumentException: SQL must not be null

    Hi I am deploying a application on tomcat , that is built Spring framework.
    I observe when a request is sent for the very first time , the application code works as expected .
    On other requests I get jjava.lang.IllegalArgumentException: SQL must not be null
    at org.springframework.util.Assert.notNull(Assert.jav a:112)
    at org.springframework.jdbc.core.JdbcTemplate$SimpleP reparedStatementCreator.<init>( 257)
    at org.springframework.jdbc.core.JdbcTemplate.query(J
    at org.springframework.jdbc.core.JdbcTemplate.query(J
    at org.springframework.jdbc.core.JdbcTemplate.queryFo rObject(
    at Impl.checkOMSVersion(Unknown Source)
    at bServiceCall(Unknown Source)
    at lJMSInterface(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De
    at java.lang.reflect.Method.invoke(
    at ethod(

    I store queries in a xml file using sqlmap and assocaiating a query with a key .

    <entry key="SQL_CheckOMSVersion">
    SELECT segment_id,QUIESCE_STATE,ban_group
    FROM tbcustomer_local
    WHERE customer_id = ?

    and call a sql in the follpwing part of code .

    SegmentResponseBean segmentBean=null;

    segmentBean= (SegmentResponseBean) this.jdbcTemplate.queryForObject((String) sqlMap.get("SQL_CheckOMSVersion"),new Object[] { customerID }, new DataMapper());

    Could anybody help.

  • #2
    Please use [ code][/code ] tags when posting code/xml/stacktraces, that way it remains readable.

    Test your class in isolation and figure out the problem. Judging from the stacktrace and little code you provide the xml isn't read (properly) and as such the map the is empty. Maybe it isn't injected or whatever.