mybatis / mybatis-3

MyBatis SQL mapper framework for Java
http://mybatis.github.io/mybatis-3/
Apache License 2.0
19.7k stars 12.82k forks source link

org.apache.ibatis.ognl.NoSuchPropertyException, java.lang.String with mybatis 5.0 #1648

Closed phanikardev closed 4 years ago

phanikardev commented 5 years ago

MyBatis version

3.5.0

Database vendor and version

Oracle

Test case or example project

Using the following spring 5.1.8 mybatis: 3.5.0 mybatis-spring - 2.0.1 ,

Context: a. We were using the mybatis 1.1.1 having no issues using criteriawithListvalue with earlier version of spring 3xx

b. We upgraded to spring 5.xx as part of app remediation.

c. we started getting the spring jdk version with respective mybatis 1.1.1 as it was pointing to spring core 3.xx and now we have 5.xx

d. So upgraded mybatis-spring 2.0.1 and mybatis 3.5.0 , with jdk 8

Then we started getting the ibatis builder exception with list.key as

org.apache.ibatis.ognl.NoSuchPropertyException java.string.String.key.

Please suggest the above stated issue fixed in mybatis 3.5.1 without any other consequences during runtime. ?

Steps to reproduce

Expected result

Actual result

harawata commented 5 years ago

Hi @phanikardev ,

I assume you meant mybatis-spring 1.1.1 (which depends on mybatis 3.1.1). Please post ...

  1. the full stack trace
  2. the declarations of mapper statement (both Java and XML) and parameter classes
jinjim commented 4 years ago

same problem! mybatis-3.5.1;Database:mysql

Wrapped by: org.apache.ibatis.ognl.OgnlException: id
    at org.apache.ibatis.ognl.ObjectPropertyAccessor.getPossibleProperty(ObjectPropertyAccessor.java:69) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:147) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.ognl.OgnlRuntime.getProperty(OgnlRuntime.java:2719) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.ognl.ASTProperty.getValueBody(ASTProperty.java:114) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:258) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.ognl.ASTChain.getValueBody(ASTChain.java:141) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:258) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.ognl.ASTNotEq.getValueBody(ASTNotEq.java:50) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:258) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:493) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:457) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.scripting.xmltags.OgnlCache.getValue(OgnlCache.java:46) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.scripting.xmltags.ExpressionEvaluator.evaluateBoolean(ExpressionEvaluator.java:32) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.scripting.xmltags.IfSqlNode.apply(IfSqlNode.java:34) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.scripting.xmltags.MixedSqlNode.lambda$apply$0(MixedSqlNode.java:32) ~[mybatis-3.5.1.jar:3.5.1]
    at java.util.ArrayList.forEach(ArrayList.java:1249) ~[?:1.8.0_121]
    at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:32) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.scripting.xmltags.IfSqlNode.apply(IfSqlNode.java:35) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.scripting.xmltags.MixedSqlNode.lambda$apply$0(MixedSqlNode.java:32) ~[mybatis-3.5.1.jar:3.5.1]
    at java.util.ArrayList.forEach(ArrayList.java:1249) ~[?:1.8.0_121]
    at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:32) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.scripting.xmltags.TrimSqlNode.apply(TrimSqlNode.java:55) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.scripting.xmltags.MixedSqlNode.lambda$apply$0(MixedSqlNode.java:32) ~[mybatis-3.5.1.jar:3.5.1]
    at java.util.ArrayList.forEach(ArrayList.java:1249) ~[?:1.8.0_121]
    at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:32) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.scripting.xmltags.IfSqlNode.apply(IfSqlNode.java:35) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.scripting.xmltags.MixedSqlNode.lambda$apply$0(MixedSqlNode.java:32) ~[mybatis-3.5.1.jar:3.5.1]
    at java.util.ArrayList.forEach(ArrayList.java:1249) ~[?:1.8.0_121]
    at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:32) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.scripting.xmltags.DynamicSqlSource.getBoundSql(DynamicSqlSource.java:39) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.mapping.MappedStatement.getBoundSql(MappedStatement.java:297) ~[mybatis-3.5.1.jar:3.5.1]
    at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81) ~[mybatis-3.5.1.jar:3.5.1]
    at sun.reflect.GeneratedMethodAccessor144.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]
    at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49) ~[mybatis-3.5.1.jar:3.5.1]
harawata commented 4 years ago

@jinjim ,

Thanks for the stack trace! Please post the declarations of mapper statement (both Java and XML) and parameter classes.

jinjim commented 4 years ago

@jinjim ,

Thanks for the stack trace! Please post the declarations of mapper statement (both Java and XML) and parameter classes.

the ongl expression is 'ew.entity.id !=null', we used midware of my mybatis-plus,but the this problem Randomly occurring

harawata commented 4 years ago

@jinjim , Just to be sure, that error occurs randomly with MyBatis 3.5.1, is that correct? It is very important if it is random or not.

jinjim commented 4 years ago

@jinjim , Just to be sure, that error occurs randomly with MyBatis 3.5.1, is that correct? It is very important if it is random or not.

yes!i am sure.occasionally appear!

harawata commented 4 years ago

