NoSuchMethodError on startup in Java Jersey app

前端 未结 4 1098
伪装坚强ぢ
伪装坚强ぢ 2020-11-27 17:50

I\'ve been getting a very strange error when trying to start a Jersey app on Tomcat. The same code works on other computers. I tried reinstalling tomcat, all my maven depend

4条回答
  •  日久生厌
    2020-11-27 18:20

    the problem is related about "com.sun.jersey:jersey-core:jar:1.18.3" (or any 1.* version) because old versions of Jersey didn't have that "public Map getProperties()" method.

    And one of your dependencies use Jersey version 1 (you can check that in running mvn dependency:tree and search all jersey-core version used)

    Me I have resolved the problem deleting all com.sun.jersey dependancies (old api) and using the new one org.glassfish.jersey API

    https://mvnrepository.com/artifact/org.glassfish.jersey.core

提交回复
热议问题