[Bug solution] idea debug appears no such instance method: 'XXX'

1. Scene reproduction:

        Since I added a field to a mangodb table in project B as a tentative flag, and then packaged and deployed it with jenkins, and project A relied on project B, then deleted and reloaded the relevant dependencies in A's maven repos, loaded Then call the Dao layer to call the newly added flag field

    The following code:

    BXXXDAO.getFlag();

Then use execution in IDEA debug mode to try to get the result of the BXXXDAO.getFlag() method. At this time, no such instance method: 'x' appears, which is really inexplicable!

2. Problem analysis and solution

                After searching for a long time, including the decompilation and investigation of the dependent jar package, I found that there are new fields in the jar package.

You can use jd-gui to decompile and view the jar package tool. Personally, it feels good.

                Finally, after repeated investigations, I suddenly considered whether the file did not take effect, so I tried maven to solve it, first clean, then compile , and found that it was all right (I tried to clean before, but forgot to compile, a headache), and finally found the file. The reason for the problem is: the file compilation part does not take effect . Of course, specific issues are analyzed in detail. This question is for reference only. If you have any questions, please leave a message in the comment area for discussion, and you will reply as soon as you see it.

Guess you like

Origin blog.csdn.net/gongzi_9/article/details/130293023