@jinjim , Thanks for clarifying! There was a similar report #623 , but it should not happen if you use MyBatis 3.5.x on Java 1.8.121, so this must be new. It's difficult to reproduce a problem that happens randomly and I have some favors to ask you.

jinjim commented 4 years ago

Because of company security issues,i would like to email you if you do not mind!

jinjim commented 4 years ago

class definition like

public class Project{

@data private int id;

}

and the ew and entity just the @param bind to mappper

harawata commented 4 years ago

@jinjim , How about the 'full stack trace'?

I tried to reproduce it, but couldn't. Here is the app that I used (I tested it with the same Java version as yours i.e. 1.8.0_121). https://gist.github.com/harawata/ba122c27106802b34f84bcb8a6566932

If you (or anyone) find a way to reproduce the error, please let us know how.

phanikardev commented 4 years ago

Hi Let me give the full stack trace

We got temporary work around and proceeding

Thanks

On Nov 2, 2019, at 4:57 AM, Iwao AVE! notifications@github.com wrote:

 @jinjim , How about the 'full stack trace'?

I tried to reproduce it, but couldn't. Here is the app that I used (I tested it with the same Java version as yours i.e. 1.8.0_121). https://gist.github.com/harawata/ba122c27106802b34f84bcb8a6566932

If you (or anyone) find a way to reproduce the error, please let us know how.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

jinjim commented 4 years ago

Hi Let me give the full stack trace We got temporary work around and proceeding Thanks On Nov 2, 2019, at 4:57 AM, Iwao AVE! @.***> wrote:  @jinjim , How about the 'full stack trace'? I tried to reproduce it, but couldn't. Here is the app that I used (I tested it with the same Java version as yours i.e. 1.8.0_121). https://gist.github.com/harawata/ba122c27106802b34f84bcb8a6566932 If you (or anyone) find a way to reproduce the error, please let us know how. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

hi,how it going on?bro

harawata commented 4 years ago

I found one race condition that could be related. Here is a repro.

@Test
void testFlippingAccessible() throws Exception {
  class DataClass {
    private int id;
  }
  int run = 1000;
  Map<String, Object> context = new HashMap<>();
  List<Future<Object>> futures = new ArrayList<>();
  context.put("data", new DataClass());
  ExecutorService executor = Executors.newCachedThreadPool();
  IntStream.range(0, run).forEach(i -> {
    futures.add(executor.submit(() -> {
      return OgnlCache.getValue("data.id", context);
    }));
  });
  for (int i = 0; i < run; i++) {
    assertNotNull(futures.get(i).get());
  }
  executor.shutdown();
}

As it's a race condition, it might pass sometimes, but on my machine, it reliably throws the following exception.

java.util.concurrent.ExecutionException: org.apache.ibatis.builder.BuilderException: Error evaluating expression 'data.id'. Cause: ognl.OgnlException: id [java.lang.NoSuchFieldException: id]
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:192)
    at org.apache.ibatis.scripting.xmltags.OgnlCacheTest.concurrentAccess(OgnlCacheTest.java:49)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:675)
    at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:125)
    at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:132)
    at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:124)
    at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:74)
    at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:104)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:62)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:43)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:35)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:202)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:198)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:69)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:135)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
    at java.util.ArrayList.forEach(ArrayList.java:1257)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
    at java.util.ArrayList.forEach(ArrayList.java:1257)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:229)
    at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:197)
    at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:211)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:191)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:137)
    at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:89)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:542)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:770)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:464)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
Caused by: org.apache.ibatis.builder.BuilderException: Error evaluating expression 'data.id'. Cause: ognl.OgnlException: id [java.lang.NoSuchFieldException: id]
    at org.apache.ibatis.scripting.xmltags.OgnlCache.getValue(OgnlCache.java:48)
    at org.apache.ibatis.scripting.xmltags.OgnlCacheTest.lambda$1(OgnlCacheTest.java:45)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: ognl.OgnlException: id [java.lang.NoSuchFieldException: id]
    at ognl.ObjectPropertyAccessor.getPossibleProperty(ObjectPropertyAccessor.java:69)
    at ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:147)
    at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:3233)
    at ognl.ASTProperty.getValueBody(ASTProperty.java:114)
    at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
    at ognl.SimpleNode.getValue(SimpleNode.java:258)
    at ognl.ASTChain.getValueBody(ASTChain.java:141)
    at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
    at ognl.SimpleNode.getValue(SimpleNode.java:258)
    at ognl.Ognl.getValue(Ognl.java:560)
    at ognl.Ognl.getValue(Ognl.java:524)
    at org.apache.ibatis.scripting.xmltags.OgnlCache.getValue(OgnlCache.java:46)
    ... 5 more
Caused by: java.lang.NoSuchFieldException: id
    at ognl.OgnlRuntime.getFieldValue(OgnlRuntime.java:2422)
    at ognl.ObjectPropertyAccessor.getPossibleProperty(ObjectPropertyAccessor.java:62)
    ... 16 more

This happens when the target member (id in the above test) is inaccessible at first (e.g. declared as private). In that case, OgnlMemberAccess calls setAccessible(true) which is OK. The problem is that it later calls setAccessible(false) in restore(). As a field's accessible status is global and not thread-safe, this causes the above exception.

I am not so sure if this is the problem reported here because it occurs only if the field is not accessible in the first place. Anyway, I have merged #1801 which fixes this race condition. It would be appreciated if you could try the latest 3.5.4-SNAPSHOT with your solution. If the error still occurs, please post the details (full stack trace, the class definition, etc.).

Thank you!

jinjim commented 4 years ago

I add get set method to DataClass,and set OgnlMemberAccess to orginal.and the test run well.

harawata commented 4 years ago

@jinjim , Yes, when there is a getter, that property is 'accessible' and the race condition won't happen. Have you tried 3.5.4-SNAPSHOT with your solution? If the same problem still reproduces, please provide a test like mine. Class/property names are not important, so you can create a sample class with the same structure as your real class.

krkhnh commented 4 years ago

I think I ran into the same problem. I tried 'org.mybatis:mybatis:3.5.4' to solve this issue, but no luck.

Here are my dependencies:

...

compileClasspath - Compile classpath for source set 'main'.
+--- project :core
+--- org.projectlombok:lombok: -> 1.18.6
+--- org.springframework.boot:spring-boot-configuration-processor: -> 2.1.4.RELEASE
+--- org.springframework:spring-aspects: -> 5.1.6.RELEASE
|    \--- org.aspectj:aspectjweaver:1.9.2
+--- org.springframework.boot:spring-boot-starter-web: -> 2.1.4.RELEASE
|    +--- org.springframework.boot:spring-boot-starter:2.1.4.RELEASE
|    |    +--- org.springframework.boot:spring-boot:2.1.4.RELEASE
|    |    |    +--- org.springframework:spring-core:5.1.6.RELEASE
|    |    |    |    \--- org.springframework:spring-jcl:5.1.6.RELEASE
|    |    |    \--- org.springframework:spring-context:5.1.6.RELEASE
|    |    |         +--- org.springframework:spring-aop:5.1.6.RELEASE
|    |    |         |    +--- org.springframework:spring-beans:5.1.6.RELEASE
|    |    |         |    |    \--- org.springframework:spring-core:5.1.6.RELEASE (*)
|    |    |         |    \--- org.springframework:spring-core:5.1.6.RELEASE (*)
|    |    |         +--- org.springframework:spring-beans:5.1.6.RELEASE (*)
|    |    |         +--- org.springframework:spring-core:5.1.6.RELEASE (*)
|    |    |         \--- org.springframework:spring-expression:5.1.6.RELEASE
|    |    |              \--- org.springframework:spring-core:5.1.6.RELEASE (*)
|    |    +--- org.springframework.boot:spring-boot-autoconfigure:2.1.4.RELEASE
|    |    |    \--- org.springframework.boot:spring-boot:2.1.4.RELEASE (*)
|    |    +--- org.springframework.boot:spring-boot-starter-logging:2.1.4.RELEASE
|    |    |    +--- ch.qos.logback:logback-classic:1.2.3
|    |    |    |    +--- ch.qos.logback:logback-core:1.2.3
|    |    |    |    \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.26
|    |    |    +--- org.apache.logging.log4j:log4j-to-slf4j:2.11.2
|    |    |    |    +--- org.slf4j:slf4j-api:1.7.25 -> 1.7.26
|    |    |    |    \--- org.apache.logging.log4j:log4j-api:2.11.2
|    |    |    \--- org.slf4j:jul-to-slf4j:1.7.26
|    |    |         \--- org.slf4j:slf4j-api:1.7.26
|    |    +--- javax.annotation:javax.annotation-api:1.3.2
|    |    +--- org.springframework:spring-core:5.1.6.RELEASE (*)
|    |    \--- org.yaml:snakeyaml:1.23
|    +--- org.springframework.boot:spring-boot-starter-json:2.1.4.RELEASE
|    |    +--- org.springframework.boot:spring-boot-starter:2.1.4.RELEASE (*)
|    |    +--- org.springframework:spring-web:5.1.6.RELEASE
|    |    |    +--- org.springframework:spring-beans:5.1.6.RELEASE (*)
|    |    |    \--- org.springframework:spring-core:5.1.6.RELEASE (*)
|    |    +--- com.fasterxml.jackson.core:jackson-databind:2.9.8
|    |    |    +--- com.fasterxml.jackson.core:jackson-annotations:2.9.0
|    |    |    \--- com.fasterxml.jackson.core:jackson-core:2.9.8
|    |    +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.8
|    |    |    +--- com.fasterxml.jackson.core:jackson-core:2.9.8
|    |    |    \--- com.fasterxml.jackson.core:jackson-databind:2.9.8 (*)
|    |    +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.8
|    |    |    +--- com.fasterxml.jackson.core:jackson-annotations:2.9.0
|    |    |    +--- com.fasterxml.jackson.core:jackson-core:2.9.8
|    |    |    \--- com.fasterxml.jackson.core:jackson-databind:2.9.8 (*)
|    |    \--- com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.8
|    |         +--- com.fasterxml.jackson.core:jackson-core:2.9.8
|    |         \--- com.fasterxml.jackson.core:jackson-databind:2.9.8 (*)
|    +--- org.springframework.boot:spring-boot-starter-tomcat:2.1.4.RELEASE
|    |    +--- javax.annotation:javax.annotation-api:1.3.2
|    |    +--- org.apache.tomcat.embed:tomcat-embed-core:9.0.17
|    |    +--- org.apache.tomcat.embed:tomcat-embed-el:9.0.17
|    |    \--- org.apache.tomcat.embed:tomcat-embed-websocket:9.0.17
|    |         \--- org.apache.tomcat.embed:tomcat-embed-core:9.0.17
|    +--- org.hibernate.validator:hibernate-validator:6.0.16.Final
|    |    +--- javax.validation:validation-api:2.0.1.Final
|    |    +--- org.jboss.logging:jboss-logging:3.3.2.Final
|    |    \--- com.fasterxml:classmate:1.3.4 -> 1.4.0
|    +--- org.springframework:spring-web:5.1.6.RELEASE (*)
|    \--- org.springframework:spring-webmvc:5.1.6.RELEASE
|         +--- org.springframework:spring-aop:5.1.6.RELEASE (*)
|         +--- org.springframework:spring-beans:5.1.6.RELEASE (*)
|         +--- org.springframework:spring-context:5.1.6.RELEASE (*)
|         +--- org.springframework:spring-core:5.1.6.RELEASE (*)
|         +--- org.springframework:spring-expression:5.1.6.RELEASE (*)
|         \--- org.springframework:spring-web:5.1.6.RELEASE (*)
+--- org.springframework.boot:spring-boot-starter-security: -> 2.1.4.RELEASE
|    +--- org.springframework.boot:spring-boot-starter:2.1.4.RELEASE (*)
|    +--- org.springframework:spring-aop:5.1.6.RELEASE (*)
|    +--- org.springframework.security:spring-security-config:5.1.5.RELEASE
|    |    +--- org.springframework.security:spring-security-core:5.1.5.RELEASE
|    |    |    +--- org.springframework:spring-aop:5.1.6.RELEASE (*)
|    |    |    +--- org.springframework:spring-beans:5.1.6.RELEASE (*)
|    |    |    +--- org.springframework:spring-context:5.1.6.RELEASE (*)
|    |    |    +--- org.springframework:spring-core:5.1.6.RELEASE (*)
|    |    |    \--- org.springframework:spring-expression:5.1.6.RELEASE (*)
|    |    +--- org.springframework:spring-aop:5.1.6.RELEASE (*)
|    |    +--- org.springframework:spring-beans:5.1.6.RELEASE (*)
|    |    +--- org.springframework:spring-context:5.1.6.RELEASE (*)
|    |    \--- org.springframework:spring-core:5.1.6.RELEASE (*)
|    \--- org.springframework.security:spring-security-web:5.1.5.RELEASE
|         +--- org.springframework.security:spring-security-core:5.1.5.RELEASE (*)
|         +--- org.springframework:spring-aop:5.1.6.RELEASE (*)
|         +--- org.springframework:spring-beans:5.1.6.RELEASE (*)
|         +--- org.springframework:spring-context:5.1.6.RELEASE (*)
|         +--- org.springframework:spring-core:5.1.6.RELEASE (*)
|         +--- org.springframework:spring-expression:5.1.6.RELEASE (*)
|         \--- org.springframework:spring-web:5.1.6.RELEASE (*)
+--- org.springframework.boot:spring-boot-devtools: -> 2.1.4.RELEASE
|    +--- org.springframework.boot:spring-boot:2.1.4.RELEASE (*)
|    \--- org.springframework.boot:spring-boot-autoconfigure:2.1.4.RELEASE (*)
+--- mysql:mysql-connector-java: -> 8.0.15
+--- org.springframework.boot:spring-boot-starter-actuator: -> 2.1.4.RELEASE
|    +--- org.springframework.boot:spring-boot-starter:2.1.4.RELEASE (*)
|    +--- org.springframework.boot:spring-boot-actuator-autoconfigure:2.1.4.RELEASE
|    |    +--- org.springframework.boot:spring-boot-actuator:2.1.4.RELEASE
|    |    |    \--- org.springframework.boot:spring-boot:2.1.4.RELEASE (*)
|    |    +--- org.springframework.boot:spring-boot-autoconfigure:2.1.4.RELEASE (*)
|    |    +--- com.fasterxml.jackson.core:jackson-databind:2.9.8 (*)
|    |    +--- org.springframework:spring-core:5.1.6.RELEASE (*)
|    |    +--- org.springframework:spring-context:5.1.6.RELEASE (*)
|    |    \--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.8 (*)
|    \--- io.micrometer:micrometer-core:1.1.4
|         +--- org.hdrhistogram:HdrHistogram:2.1.9
|         \--- org.latencyutils:LatencyUtils:2.0.3
+--- org.mybatis.spring.boot:mybatis-spring-boot-starter:2.0.1 -> 2.1.1
|    +--- org.springframework.boot:spring-boot-starter:2.1.9.RELEASE -> 2.1.4.RELEASE (*)
|    +--- org.springframework.boot:spring-boot-starter-jdbc:2.1.9.RELEASE -> 2.1.4.RELEASE
|    |    +--- org.springframework.boot:spring-boot-starter:2.1.4.RELEASE (*)
|    |    +--- com.zaxxer:HikariCP:3.2.0
|    |    |    \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.26
|    |    \--- org.springframework:spring-jdbc:5.1.6.RELEASE
|    |         +--- org.springframework:spring-beans:5.1.6.RELEASE (*)
|    |         +--- org.springframework:spring-core:5.1.6.RELEASE (*)
|    |         \--- org.springframework:spring-tx:5.1.6.RELEASE
|    |              +--- org.springframework:spring-beans:5.1.6.RELEASE (*)
|    |              \--- org.springframework:spring-core:5.1.6.RELEASE (*)
|    +--- org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.1
|    |    \--- org.springframework.boot:spring-boot-autoconfigure:2.1.9.RELEASE -> 2.1.4.RELEASE (*)
|    +--- org.mybatis:mybatis:3.5.3 -> 3.5.4
|    \--- org.mybatis:mybatis-spring:2.0.3
+--- org.springframework.boot:spring-boot-starter-data-jpa: -> 2.1.4.RELEASE
|    +--- org.springframework.boot:spring-boot-starter-aop:2.1.4.RELEASE
|    |    +--- org.springframework.boot:spring-boot-starter:2.1.4.RELEASE (*)
|    |    +--- org.springframework:spring-aop:5.1.6.RELEASE (*)
|    |    \--- org.aspectj:aspectjweaver:1.9.2
|    +--- org.springframework.boot:spring-boot-starter-jdbc:2.1.4.RELEASE (*)
|    +--- javax.transaction:javax.transaction-api:1.3
|    +--- javax.xml.bind:jaxb-api:2.3.1
|    |    \--- javax.activation:javax.activation-api:1.2.0
|    +--- org.hibernate:hibernate-core:5.3.9.Final
|    |    +--- org.jboss.logging:jboss-logging:3.3.2.Final
|    |    +--- javax.persistence:javax.persistence-api:2.2
|    |    +--- org.javassist:javassist:3.23.1-GA
|    |    +--- net.bytebuddy:byte-buddy:1.9.5 -> 1.9.12
|    |    +--- antlr:antlr:2.7.7
|    |    +--- org.jboss:jandex:2.0.5.Final
|    |    +--- com.fasterxml:classmate:1.3.4 -> 1.4.0
|    |    +--- javax.activation:javax.activation-api:1.2.0
|    |    +--- org.dom4j:dom4j:2.1.1
|    |    \--- org.hibernate.common:hibernate-commons-annotations:5.0.4.Final
|    |         \--- org.jboss.logging:jboss-logging:3.3.1.Final -> 3.3.2.Final
|    +--- org.springframework.data:spring-data-jpa:2.1.6.RELEASE
|    |    +--- org.springframework.data:spring-data-commons:2.1.6.RELEASE
|    |    |    +--- org.springframework:spring-core:5.1.6.RELEASE (*)
|    |    |    +--- org.springframework:spring-beans:5.1.6.RELEASE (*)
|    |    |    \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.26
|    |    +--- org.springframework:spring-orm:5.1.6.RELEASE
|    |    |    +--- org.springframework:spring-beans:5.1.6.RELEASE (*)
|    |    |    +--- org.springframework:spring-core:5.1.6.RELEASE (*)
|    |    |    +--- org.springframework:spring-jdbc:5.1.6.RELEASE (*)
|    |    |    \--- org.springframework:spring-tx:5.1.6.RELEASE (*)
|    |    +--- org.springframework:spring-context:5.1.6.RELEASE (*)
|    |    +--- org.springframework:spring-aop:5.1.6.RELEASE (*)
|    |    +--- org.springframework:spring-tx:5.1.6.RELEASE (*)
|    |    +--- org.springframework:spring-beans:5.1.6.RELEASE (*)
|    |    +--- org.springframework:spring-core:5.1.6.RELEASE (*)
|    |    \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.26
|    \--- org.springframework:spring-aspects:5.1.6.RELEASE (*)
+--- org.springframework.boot:spring-boot-starter-cache: -> 2.1.4.RELEASE
|    +--- org.springframework.boot:spring-boot-starter:2.1.4.RELEASE (*)
|    \--- org.springframework:spring-context-support:5.1.6.RELEASE
|         +--- org.springframework:spring-beans:5.1.6.RELEASE (*)
|         +--- org.springframework:spring-context:5.1.6.RELEASE (*)
|         \--- org.springframework:spring-core:5.1.6.RELEASE (*)
+--- org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.1 (*)
+--- org.mybatis:mybatis:3.5.4
+--- org.ehcache:ehcache: -> 3.6.3
|    \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.26
+--- org.hibernate:hibernate-jcache: -> 5.3.9.Final
|    +--- org.jboss.logging:jboss-logging:3.3.2.Final
|    +--- org.hibernate:hibernate-core:5.3.9.Final (*)
|    \--- javax.cache:cache-api:1.0.0 -> 1.1.0
+--- javax.cache:cache-api: -> 1.1.0
\--- org.modelmapper:modelmapper:2.3.6

