title: Unable to complete the scan for annotations for web application [/app] due to a StackOverflowError
body: <p>I am developing a Spring MVC application using STS (eclipse plugin) and maven.</p>
  
  <p>For creating the project, I followed the STS wizard for a new "Spring MVC project". Afterwards, I added some dependencies to other projects and libraries.</p>
  
  <p>However, when I am now trying to deploy the project to the integrated vFabric server of STS, I sometimes get an exception:</p>
  
  <pre><code>SEVERE: ContainerBase.addChild: start: 
  org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/wsa]]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
      ...
  Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [/app] due to a StackOverflowError. Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies. The class hierarchy being processed was [org.bouncycastle.asn1.ASN1EncodableVector-&gt;org.bouncycastle.asn1.DEREncodableVector-&gt;org.bouncycastle.asn1.ASN1EncodableVector]
      at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2179)
      ...
  </code></pre>
  
  <p>When issuing a "maven clean", followed by a "maven install" and a restart of the server, the exception sometimes doesn't get thrown and the application works fine. Yet, most of the times, it doesn't work.</p>
  
  <p>I guess there is no need to scan the bouncycastle dependencies for annotations.<br>
  Can I somehow disable this scanning for some jars?</p>
  
  <p>I already tried adding <code>metadata-complete="true"</code> to my web.xml and increasing the stack size with no result.</p>
  
  <p>What can I do to fix this?</p>