jar reference exception investigation

Project uses docker packaged by switching maven plugin Google jib, I found that the project will be prompted method does not exist,

java.lang.NoSuchMethodError: com.zcckj.common.utils.JsonUtils.toJsonString(Ljava/lang/Object;)Ljava/lang/String;

But the original plug-packaged items, including now the local startup is ok!

Investigation method:

Use -verbose: class View class loader:

[Loaded com.zcckj.common.utils.JsonUtils from file:/app/libs/zc-component-common-1.1.9.jar]

This class is found from an old jar inside to take the project, and this method is not new, so NoSuchMethodError

 

Settlement Act:

<exclusion>
    <artifactId>zc-component-common</artifactId>
    <groupId>com.zcckj.component</groupId>
</exclusion>

Restart, ok!

Published 33 original articles · won praise 6 · views 10000 +

Guess you like

Origin blog.csdn.net/kuangni5808/article/details/103005170