...

(*) - dependencies omitted (listed previously)

(n) - Not resolved (configuration is not meant to be resolved)

BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed

And here is my stacktrace:

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression 'discHeader.discDetails'. Cause: org.apache.ibatis.ognl.NoSuchPropertyException: com.cntt.foo.bar.api.mybatis.entity.store.order.PosTransactionDeliveryDiscountHeaders.discDetails
    at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:92)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440)
    at com.sun.proxy.$Proxy190.insert(Unknown Source)
    at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:271)
    at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)
    at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:144)
    at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85)
    at com.sun.proxy.$Proxy193.insertTransactionDelivery(Unknown Source)
    at com.cntt.foo.bar.api.controller.PosApiController.postTransactionsDeliveries(PosApiController.java:76)
    at com.cntt.foo.bar.api.controller.PosApiController$$FastClassBySpringCGLIB$$e1350347.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:119)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
    at com.cntt.foo.bar.api.controller.PosApiController$$EnhancerBySpringCGLIB$$e466e9fb.postTransactionsDeliveries(<generated>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:189)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:908)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:108)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:90)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:209)
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:117)
    at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:106)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.ibatis.builder.BuilderException: Error evaluating expression 'discHeader.discDetails'. Cause: org.apache.ibatis.ognl.NoSuchPropertyException: com.cntt.foo.bar.api.mybatis.entity.store.order.PosTransactionDeliveryDiscountHeaders.discDetails
    at org.apache.ibatis.scripting.xmltags.OgnlCache.getValue(OgnlCache.java:48)
    at org.apache.ibatis.scripting.xmltags.ExpressionEvaluator.evaluateIterable(ExpressionEvaluator.java:43)
    at org.apache.ibatis.scripting.xmltags.ForEachSqlNode.apply(ForEachSqlNode.java:54)
    at org.apache.ibatis.scripting.xmltags.MixedSqlNode.lambda$apply$0(MixedSqlNode.java:32)
    at java.util.ArrayList.forEach(ArrayList.java:1257)
    at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:32)
    at org.apache.ibatis.scripting.xmltags.IfSqlNode.apply(IfSqlNode.java:35)
    at org.apache.ibatis.scripting.xmltags.MixedSqlNode.lambda$apply$0(MixedSqlNode.java:32)
    at java.util.ArrayList.forEach(ArrayList.java:1257)
    at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:32)
    at org.apache.ibatis.scripting.xmltags.DynamicSqlSource.getBoundSql(DynamicSqlSource.java:39)
    at org.apache.ibatis.mapping.MappedStatement.getBoundSql(MappedStatement.java:297)
    at org.apache.ibatis.executor.statement.BaseStatementHandler.<init>(BaseStatementHandler.java:64)
    at org.apache.ibatis.executor.statement.PreparedStatementHandler.<init>(PreparedStatementHandler.java:41)
    at org.apache.ibatis.executor.statement.RoutingStatementHandler.<init>(RoutingStatementHandler.java:46)
    at org.apache.ibatis.session.Configuration.newStatementHandler(Configuration.java:592)
    at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:48)
    at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
    at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    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:426)
    ... 91 common frames omitted
