Вызывается: org.apache.ibatis.ognl.NoSuchPropertyException: - PullRequest
0 голосов
/ 27 мая 2018

мой проект, использующий плагин mybatis. Иногда периодически возникает следующая ошибка!

мой используемый плагин mybatis tk.mybatis.mapper версии 3.3.0 вызывает интерфейс Mapper

tk.mybatis.mapper.common.Mapper.updateByExampleSelective(@Param("record") T var1, @Param("example") Object var2);

Пример:

 public interface EntiyObjectMapper extends Mapper<EntiyObject>{

 }

Я вызываю:

Example example = new Example(EntiyObject.class);
entiyObjectMapper.updateByExampleSelective(entiyObject,example)

root Исключительный стек

 Caused by: org.apache.ibatis.ognl.NoSuchPropertyException: com.xxx.xxx.batch.model.pojo.XXXXXXXInfo.masFlag

это свойство EntiyObject magFlag существует, 99% случаев не отображаются в этомошибка

Я не нашел похожих вопросов в Google, официальном веб-сайте mybatis и официальном веб-сайте ogln

Я не могу найти конкретную причину этой проблемы!

вот полный стек исключений:

[pool-9-thread-5] 2018-05-26 16:05:01.677 [ERROR] [CaseProcess.java:65] - XXXXXXXXX handle failed:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression 'record.masFlag != null'. Cause: org.apache.ibatis.ognl.NoSuchPropertyException: com.xxx.xxx.batch.model.pojo.XXXXXXXInfo.masFlag
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:75)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:371)
at com.sun.proxy.$Proxy20.update(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:254)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:55)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)
at com.sun.proxy.$Proxy30.updateByExampleSelective(Unknown Source)
at com.xxx.xxx.batch.center.service.BaseDataService.insertXXXXXXXInfo(BaseDataService.java:163)
at com.xxx.xxx.batch.center.service.BaseDataService.subsideBo(BaseDataService.java:44)
at com.xxx.xxx.batch.center.service.XXXX.XXXXCaseService.execute(XXXXCaseService.java:47)
at com.xxx.xxx.batch.center.service.XXXX.XXXXCaseService$$FastClassBySpringCGLIB$$39bfb230.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:721)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:656)
at com.xxx.xxx.batch.center.service.XXXX.XXXXCaseService$$EnhancerBySpringCGLIB$$608b51ee.execute(<generated>)
at com.xxx.xxx.batch.center.RoutingService.execute(RoutingService.java:70)
at com.xxx.xxx.batch.center.CaseProcess.process(CaseProcess.java:45)
at com.xxx.xxx.batch.mq.MQAccessBuilder$3.consume(MQAccessBuilder.java:101)
at com.xxx.xxx.batch.mq.ThreadPoolConsumer$1.run(ThreadPoolConsumer.java:94)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)



Caused by: org.apache.ibatis.builder.BuilderException: Error evaluating expression 'record.masFlag != null'. Cause: org.apache.ibatis.ognl.NoSuchPropertyException: com.xxx.xxx.batch.model.pojo.XXXXXXXInfo.masFlag
at org.apache.ibatis.scripting.xmltags.OgnlCache.getValue(OgnlCache.java:46)
at org.apache.ibatis.scripting.xmltags.ExpressionEvaluator.evaluateBoolean(ExpressionEvaluator.java:32)
at org.apache.ibatis.scripting.xmltags.IfSqlNode.apply(IfSqlNode.java:34)
at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:33)
at org.apache.ibatis.scripting.xmltags.TrimSqlNode.apply(TrimSqlNode.java:55)
at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:33)
at org.apache.ibatis.scripting.xmltags.DynamicSqlSource.getBoundSql(DynamicSqlSource.java:41)
at org.apache.ibatis.mapping.MappedStatement.getBoundSql(MappedStatement.java:279)
at org.apache.ibatis.executor.statement.BaseStatementHandler.<init>(BaseStatementHandler.java:64)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.<init>(PreparedStatementHandler.java:39)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.<init>(RoutingStatementHandler.java:45)
at org.apache.ibatis.session.Configuration.newStatementHandler(Configuration.java:502)
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:47)
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:115)
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:75)
at sun.reflect.GeneratedMethodAccessor636.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
at com.sun.proxy.$Proxy73.update(Unknown Source)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:170)
at sun.reflect.GeneratedMethodAccessor633.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:358)
... 25 more



Caused by: org.apache.ibatis.ognl.NoSuchPropertyException: com.xxx.xxx.batch.model.pojo.XXXXXXXInfo.masFlag
at org.apache.ibatis.ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:151)
at org.apache.ibatis.ognl.OgnlRuntime.getProperty(OgnlRuntime.java:2420)
at org.apache.ibatis.ognl.ASTProperty.getValueBody(ASTProperty.java:114)
at org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
at org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:258)
at org.apache.ibatis.ognl.ASTChain.getValueBody(ASTChain.java:141)
at org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
at org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:258)
at org.apache.ibatis.ognl.ASTNotEq.getValueBody(ASTNotEq.java:50)
at org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
at org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:258)
at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:494)
at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:458)
at org.apache.ibatis.scripting.xmltags.OgnlCache.getValue(OgnlCache.java:44)
... 49 more

Пожалуйста, помогите мне!

Ответы [ 2 ]

0 голосов
/ 02 мая 2019

Для дальнейшего использования это известная проблема.
См. https://github.com/mybatis/mybatis-3/issues/623

TL; DR

  • Обновление до MyBatis 3.4.2+ AND Java 1.8.0_25 + должна решить проблему.
  • Если вы не можете выполнить обновление, возможно, существует обходной путь .
0 голосов
/ 01 июня 2018

Ошибка кажется довольно простой.Свойство masFlag не существует в объекте параметра.

Имеет ли класс com.xxx.xxx.batch.model.pojo.XXXXXXXInfo это свойство и / или метод получения и установки?

В противном случае отправьте .

...