PropertyUtils.getPropertyValue - Finding "wrong" getter
See original GitHub issueFrom @corrspt on July 18, 2016 19:16
Hi Guys,
I’m sorry if this is not really an issue with Katharsis, but I would like to ask if someone has an opinion on why this might happen. I’m using Play Framework (2.5) with Katharsis 2.1.1 and using reflections 0.9.9. As Katharsis does not have a direct integration with play, I sort of have a hack to make it work, but still.
I’m getting an error like the following:
2016-07-18T18:39:14.512107+00:00 app[web.1]: ... 66 common frames omitted
2016-07-18T18:39:14.512108+00:00 app[web.1]: Caused by: java.lang.reflect.InvocationTargetException: null
2016-07-18T18:39:14.512108+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2016-07-18T18:39:14.512109+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2016-07-18T18:39:14.512110+00:00 app[web.1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2016-07-18T18:39:14.512110+00:00 app[web.1]: at java.lang.reflect.Method.invoke(Method.java:498)
2016-07-18T18:39:14.512111+00:00 app[web.1]: at io.katharsis.utils.PropertyUtils.getPropertyValue(PropertyUtils.java:79)
2016-07-18T18:39:14.512112+00:00 app[web.1]: at io.katharsis.utils.PropertyUtils.getProperty(PropertyUtils.java:47)
2016-07-18T18:39:14.512112+00:00 app[web.1]: ... 72 common frames omitted
2016-07-18T18:39:14.512113+00:00 app[web.1]: Caused by: java.lang.NoSuchMethodError: com.example.models.Certificate.getShieldingCapFluxCommercialDesignationTestPiece()Lcom/google/common/base/Optional;
This error only occurs on my app deployed on Heroku, not on my local machine.
The error is really strange because, it basically says that it does not find the getShieldingCapFluxCommercialDesignationTestPiece
method that returns a google Optional
, which makes sense because I’m using Java 8’ Optional (and nowhere in my class, or even in my project I’m using Google’s Optional directly in my code).
Does anyone know why this might happen? I tried removing the usage of “Optional” in my code and deployed it to Heroku and it seems to be working. On the other hand, I have other classes which use Optional (java.util) and the problem does not seem to be happening.
Thanks a lot for any input.
Copied from original issue: katharsis-project/katharsis-core#366
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (6 by maintainers)
Top GitHub Comments
Sure, I can’t reproduce locally. Could be something on Heroku. If it happens when I am able to upgrade to a later version, I’ll ping again.
Thanks for the work on Katharsis.
I close this issue since it might be more a Heroku problem, not Katharsis. We’re using standard Java reflection mechanisms, no dirty hacks 😃