Atitit tomcat 启动报错 ZipException: archive is not a ZIP archive.
1.1. ----Should sh lib jar err... 1
1.2. ----ZipTest :\0wkspc\hislog\src\main\java\com\attilax\compress\ZipTest.java 1
1.4. ---使用bcompare从jar库同步tomcat 发布历史目录tmp0----下面的库即可果然很多jar体积都变成91了。奇怪 3
1.1. ----Should sh lib jar err...
Test the jar final String dir = "C:\\0wkspc\\.metadata\\.plugins\\org.eclipse.wst.server.core\\tmp0\\wtpwebapps\\honurse\\WEB-INF\\lib";
1.2. ----ZipTest :\0wkspc\hislog\src\main\java\com\attilax\compress\ZipTest.java
package com.attilax.compress;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;
import com.attilax.io.DirTraveService;
import com.attilax.io.PathService;
import com.attilax.util.timestampUtil;
import com.cnhis.cloudhealth.module.log.Cls1;
import com.google.common.base.Function;
public class ZipTest {
public static Logger logger = Logger.getLogger(ZipTest.class);
public static void main(String[] args) {
DirTraveService dts=new DirTraveService();
//final String dir = "C:\\0wkspc\\移动医疗源码\\移动医护\\移动护士站\\honurse\\holib";
final String dir = "C:\\0wkspc\\.metadata\\.plugins\\org.eclipse.wst.server.core\\tmp0\\wtpwebapps\\honurse\\WEB-INF\\lib";
dts.trave_throwEx(dir, new Function<File, Object>() {
@Override
public Object apply(File arg0) {
String f = arg0.getAbsolutePath();
logger.info("arg0:"+f);
if(f.toLowerCase().trim().endsWith(".jar"))
{
System.out.println(ZipUtil. unzip_filelist(f));
}
return null;
}
}, new Function<Integer, Object>() {
@Override
public Object apply(Integer cnt_index) {
//Map m=Maps.newConcurrentMap();m.put("index", cnt_index)
logger.info("cnt_index:"+cnt_index);
return null;
}});
}
1.3. ----Result
<arg0:C:\0wkspc\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\honurse\WEB-INF\lib\apache-solr-core-3.6.1.jar>
Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: archive is not a ZIP archive
at com.attilax.util.ExUtil.throwExV2(ExUtil.java:59)
at com.attilax.compress.ZipUtil.unzip_filelist(ZipUtil.java:177)
at com.attilax.compress.ZipTest$1.apply(ZipTest.java:34)
at com.attilax.compress.ZipTest$1.apply(ZipTest.java:1)
at com.attilax.io.DirTraveService.trave_throwEx(DirTraveService.java:110)
at com.attilax.compress.ZipTest.main(ZipTest.java:25)
Caused by: java.util.zip.ZipException: archive is not a ZIP archive
at org.apache.tools.zip.ZipFile.positionAtEndOfCentralDirectoryRecord(ZipFile.java:771)
at org.apache.tools.zip.ZipFile.positionAtCentralDirectory(ZipFile.java:707)
at org.apache.tools.zip.ZipFile.populateFromCentralDirectory(ZipFile.java:452)
at org.apache.tools.zip.ZipFile.<init>(ZipFile.java:214)
at org.apache.tools.zip.ZipFile.<init>(ZipFile.java:190)
at org.apache.tools.zip.ZipFile.<init>(ZipFile.java:162)
at com.attilax.compress.ZipUtil.unzip_filelist(ZipUtil.java:158)