Caused by: org.apache.ibatis.ognl.NoSuchPropertyException: com.cntt.foo.bar.api.mybatis.entity.store.order.PosTransactionDeliveryDiscountHeaders.discDetails
    at org.apache.ibatis.ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:151)
    at org.apache.ibatis.ognl.OgnlRuntime.getProperty(OgnlRuntime.java:3233)
    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.Ognl.getValue(Ognl.java:560)
    at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:524)
    at org.apache.ibatis.scripting.xmltags.OgnlCache.getValue(OgnlCache.java:46)
    ... 116 common frames omitted

Let me know if you need anything else.

harawata commented 4 years ago

Thank you, @krkhnh ! Could you post the content of PosTransactionDeliveryDiscountHeaders.java ? It would be the easiest way for us to reproduce the problem on our end.

krkhnh commented 4 years ago

@harawata I'm sorry... false alarm. The stack trace has occurred because PosTransactionDeliveryDiscountHeaders.discDetails was indeed was not there. I had 2 classes with the same name and was confused by that for a few hours. Again, I'm so sorry for your inconvenience.

harawata commented 4 years ago

@krkhnh , No big deal. Thanks for the follow-up! :)

simonNozaki commented 4 years ago

We encountered the same problem!

MyBatis version

3.5.4

Database vendor and version

Oracle Database 18c

example project

Java : Amazon Corretto-11.0.3.7.1 This application executes SQL through Mybatis with multi-threading, and builds SQL by example generated by generator. App depends on Mybatis in gradle like below:

implementation group: 'org.mybatis', name: 'mybatis', version: '3.5.4'
mybatisGenerator group: 'org.mybatis.generator', name: 'mybatis-generator-core', version: '1.3.7'

And, we cannot encountered this exception with the situation that process a little data like unit testing. Please refer some stack traces below.

Steps to reproduce

Sorry, I don't know. Maybe this error occur by happen and cannot reproduce intentionally. We knew this error on production environment for the first time.

Expected result

Actual result

Full stack traces

2020-08-09 08:06:09  BTDK ERROR  :  org.apache.ibatis.exceptions.PersistenceException: 
            ### Error querying database.  Cause: org.apache.ibatis.builder.BuilderException: Error evaluating expression 'criteria.valid'. Cause: org.apache.ibatis.ognl.NoSuchPropertyException: com.example.app.entity.ElectronicBillingExclusionMailExample$Criteria.valid
            ### Cause: org.apache.ibatis.builder.BuilderException: Error evaluating expression 'criteria.valid'. Cause: org.apache.ibatis.ognl.NoSuchPropertyException: com.example.app.entity.ElectronicBillingExclusionMailExample$Criteria.valid
            at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
            at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:149)
            at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
            at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147)
            at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80)
            at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:144)
            at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85)
            at com.sun.proxy.$Proxy46.selectByExample(null:-1)
            at com.example.app.service.impl.ElectronicBillingExclusionMailMasterServiceImpl.getExclusionMailMaster(ElectronicBillingExclusionMailMasterServiceImpl.java:44)
            at com.example.app.handler.MailJudgeHandlerImpl.judgeMail(MailJudgeHandlerImpl.java:81)
            at com.example.app.batch.orderRequestQue.logic.impl.JudgeMailSendThreadLogicImpl.call(JudgeMailSendThreadLogicImpl.java:47)
            at com.example.app.batch.orderRequestQue.logic.impl.JudgeMailSendThreadLogicImpl.call(JudgeMailSendThreadLogicImpl.java:22)
            at java.util.concurrent.FutureTask.run(FutureTask.java:264)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
            at java.lang.Thread.run(Thread.java:834)
      Caused by: org.apache.ibatis.builder.BuilderException: Error evaluating expression 'criteria.valid'. Cause: org.apache.ibatis.ognl.NoSuchPropertyException: com.example.app.entity.ElectronicBillingExclusionMailExample$Criteria.valid
            at org.apache.ibatis.scripting.xmltags.OgnlCache.getValue(OgnlCache.java:48)
            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.lambda$apply$0(MixedSqlNode.java:32)
            at java.util.ArrayList.forEach(ArrayList.java:1540)
            at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:32)
            at org.apache.ibatis.scripting.xmltags.ForEachSqlNode.apply(ForEachSqlNode.java:79)
            at org.apache.ibatis.scripting.xmltags.MixedSqlNode.lambda$apply$0(MixedSqlNode.java:32)
            at java.util.ArrayList.forEach(ArrayList.java:1540)
            at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:32)
            at org.apache.ibatis.scripting.xmltags.TrimSqlNode.apply(TrimSqlNode.java:55)
            at org.apache.ibatis.scripting.xmltags.MixedSqlNode.lambda$apply$0(MixedSqlNode.java:32)
            at java.util.ArrayList.forEach(ArrayList.java:1540)
            at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:32)
            at org.apache.ibatis.scripting.xmltags.IfSqlNode.apply(IfSqlNode.java:35)
            at org.apache.ibatis.scripting.xmltags.MixedSqlNode.lambda$apply$0(MixedSqlNode.java:32)
            at java.util.ArrayList.forEach(ArrayList.java:1540)
            at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:32)
            at org.apache.ibatis.scripting.xmltags.DynamicSqlSource.getBoundSql(DynamicSqlSource.java:39)
            at org.apache.ibatis.mapping.MappedStatement.getBoundSql(MappedStatement.java:297)
            at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81)
            at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
            at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
            at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147)
            at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80)
            at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:144)
            at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85)
            at com.sun.proxy.$Proxy46.selectByExample(null:-1)
            at com.example.app.service.impl.ElectronicBillingExclusionMailMasterServiceImpl.getExclusionMailMaster(ElectronicBillingExclusionMailMasterServiceImpl.java:44)
            at com.example.app.handler.MailJudgeHandlerImpl.judgeMail(MailJudgeHandlerImpl.java:81)
            at com.example.app.batch.orderRequestQue.logic.impl.JudgeMailSendThreadLogicImpl.call(JudgeMailSendThreadLogicImpl.java:47)
            at com.example.app.batch.orderRequestQue.logic.impl.JudgeMailSendThreadLogicImpl.call(JudgeMailSendThreadLogicImpl.java:22)
            at java.util.concurrent.FutureTask.run(FutureTask.java:264)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
            at java.lang.Thread.run(Thread.java:834)
      Caused by: org.apache.ibatis.ognl.NoSuchPropertyException: com.example.app.entity.ElectronicBillingExclusionMailExample$Criteria.valid
            at org.apache.ibatis.ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:151)
            at org.apache.ibatis.ognl.OgnlRuntime.getProperty(OgnlRuntime.java:3233)
            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.Ognl.getValue(Ognl.java:560)
            at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:524)
            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.lambda$apply$0(MixedSqlNode.java:32)
            at java.util.ArrayList.forEach(ArrayList.java:1540)
            at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:32)
            at org.apache.ibatis.scripting.xmltags.ForEachSqlNode.apply(ForEachSqlNode.java:79)
            at org.apache.ibatis.scripting.xmltags.MixedSqlNode.lambda$apply$0(MixedSqlNode.java:32)
            at java.util.ArrayList.forEach(ArrayList.java:1540)
            at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:32)
            at org.apache.ibatis.scripting.xmltags.TrimSqlNode.apply(TrimSqlNode.java:55)
            at org.apache.ibatis.scripting.xmltags.MixedSqlNode.lambda$apply$0(MixedSqlNode.java:32)
            at java.util.ArrayList.forEach(ArrayList.java:1540)
            at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:32)
            at org.apache.ibatis.scripting.xmltags.IfSqlNode.apply(IfSqlNode.java:35)
            at org.apache.ibatis.scripting.xmltags.MixedSqlNode.lambda$apply$0(MixedSqlNode.java:32)
            at java.util.ArrayList.forEach(ArrayList.java:1540)
            at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:32)
            at org.apache.ibatis.scripting.xmltags.DynamicSqlSource.getBoundSql(DynamicSqlSource.java:39)
            at org.apache.ibatis.mapping.MappedStatement.getBoundSql(MappedStatement.java:297)
            at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81)
            at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
            at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
            at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147)
            at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80)
            at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:144)
            at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85)
            at com.sun.proxy.$Proxy46.selectByExample(null:-1)
            at com.example.app.service.impl.ElectronicBillingExclusionMailMasterServiceImpl.getExclusionMailMaster(ElectronicBillingExclusionMailMasterServiceImpl.java:44)
            at com.example.app.handler.MailJudgeHandlerImpl.judgeMail(MailJudgeHandlerImpl.java:81)
            at com.example.app.batch.orderRequestQue.logic.impl.JudgeMailSendThreadLogicImpl.call(JudgeMailSendThreadLogicImpl.java:47)
            at com.example.app.batch.orderRequestQue.logic.impl.JudgeMailSendThreadLogicImpl.call(JudgeMailSendThreadLogicImpl.java:22)
            at java.util.concurrent.FutureTask.run(FutureTask.java:264)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
            at java.lang.Thread.run(Thread.java:834) com.example.app.handler.MailJudgeHandlerImpl [pool-1-thread-3]
