Announcement Announcement Module
Collapse
No announcement yet.
Getting java.lang.IllegalArgumentException: SQL must not be null Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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>(JdbcTemplate.java:1 257)
    at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:645)
    at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:653)
    at org.springframework.jdbc.core.JdbcTemplate.queryFo rObject(JdbcTemplate.java:696)
    at com.tools.jmsposting.server.CheckOMSVersionService Impl.checkOMSVersion(Unknown Source)
    at com.tools.jmsposting.HandleJmsWebService.processWe bServiceCall(Unknown Source)
    at com.tools.jmsposting.server.JMSPostBindingImpl.cal lJMSInterface(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.axis.providers.java.RPCProvider.invokeM ethod(RPCProvider.java:397)

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

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

    and call a sql in the follpwing part of code .

    SegmentResponseBean segmentBean=null;

    try{
    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.

    Comment

    Working...
    X