0

A BulkBeanException is being thrown when iBatis is attempting to apply a result map, but is not consistent across deployments via the same jar (local is fine, server deployment is not).

I figured out how to stop the problem (see my answer below), but am more interested in hearing about strategies to diagnose why the cglibification happened/happened differently in different runtime environments. I assume the inconsistent behavior is due to differences in the order in which libraries are loaded, but have not figured out how to confirm this ($PATH and $CLASSPATH resolved to the same thing in different environments). Is there something else I should be looking at?

Got error

  • java -jar <jar> on CentOS box
  • Mule runtime via Eclipse on OS X

Did not get error

  • java -jar <jar> on OS X
  • JUnit via Maven on OS X
  • JUnit via Eclipse on OS X

stack trace

Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in ibatis/MyClassName.xml.
--- The error occurred while applying a result map.
--- Check the MyClassName.result.
--- The error happened while setting a property on the result object.
--- Cause: net.sf.cglib.beans.BulkBeanException: 1
        at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:204) ~[mybatis-2.3.5.jar!/:?]
        at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForList(MappedStatement.java:139) ~[mybatis-2.3.5.jar!/:?]
        at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:578) ~[mybatis-2.3.5.jar!/:?]
        at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:552) ~[mybatis-2.3.5.jar!/:?]
        at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118) ~[mybatis-2.3.5.jar!/:?]
        at org.springframework.orm.ibatis.SqlMapClientTemplate$3.doInSqlMapClient(SqlMapClientTemplate.java:298) ~[mybatis-2-spring-1.0.1.jar!/:1.0.1]
        at org.springframework.orm.ibatis.SqlMapClientTemplate$3.doInSqlMapClient(SqlMapClientTemplate.java:296) ~[mybatis-2-spring-1.0.1.jar!/:1.0.1]
        at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:203) ~[mybatis-2-spring-1.0.1.jar!/:1.0.1]
        ... 77 more
eebbesen
  • 5,070
  • 8
  • 48
  • 70

2 Answers2

1

The Java bean onto which iBATIS was attempting to apply the result map had unusual (non-bean-conformant?) setters. These setters did not return void as is standard, but returned the object itself so that set operations could be chained (we have some Haskell programmers working on this project :)).

Where it was occurring it was solved by changing the setter methods back to their previous state where they were defined with void return.

eebbesen
  • 5,070
  • 8
  • 48
  • 70
0

Had the same issue , ibatis was trying to set null value to primitive double which was causing the issue

jithin
  • 61
  • 1
  • 1
  • 6