# Tomcat: FileNotFoundException - "Failed to scan"

### Problem <a href="#problem" id="problem"></a>

In the tomcat log, there are multiple java.io.FileNotFoundException exceptions similar to the following:

{% code overflow="wrap" lineNumbers="true" %}

```
org.apache.tomcat.util.scan.StandardJarScanner scan
WARNING: Failed to scan [file:/tmp/sealights/httpcore-4.4.5.jar] from classloader hierarchy
java.io.FileNotFoundException: /tmp/sealights/httpcore-4.4.5.jar (No such file or directory)
                at java.util.zip.ZipFile.open(Native Method)
                at java.util.zip.ZipFile.<init>(ZipFile.java:219)
                at java.util.zip.ZipFile.<init>(ZipFile.java:149)
                at java.util.jar.JarFile.<init>(JarFile.java:166)
                at java.util.jar.JarFile.<init>(JarFile.java:130)
                at org.apache.tomcat.util.scan.JarFileUrlJar.<init>(JarFileUrlJar.java:60)
                at org.apache.tomcat.util.scan.JarFactory.newInstance(JarFactory.java:43)
                at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:322)
                at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:272)
                at org.apache.catalina.startup.ContextConfig.processJarsForWebFragments(ContextConfig.java:1887)
                at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1127)
                at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:779)
                at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:306)
                at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
                at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
                at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5202)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
                at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:940)
                at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1816)
                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                at java.lang.Thread.run(Thread.java:745)
```

{% endcode %}

### Cause <a href="#cause" id="cause"></a>

This is not an error, but rather just a warning that was introduced in Tomcat version 8.0.34 after fixing Apache's [Bug 59226](https://bz.apache.org/bugzilla/show_bug.cgi?id=59226)

### Solution <a href="#solution" id="solution"></a>

Since Tomcat 8.0.38 you can configure and disable the scanning of the MANIFEST.MF file, see [The Jar Scanner Component](https://tomcat.apache.org/tomcat-8.0-doc/config/jar-scanner.html)

To turn scanning off, add the following line in `context.xml`:

{% code overflow="wrap" lineNumbers="true" %}

```
<Context>
  <JarScanner scanManifest="false"/>
</Context>
```

{% endcode %}

### References <a href="#references" id="references"></a>

<https://bz.apache.org/bugzilla/show_bug.cgi?id=59226>\
<https://bz.apache.org/bugzilla/show_bug.cgi?id=59961>\
<https://tomcat.apache.org/tomcat-8.0-doc/config/jar-scanner.html>\
<https://stackoverflow.com/questions/42329948/upgrade-from-tomcat-8-0-39-to-8-0-41-results-in-failed-to-scan-errors>

### Related articles <a href="#related-articles" id="related-articles"></a>

* [pivotal-cloud-foundry-pcf-support](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/java-agent/pivotal-cloud-foundry-pcf-support "mention") (Java)
* [nodejs-javascript-heap-out-of-memory](https://docs.sealights.io/knowledgebase/setup-and-configuration/troubleshooting-faq/node-javascript/nodejs-javascript-heap-out-of-memory "mention")
* [testing-frameworks-integration](https://docs.sealights.io/knowledgebase/setup-and-configuration/integrations/testing-frameworks-integration "mention")
* [installing-the-coverage-listener-as-a-jvm-java-agent](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/java-agent/default-usage-cli/installing-the-coverage-listener-as-a-jvm-java-agent "mention") (Java)
* [cd-agent-for-java-application](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/cd-agent/cd-agent-for-java-application "mention")
