java.lang.reflect.InvocationTargetException
jsp项目运行时报错:
java.lang.NoClassDefFoundError:org/bouncycastle/jcajce/provider/digest/SM3$Digest
java.lang.ClassNotFoundExcetion:org.bouncycastle.jcajce.provider.digest.SM3$Digest
解决方法:
使用maven引入bcprov-jdk16的jar包依赖:
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk16 -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk16</artifactId>
<version>1.46</version>
</dependency>
然后,到本地maven仓库中找到该文件的位置:
org.bouncycastle.bcprov-jdk15on.1.64.bcprov-jdk15on-1.64.jar
将该jar包引入到项目中的lib中,编译即可。