Java SecurityException: signer information does not match

后端 未结 18 3098
迷失自我
迷失自我 2020-11-22 12:56

I recompiled my classes as usual, and suddenly got the following error message. Why? How can I fix it?

java.lang.SecurityException: class \"Chinese_English_D         


        
18条回答
  •  生来不讨喜
    2020-11-22 13:57

    A. If you use maven, an useful way to debug clashing jars is:

    mvn dependency:tree
    

    For example, for an exception:

    java.lang.SecurityException: class "javax.servlet.HttpConstraintElement"'s signer information does not match signer information of other classes in the same package
    

    we do:

    mvn dependency:tree|grep servlet
    

    Its output:

    [INFO] +- javax.servlet:servlet-api:jar:2.5:compile
    [INFO] +- javax.servlet:jstl:jar:1.2:compile
    [INFO] |  +- org.eclipse.jetty.orbit:javax.servlet.jsp:jar:2.2.0.v201112011158:compile
    [INFO] |  +- org.eclipse.jetty.orbit:javax.servlet.jsp.jstl:jar:1.2.0.v201105211821:compile
    [INFO] |  +- org.eclipse.jetty.orbit:javax.servlet:jar:3.0.0.v201112011016:compile
    [INFO] +- org.eclipse.jetty:jetty-servlet:jar:9.0.0.RC2:compile
    

    shows clashing servlet-api 2.5 and javax.servlet 3.0.0.x.

    B. Other useful hints (how to debug the security exception and how to exclude maven deps) are at the question at Signer information does not match.

提交回复
热议问题