I\'m receving the following error on log file.
(java.lang.SecurityException: class \"com.adventnet.snmp.snmp2.SecurityModelTable\"\'s signer inform
In my program, I have loaded two version of the same packages. One is boprov-jdk15-140.jar
, the other is bcprov-jdk15-151.jar
. The two are conflicted.
In the JAR package's MANIFEST.MF file, it has the following digest:
Name: org/bouncycastle/crypto/digests/SM3Digest.class
SHA1-Digest: xxxxxxxx
The two JAR file has different SHA1-Digest info.
java.lang.SecurityException: class “org.bouncycastle.asn1.ASN1ObjectIdentifier”‘s signer information does not match signer information of other classes in the same package
Ans: I was also facing same exception when I was trying to make PDF password protected.
I added below jars to resolve the same.
◾itextpdf-5.2.1.jar ◾bcmail-jdk16-1.46.jar ◾bcprov-jdk16-1.46.jar ◾bctsp-jdk16-1.46.jar
It means that you have two or more classes in the same package with different signature data. Usually that means the classes come from different JARs, one of which is signed and the other is unsigned.
In my case I had:
Caused by: java.lang.SecurityException: class "org.bouncycastle.util.Strings"'s signer information does not match signer information of other classes in the same package
It was a project with a lot of dependencies and the mvn dependency:tree information did not really helped me.
Here is how I solved my issue:
Problem solved.
I encountered this exception while running a Scala/Spark project in Eclipse (Mars) on Windows and it prevented me from debugging and running the project in the IDE. The project used a Maven pom.xml file. It took a while to resolve, so I'm posting detailed steps here to help others:
You may find it in a section that looks like this:
+- org.apache.hadoop:hadoop-mapreduce-client-core:jar:2.6.0:provided
+- javax.servlet:servlet-api:jar:2.5:provided
The Maven group ID that you want to exclude the duplicate class from in the above is: hadoop-mapreduce-client-core
Add an exclusions section listing the groupid of the exclusion in the pom.xml after the offending package. In my case, this was the groupid javax.servlet.
Note that you can't resolve this issue by reordering the Java build path as some have posted for a similar problem.
I encountered this issue in a Spring boot application. My issue was that I had Junit in the build path which has Org.hamcrest.Matchers.* and Hamcrest which was resident in library of Spring framework in my pom.xml in eclipse repository. So what I did was remove Junit from my build path. Included Junit only in my pom.xml. So my application depended on Maven for Junit and the *Matchers. So somehow you have two jars for one need. Maybe as a library and as configuration file.