harawata commented 4 years ago

@simonNozaki ,

Thank you for the info! It seems that OGNL's bridge method handling is broken again in a different way. I submitted a PR that should address the problem in OGNL. I'll keep you posted.

simonNozaki commented 4 years ago

Hi, @harawata

Thank you for quick response. I had no idea that this is OGNL related issue.

I'm looking forward to proceeding to resolve this problem.

Thanks.

harawata commented 4 years ago

@simonNozaki , OGNL team accepted the PR and released a new version. 👍

To all, It would be great if you could test the latest MyBatis 3.5.6-SNAPSHOT with your solution.

Thank you!

simonNozaki commented 4 years ago

Hi, @harawata

It's so nice! Yes, I want to try this soon if I can ( because this bug occur on production...)

jinjim commented 3 years ago

it seems unstable of ognl,do we have a plan to rewrite or replace it ?

harawata commented 3 years ago

@jinjim ,

I have considered it (I even wrote a patch), but am not convinced if supporting alternative EL engine improves the situation (there will be syntax differences, the alternative EL engine might have its own issues, etc.).

Although OGNL has had several issues and its source code is a little bit chaotic, the OGNL team responds quickly once we come up with a solution. And I value that point highly.

jinjim commented 3 years ago

@jinjim ,

I have considered it (I even wrote a patch), but am not convinced if supporting alternative EL engine improves the situation (there will be syntax differences, the alternative EL engine might have its own issues, etc.).

Although OGNL has had several issues and its source code is a little bit chaotic, the OGNL team responds quickly once we come up with a solution. And I value that point highly.

thank you for your reply

xiateapu commented 3 years ago

@simonNozaki , OGNL team accepted the PR and released a new version. 👍

To all, It would be great if you could test the latest MyBatis 3.5.6-SNAPSHOT with your solution.

Thank you!

excuse me, We encountered the same problem in 3.5.2, so upgrade to 3.5.6 will resolve this issue?

Paul-Gerarts commented 2 years ago

I still encounter the same problem after using SpringBoot in a executable jar, which has a nested jar as dependency (which uses regular Spring). Using jdk1.8.0_251, we still have race-conditions resulting in the following stacktrace:

mybatis_noSuchPropertyException_stacktrace.txt

Naturally, we've first tried upgrading to the latest versions in our POM, but without success.


        <dependency>
              <groupId>org.mybatis</groupId>
              <artifactId>mybatis</artifactId>
              <version>3.5.7</version>
        </dependency>

        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis-spring</artifactId>
            <version>2.0.6</version>
        </dependency>

        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>2.2.0</version>
        </dependency>

Most exceptions are triggered, but not limited to, the entry.value when using nested < foreach > in a query. 
harawata commented 2 years ago

@Paul-Gerarts , The error says java.util.Collections$SynchronizedSet.value does not exist which is correct. There must be an error somewhere in your <foreach />. Please ask it on StackOverflow or mailing list. We may need the details about the mapper statement, parameters, etc..

Paul-Gerarts commented 2 years ago

@Paul-Gerarts , The error says java.util.Collections$SynchronizedSet.value does not exist which is correct. There must be an error somewhere in your <foreach />. Please ask it on StackOverflow or mailing list. We may need the details about the mapper statement, parameters, etc..

Working on a legacy project and the mapper statements, parameters, etc. have not been changed. All works perfectly fine when running from IDE, but the problem occurs when running from jar command. Thanks for replying, I will continue to investigate. Surely it'll be a self-induced error while upgrading something else, but I had to reach out for alternatives. As soon as I reach a conclusion, I'll leave an update here.

EDIT: we came from mybatis 3.1.1 and missed the change of issue #208 (version 3.2.x) impacting the way the < foreach > works for Map.