question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PropertyUtils.getPropertyValue - Finding "wrong" getter

See original GitHub issue

From @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:closed
  • Created 7 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
corrsptcommented, Aug 12, 2016

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.

0reactions
meshugacommented, Aug 11, 2016

I close this issue since it might be more a Heroku problem, not Katharsis. We’re using standard Java reflection mechanisms, no dirty hacks 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting a property/field name using getter method of a pojo ...
For example by using the getter method: String propertyName = PropertyUtils. ... Inherited class may find an issue here.
Read more >
BeanUtils getProperty not working? · Issue #569 · google/auto
I think @tbroyer is correct. AutoValue allows you to call the getter for the status property either status() or getStatus() , provided you...
Read more >
org.apache.commons.beanutils.PropertyUtils.isReadable java ...
Return true if the specified property name identifies a readable property on the specified bean; otherwise, return false . For more details see ......
Read more >
PropertyUtils (Apache Commons BeanUtils 1.9.4 API)
Return an accessible property getter method for this property, if there is one; ... a readable property on the specified bean; otherwise, return...
Read more >
Java Examples for org.apache.commons.beanutils.PropertyUtils
This java examples will help you to understand the usage of org.apache.commons.beanutils.PropertyUtils. These source code samples are taken from different ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found