-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
org.apache.ibatis.ognl.NoSuchPropertyException, java.lang.String with mybatis 5.0 #1648
Comments
Hi @phanikardev , I assume you meant mybatis-spring 1.1.1 (which depends on mybatis 3.1.1).
|
same problem! mybatis-3.5.1;Database:mysql
|
@jinjim , Thanks for the stack trace! |
the ongl expression is 'ew.entity.id !=null', we used midware of my mybatis-plus,but the this problem Randomly occurring |
@jinjim , |
yes!i am sure.occasionally appear! |
@jinjim ,
|
Because of company security issues,i would like to email you if you do not mind! |
@jinjim , I tried to reproduce it, but couldn't. If you (or anyone) find a way to reproduce the error, please let us know how. |
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 |
Once a field is made accessible, we keep it accessible. Flipping accessible flag causes a race condition. Possibly related to mybatis#1648 .
I found one race condition that could be related. @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.
This happens when the target member ( 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. Thank you! |
I add get set method to DataClass,and set OgnlMemberAccess to orginal.and the test run well. |
@jinjim , |
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:
And here is my stacktrace:
Let me know if you need anything else. |
Thank you, @krkhnh ! |
@harawata I'm sorry... false alarm. The stack trace has occurred because |
@krkhnh , No big deal. Thanks for the follow-up! :) |
We encountered the same problem! MyBatis version3.5.4 Database vendor and versionOracle Database 18c example projectJava : Amazon Corretto-11.0.3.7.1
And, we cannot encountered this exception with the situation that process a little data like unit testing. Steps to reproduceSorry, I don't know. Expected resultActual resultFull stack traces
|
Thank you for the info! |
Hi, @harawata Thank you for quick response. I'm looking forward to proceeding to resolve this problem. Thanks. |
@simonNozaki , To all, Thank you! |
Hi, @harawata It's so nice! |
it seems unstable of ognl,do we have a plan to rewrite or replace it ? |
@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 |
excuse me, We encountered the same problem in 3.5.2, so upgrade to 3.5.6 will resolve this issue? |
I still encounter the same problem after using SpringBoot in a executable jar, which has a nested jar as dependency (which uses regular Spring). mybatis_noSuchPropertyException_stacktrace.txt Naturally, we've first tried upgrading to the latest versions in our POM, but without success.
|
@Paul-Gerarts , |
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. 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. |
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
The text was updated successfully, but these errors were encountered: