Exception in thread "main" java.lang.NoSuchMethodError

错误信息:

Exception in thread "main" java.lang.NoSuchMethodError: org.geotools.geometry.jts.ReferencedEnvelope.reference(Lorg/opengis/geometry/BoundingBox;)Lorg/geotools/geometry/jts/ReferencedEnvelope;
    at org.geotools.data.Diff.addToSpatialIndex(Diff.java:225)
    at org.geotools.data.Diff.add(Diff.java:217)
    at org.geotools.data.store.DiffContentFeatureWriter.write(DiffContentFeatureWriter.java:184)
    at org.geotools.data.InProcessLockingManager$1.write(InProcessLockingManager.java:337)
    at com.wayhe.util.WGSConverter.toWGS(WGSConverter.java:60)

    at com.wayhe.util.WGSConverter.main(WGSConverter.java:100)


From the Javadoc for NoSuchMethodError:

Thrown if an application tries to call a specified method of a class (either static or instance), and that class no longer has a definition of that method.

Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.


解决方法:检查运行时和编译期是否引用相同的jar包,或者是有同名的类


猜你喜欢

转载自blog.csdn.net/qq_38286331/article/details/80170082