-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
ognl 3.4.5 - Issue with using custom class loader in getValue #350
Comments
We made a workaround so we can use 3.4.5 but have it work with the test |
Thanks for reporting this, yet I'm not sure if I understand the problem. In your code
should |
This is pure Apache Camel code (context is not Ognl context here). This code is what setup Camel to use that custom hacked classloader we use in the unit test. |
Hm... so why does it fail? I don't see a connection with the change and OGNL :( |
I think its this code change in src/main/java/ognl/Ognl.java (link to PR in top) see the code changes in I would assume that ognl when attempting to load the class |
So its maybe due to this change / wrapping
|
My gut feeling is that |
@davsclaus please review the linked PR, it should solve the problem. |
At Apache Camel we have a camel-ognl module
https://github.com/apache/camel/tree/main/components/camel-ognl
When we upgrade from 3.4.4 to 3.4.5 we had an unit test error in one of our tests.
https://github.com/apache/camel/blob/main/components/camel-ognl/src/test/java/org/apache/camel/language/ognl/OgnlTest.java#L48
At first sight I suspect its this change
#337
in the
getValue
method, that somehow the custom classloader that Camel will provide in the unit test is not being in use.The custom class loader is part of the test
https://github.com/apache/camel/blob/main/components/camel-ognl/src/test/java/org/apache/camel/language/ognl/MyClassResolver.java#L30
where the classloader will now correctly fix the classname and load the class (notice the Animal1 vs Animal) in the name.
The camel code that creates the ognl context and invokes ognl from camel in that test is executing this code
https://github.com/apache/camel/blob/main/components/camel-ognl/src/main/java/org/apache/camel/language/ognl/OgnlExpression.java#L53
The text was updated successfully, but these errors were encountered: