MyBatis version
3.0.4
Database vendor and version
Test case or example project
Steps to reproduce
1call mapper method in non main thread
Expected result
normal
Actual resultCaused by: java.lang.NullPointerException
at com.sun.org.apache.xerces.internal.dom.ParentNode.nodeListItem(ParentNode.java:776)
at com.sun.org.apache.xerces.internal.dom.ParentNode.item(ParentNode.java:800)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseDynamicTags(XMLStatementBuilder.java:74)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:43)
at org.apache.ibatis.session.Configuration.parseStatementNodes(Configuration.java:513)
at org.apache.ibatis.session.Configuration.buildStatementsForNamespace(Configuration.java:502)
at org.apache.ibatis.session.Configuration.buildStatementsFromId(Configuration.java:467)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:391)
at org.apache.ibatis.binding.MapperMethod.setupCommandType(MapperMethod.java:160)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:48)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:37)
a
Comment From: harawata
Hello @18705320883 ,
The exception implies that multiple threads are accessing the DOM object which is not thread-safe. In other words, it looks like a coding-error rather than a bug in MyBatis or JDK.
If you still believe it is a MyBatis bug, please ...
- Test if the problem reproduces with the latest version (3.5.5 at the moment).
- Create a small demo app so that we can reproduce the NPE on our end and share it on GitHub.
Comment From: harawata
No reply.