org.apache.ibatis.binding.BindingException: Parameter 'null' not found

1,110 views
Skip to first unread message

Antonio Silvestre

unread,
Jan 24, 2017, 12:21:50 PM1/24/17
to mybatis-user
Hi team,

I'm having a strange error the first time of day we get into our application. It seems to be an error in the MyBatis 3.2.3 library, but I haven't found anything similar looking for this error. It occurs only for the first query done, if we try again the query works perfectly and the issue don't occur anymore in the day. It has occured only few days, not every day. The full stack trace is the following:

 ERROR {request=FxBlotterSubscriptionRequest(RID_2XetiwyUEZbmSWJQtAbW)} [SLOW_BUS-2] c.b.k.d.d.s.p.m.d.MyBatisArchivingDao - Unable to get latests fx deals 
org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database. Cause: org.apache.ibatis.binding.BindingException: Parameter 'null' not found. Available parameters are [param1, accountIds, param2, maxResults] 
### Cause: org.apache.ibatis.binding.BindingException: Parameter 'null' not found. Available parameters are [param1, accountIds, param2, maxResults] 
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23) ~[mybatis.jar:3.2.3] 
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:107) ~[mybatis.jar:3.2.3] 
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98) ~[mybatis.jar:3.2.3] 
at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:114) ~[mybatis.jar:3.2.3] 
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:58) ~[mybatis.jar:3.2.3] 
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:43) ~[mybatis.jar:3.2.3] 
at com.sun.proxy.$Proxy49.selectByAccountIds(Unknown Source) ~[na:na] 
at ...
Caused by: org.apache.ibatis.binding.BindingException: Parameter 'null' not found. Available parameters are [param1, accountIds, param2, maxResults] 
at org.apache.ibatis.binding.MapperMethod$ParamMap.get(MapperMethod.java:160) ~[mybatis.jar:3.2.3] 
at org.apache.ibatis.scripting.xmltags.DynamicContext$ContextAccessor.getProperty(DynamicContext.java:120) ~[mybatis.jar:3.2.3] 
at org.apache.ibatis.ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1657) ~[mybatis.jar:3.2.3] 
at org.apache.ibatis.ognl.ASTProperty.getValueBody(ASTProperty.java:92) ~[mybatis.jar:3.2.3] 
at org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170) ~[mybatis.jar:3.2.3] 
at org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:210) ~[mybatis.jar:3.2.3] 
at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:333) ~[mybatis.jar:3.2.3] 
at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:413) ~[mybatis.jar:3.2.3] 
at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:395) ~[mybatis.jar:3.2.3] 
at org.apache.ibatis.scripting.xmltags.OgnlCache.getValue(OgnlCache.java:45) ~[mybatis.jar:3.2.3] 
at org.apache.ibatis.scripting.xmltags.ExpressionEvaluator.evaluateIterable(ExpressionEvaluator.java:36) ~[mybatis.jar:3.2.3] 
at org.apache.ibatis.scripting.xmltags.ForEachSqlNode.apply(ForEachSqlNode.java:51) ~[mybatis.jar:3.2.3] 
at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:29) ~[mybatis.jar:3.2.3] 
at org.apache.ibatis.scripting.xmltags.DynamicSqlSource.getBoundSql(DynamicSqlSource.java:37) ~[mybatis.jar:3.2.3] 
at org.apache.ibatis.mapping.MappedStatement.getBoundSql(MappedStatement.java:275) ~[mybatis.jar:3.2.3] 
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:79) ~[mybatis.jar:3.2.3] 
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104) ~[mybatis.jar:3.2.3] 
... 29 common frames omitted 


The interface method "selectByAccountIds" which is having the error is defined into the mapper interface class as follows:

List<DealEntity> selectByAccountIds(@Param("accountIds") List<String> accountIds,
@Param("maxResults") int maxResults);

The full definition is in the xml file:

<select id="selectByAccountIds" resultMap="ArchiveFxDealMap">
<include refid="ArchiveFXDealBase"></include>
AND deal.COD_OID IN (
   SELECT COD_OID FROM (
       SELECT DISTINCT deal.COD_OID, deal.TIM_TX_TIME, deal.DES_ORD_ID
       FROM KKPS.TKKPSORA deal, KKPS.TKKPSPRA product, KKPS.TKKPSFPA fxProduct,
       KKPS.TKKPSFLA leg left join KKPS.TKKPSFAA alloc on alloc.COD_FXLEG_ID = leg.COD_FXLEG_ID
       WHERE deal.COD_OID = product.COD_OID
       AND fxProduct.COD_PRD_ID = product.COD_PRD_ID 
       AND leg.COD_PRD_ID = product.COD_PRD_ID
AND deal.XTI_DEAL_CLS = 'C'
AND product.XTI_ORD_ST = '2'
       AND alloc.DES_VEN_ACC IN 
       <foreach item="accountId" index="index" collection="accountIds" open="(" separator="," close=")"> '${accountId}'</foreach>
       ORDER BY deal.TIM_TX_TIME DESC, deal.DES_ORD_ID DESC
   ) WHERE ROWNUM &lt;= ${maxResults}
)
ORDER BY deal.TIM_TX_TIME DESC, deal.DES_ORD_ID DESC, product.COD_OID, leg.COD_PRD_ID, alloc.COD_FXLEG_ID
</select>


The DB used is Oracle 11.2.0.3.0 - 64 bits and we're using C3P0 connection pool datasource instead of native MyBatis datasource.

Could you please help with this?

Many thanks,

Antonio Silvestre

unread,
Jan 24, 2017, 12:22:20 PM1/24/17
to mybati...@googlegroups.com

--
Antonio Silvestre



--
Antonio Silvestre

Iwao AVE!

unread,
Jan 24, 2017, 1:09:51 PM1/24/17
to mybatis-user
Hi Antonio,

MyBatis 3.2.3 includes OGNL 2.6.9 which caused some race condition issues like this one
You may have to upgrade MyBatis to 3.3.0 at least. The latest version is 3.4.2.

Regards,
Iwao


--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages