Search code examples
ibatis

Ibatis parameter exception


javax.servlet.ServletException: org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];
--- The error occurred in config/register.xml.
--- The error occurred while applying a parameter map.
--- Check the register.insertDetails-InlineParameterMap.
--- Check the parameter mapping for the 'LName' property.
--- Cause: java.lang.ArrayIndexOutOfBoundsException: 1; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in config/register.xml.
--- The error occurred while applying a parameter map.
--- Check the register.insertDetails-InlineParameterMap.
--- Check the parameter mapping for the 'LName' property.
--- Cause: java.lang.ArrayIndexOutOfBoundsException: 1 org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) javax.servlet.http.HttpServlet.service(HttpServlet.java:710) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


Solution

  • When calling register.insertDetails-InlineParameterMap from register.xml a attribute from your object gets mapped into the insert sql, but the attribute of your data object is null.

    so you get this error when one of your attributes, which you are using in your insert statement is null.