eclipse maven 项目发布到tomcat 报错 Failed to scan JAR [file:/C:/xxxxx.jar] from WEB-INF/lib

报错信息如下:

警告: Failed to scan JAR [file:/D:/Development/Tomcat/apache-tomcat-7.0.35-64bit/webapps/Monday2/WEB-INF/lib/com.springsource.net.sf.cglib-2.2.0.jar] from WEB-INF/lib
java.util.zip.ZipException: error in opening zip file
	at java.util.zip.ZipFile.open(Native Method)
	at java.util.zip.ZipFile.(Unknown Source)
	at java.util.zip.ZipFile.(Unknown Source)
	at java.util.jar.JarFile.(Unknown Source)
	at java.util.jar.JarFile.(Unknown Source)
	at sun.net.www.protocol.jar.URLJarFile.(Unknown Source)
	at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
	at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
	at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
	at sun.net.www.protocol.jar.JarURLConnection.getJarFile(Unknown Source)
	at org.apache.tomcat.util.scan.FileUrlJar.(FileUrlJar.java:41)
	at org.apache.tomcat.util.scan.JarFactory.newInstance(JarFactory.java:34)
	at org.apache.catalina.startup.ContextConfig$FragmentJarScannerCallback.scan(ContextConfig.java:2626)
	at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:241)
	at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:166)
	at org.apache.catalina.startup.ContextConfig.processJarsForWebFragments(ContextConfig.java:1918)
	at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1268)
	at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5179)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

解决方案:找到Maven仓库如本机的是C:/Users/Administrator/.m2/repository/然后在里面找到对应失败的jar包的目录,将整个目录删除,然后回到MyEclipse或者Eclipse中选中Maven4MyEclipse,然后Update Project,选中 Force Update Of .... 然后确定。



你可能感兴趣的:(eclipse maven 项目发布到tomcat 报错 Failed to scan JAR [file:/C:/xxxxx.jar] from WEB-INF/lib)