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 <= ${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,