Xalan\xalan\2.7.2\xercesimpl.jar (the system could not find the specified file) issue

Source: Internet
Author: User

This article transferred from: http://blog.csdn.net/lveliu/article/details/77772828

Environment Construction: Maven+tomcat

Tomcat 8.5. More than 2 changes will occur (including 8.5.2)

Begin:

Warning: Failed to scan [File:/d:/develop/repo/xalan/xalan/2.7.2/xercesimpl.jar] from ClassLoader hierarchy
Java.io.filenotfoundexception:d:\xxx Directory \xalan\xalan\2.7.2\xercesimpl.jar (the system cannot find the file specified.) )
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:327)
At Org.apache.tomcat.util.scan.StandardJarScanner.scan (standardjarscanner.java:277)
At Org.apache.catalina.startup.ContextConfig.processJarsForWebFragments (contextconfig.java:1887)
At Org.apache.catalina.startup.ContextConfig.webConfig (contextconfig.java:1122)
At Org.apache.catalina.startup.ContextConfig.configureStart (contextconfig.java:771)
At Org.apache.catalina.startup.ContextConfig.lifecycleEvent (contextconfig.java:298)
At Org.apache.catalina.util.LifecycleBase.fireLifecycleEvent (lifecyclebase.java:94)
At Org.apache.catalina.core.StandardContext.startInternal (standardcontext.java:5093)
At Org.apache.catalina.util.LifecycleBase.start (lifecyclebase.java:152)
At Org.apache.catalina.core.containerbase$startchild.call (containerbase.java:1405)
At Org.apache.catalina.core.containerbase$startchild.call (containerbase.java:1395)
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)

Although it is only a warning, does not affect the normal use, but looked always so uncomfortable.

I use MAVEN, I see Maven dependency, no ah, how to find this directory under the Xercesimpl.jar, clearly not, the original path should be, D:\XXX directory \xerces\xercesimpl\2.9.1\ Xercesimpl.2.9.1.jar.

Find out why, why for loading into D:\XXX directory \xalan\xalan\2.7.2\xercesimpl.jar This file, all kinds of Baidu Google, finally find the problem is Tomcat loading package problem. Tomcat modified the way the jar was loaded in 8.5.2, 8.5.2 resolves the manifest.mf file in the jar, and when the file contains the Class-path attribute, the value of the Property object is parsed into the jar that needs to be loaded. This is the root cause. There is no way, only self-reduced version to 8.5.0 can solve the problem. It took me half a day to solve the problem.

For example, the MANIFEST.MF file in Xalan.jar, part of the following:

This will load the configured 3 jars and look for the path that is located under the Xalan.jar file.

Next we look at the Tomcat source, what is going on.

The important parts of the Tomcat 8.5.0 load jar are as follows:

First call the Scanjars scan jar, the important part, call the scan method.

Scan method:


The important part looks red, this is not the same as the 8.5.2 version of the method, this is also a problem place.

First look at the 8.5.0 method:


Did not parse the MANIFEST.MF file. This is normal, and then we'll look at the 8.5.2 version

Watch the red part.


When it is a jar, it is called to processmanifest the method, and this method is to parse the manifest file. Let's look at this method:


As can be seen, to parse the Class-path property, parse the corresponding value, and then loaded into the need to classpathurlstoprocess, this is the need to load the Jar object. So this is the root cause.

I do not know why Tomcat in the high version of this do, there are know students can answer the next.

Xalan\xalan\2.7.2\xercesimpl.jar (the system could not find the specified file) issue

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.