2016-06-28 120 views
1

我在Jetty 9.2.10.v20150310中运行SpringMVC应用程序时没有问题。 但是,只要我在BouncyCastle上添加依赖项,扫描就会永久存在并且服务器超时。BouncyCastle在SpringMVC中导致扫描超时

我只有在项目

 <!-- bouncy castle --> 
    <dependency> 
     <groupId>org.bouncycastle</groupId> 
     <artifactId>bcpkix-jdk15on</artifactId> 
     <version>1.54</version> 
    </dependency> 

依赖关系树一个BouncyCastle的依赖证实:

mvn dependency:tree -Dincludes=org.bouncycastle 

生产:

[INFO] Building application-myapp 1.0.0-SNAPSHOT 
[INFO] ------------------------------------------------------------------  ------ 
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ application-myapp --- 
[INFO] com.my-company:application-myapp:war:1.0.0-SNAPSHOT 
[INFO] \- org.bouncycastle:bcpkix-jdk15on:jar:1.54:compile 
[INFO] \- org.bouncycastle:bcprov-jdk15on:jar:1.54:compile 
[INFO] ------------------------------------------------------------------ ------ 
[INFO] BUILD SUCCESS 

任何人之前看到了吗?

注:我也尝试了最新版本码头与9.3.10.v20160621相同的结果

当我运行MVN:码头工艺与-XI看到它是停留在一个长循环扫描BouncyCastle的罐子,这样基本上看到输出了大约两分钟:

[DEBUG] Scanning class from jar jar:file:///C:/Users/vgrazi/.m2/org/bouncycastle/bcprov-jdk15on/1.54/bcprov-jdk15on-1.54.jar!/org/bouncycastle/crypto/digests/SHA3Digest.class 
[DEBUG] Scanning class from jar jar:file:///C:/Users/vgrazi/.m2/org/bouncycastle/bcprov-jdk15on/1.54/bcprov-jdk15on-1.54.jar!/org/bouncycastle/crypto/digests/SHA512Digest.class 
[DEBUG] Scanning class from jar jar:file:///C:/Users/vgrazi/.m2/org/bouncycastle/bcprov-jdk15on/1.54/bcprov-jdk15on-1.54.jar!/org/bouncycastle/crypto/digests/SHA512tDigest.class 
[DEBUG] Scanning class from jar jar:file:///C:/Users/vgrazi/.m2/org/bouncycastle/bcprov-jdk15on/1.54/bcprov-jdk15on-1.54.jar!/org/bouncycastle/crypto/digests/SHAKEDigest.class 
[DEBUG] Scanning class from jar jar:file:///C:/Users/vgrazi/.m2/org/bouncycastle/bcprov-jdk15on/1.54/bcprov-jdk15on-1.54.jar!/org/bouncycastle/crypto/digests/SM3Digest.class 
[DEBUG] Scanning class from jar jar:file:///C:/Users/vgrazi/.m2/org/bouncycastle/bcprov-jdk15on/1.54/bcprov-jdk15on-1.54.jar!/org/bouncycastle/crypto/digests/ShortenedDigest.class 
[DEBUG] Scanning class from jar jar:file:///C:/Users/vgrazi/.m2/org/bouncycastle/bcprov-jdk15on/1.54/bcprov-jdk15on-1.54.jar!/org/bouncycastle/crypto/digests/SkeinDigest.class 
[DEBUG] Closing JarFile C:\Users\vgrazi\.m2\org\bouncycastle\bcprov-jdk15on\1.54\bcprov-jdk15on-1.54.jar 
[DEBUG] Closing JarFile C:\Users\vgrazi\.m2\org\bouncycastle\bcprov-jdk15on\1.54\bcprov-jdk15on-1.54.jar 
[DEBUG] Closing JarFile C:\Users\vgrazi\.m2\org\bouncycastle\bcprov-jdk15on\1.54\bcprov-jdk15on-1.54.jar 
+1

尝试获取线程转储以查看其卡住的位置。 – Roman

+0

我很确定这是基于其他帖子的组件扫描 –

回答

1

我们从码头 - Maven的插件消除BouncyCastle的罐子得到了这个工作。请注意webInfIncludeJarPattern中的“排除”bouncycastle lookahead正则表达式:

<plugin> 
    <groupId>org.eclipse.jetty</groupId> 
    <artifactId>jetty-maven-plugin</artifactId> 
    <version>${jetty.version}</version> 
    <configuration combine.self="override"> 
     . . . 
     <webApp> 
     <contextPath>${jetty.context}</contextPath> 
      <webInfIncludeJarPattern>^((?!bouncycastle).)*$</webInfIncludeJarPattern> 
     </webApp> 
     <jettyConfig>${jetty.xml}</jettyConfig> 
     . . . 
相关问题