Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException #3165

Closed
yudarer opened this issue May 19, 2024 · 2 comments

Comments

@yudarer
Copy link

yudarer commented May 19, 2024

MyBatis version

3.5.14

Database vendor and version

Mysql 8.0.29

Test case or example project

https://github.com/yudarer/demo.git

Steps to reproduce

I have a POJO class named Info, which has the fields id and band. I encountered an exception when using dynamic SQL insertion: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression 'band!=null'. When I debugged the code, I found that there was a problem with the method org.apache.ibatis.ognl.Ognl#parseExpression. However, when I changed the entity field to bandName, it could be saved without any exceptions. Could you run my sample code, you will see the exception occurs.

Expected result

use field band can save it no exception

Actual result

MyBatisSystemException

@harawata
Copy link
Member

Hello @yudarer ,

Please post the CREATE TABLE statement for the info table.

Also, when reporting an exception, it is important to include the entire stack trace.

@harawata
Copy link
Member

The issue you reported probably is the known limitation of OGNL.

Only or is mentioned there, but and is the same, I think.

One workaround is to reference the parameter as _parameter['band'] instead of band.

I'll close this as there is nothing we can do in MyBatis side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants