iBATIS2.3.2のバグ
Springのwith dependencyパッケージは関連するJarが含まれていて便利だが、Spring2.5.5付属のiBATISは2.3.2となっていて、このバージョンには副問い合わせでのバグがある。
副問い合わせ指定のSQLを実行すると次のようなエラーが出力されてしまう。
javax.servlet.ServletException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; --- The error occurred in ../sql/order.xml. --- The error occurred while applying a result map. --- Check the Order.ordermain. --- Check the result mapping for the 'items' property. --- Cause: java.lang.NullPointerException; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in ../sql/order.xml. --- The error occurred while applying a result map. --- Check the Order.ordermain. --- Check the result mapping for the 'items' property. --- Cause: java.lang.NullPointerException org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
java.lang.NullPointerException java.lang.Class.isAssignableFrom(Native Method) com.ibatis.sqlmap.engine.type.TypeHandlerFactory.getTypeHandler(TypeHandlerFactory.java:143) com.ibatis.sqlmap.engine.type.TypeHandlerFactory.getTypeHandler(TypeHandlerFactory.java:123) com.ibatis.sqlmap.engine.mapping.result.ResultMap.prepareBeanParameterObject(ResultMap.java:591)
これは既知の問題で修正済みとのこと。
[IBATIS-522] NPE in TypeHandlerFactory.getTypeHandler() when type is null - ASF JIRA
最新版のiBATISを落としてJarを入れ替えておいたほうがいい。最新は 2.3.4となっていた。
Apache Download Mirrors