Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/358.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
java.util.zip.ZipException:打开spring-webmvc-3.0.7.RELEASE.jar的zip文件时出错_Java_Spring_Spring Mvc - Fatal编程技术网

java.util.zip.ZipException:打开spring-webmvc-3.0.7.RELEASE.jar的zip文件时出错

java.util.zip.ZipException:打开spring-webmvc-3.0.7.RELEASE.jar的zip文件时出错,java,spring,spring-mvc,Java,Spring,Spring Mvc,在分析Jenkins build for WSO2 Application Server 5.3.1-SNAPSHOT的构建日志时,我遇到了以下异常,这是在部署spring3-restful-jndi-service.war时发生的 org.wso2.appserver.integration.tests.webapp.spring.SpringExplodeWebAppDeploymentTestCase.testWebApplicationExplodedDeployment =======

在分析Jenkins build for WSO2 Application Server 5.3.1-SNAPSHOT的构建日志时,我遇到了以下异常,这是在部署spring3-restful-jndi-service.war时发生的

org.wso2.appserver.integration.tests.webapp.spring.SpringExplodeWebAppDeploymentTestCase.testWebApplicationExplodedDeployment ===================
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] - [2016-03-10 07:00:26,295]  WARN {org.apache.tomcat.util.scan.StandardJarScanner} -  Failed to scan JAR [file:/build/jenkins-home/workspace/product-as/modules/integration/tests-integration/tests/target/carbontmp1457572872966/wso2as-5.3.1-SNAPSHOT/repository/deployment/server/webapps/spring3-restful-jndi-service/WEB-INF/lib/spring-webmvc-3.0.7.RELEASE.jar] from WEB-INF/lib
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] - java.util.zip.ZipException: error in opening zip file
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -   at java.util.zip.ZipFile.open(Native Method)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -   at java.util.zip.ZipFile.<init>(ZipFile.java:215)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -   at java.util.zip.ZipFile.<init>(ZipFile.java:145)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -   at java.util.jar.JarFile.<init>(JarFile.java:153)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -   at java.util.jar.JarFile.<init>(JarFile.java:90)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -   at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:93)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -   at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:69)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -   at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:99)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -   at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -   at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:89)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -   at org.apache.tomcat.util.scan.FileUrlJar.<init>(FileUrlJar.java:41)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -   at org.apache.tomcat.util.scan.JarFactory.newInstance(JarFactory.java:34)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -   at org.apache.catalina.startup.ContextConfig$FragmentJarScannerCallback.scan(ContextConfig.java:2647)
但是当我从Jenkins那里获得org.wso2.appserver.integration.tests-5.3.1-SNAPSHOT-tests.jar并分析特定的spring-webmvc-3.0.7.RELEASE.jar时,我发现这个jar没有损坏。我为此进行的简单程序测试如下:

@DataProvider
    private static WebAppMode[][] webAppModeProvider() {
        return new WebAppMode[][] {
                new WebAppMode[] { new WebAppMode(SPRING3JNDIAPP, TestUserMode.SUPER_TENANT_ADMIN) },
                new WebAppMode[] { new WebAppMode(SPRING3JNDIAPP, TestUserMode.TENANT_USER) },
                new WebAppMode[] { new WebAppMode(SPRING4JNDIAPP, TestUserMode.SUPER_TENANT_ADMIN) },
                new WebAppMode[] { new WebAppMode(SPRING4JNDIAPP, TestUserMode.TENANT_USER) }, };
    }

    @SetEnvironment(executionEnvironments = { ExecutionEnvironment.STANDALONE })
    @BeforeClass(alwaysRun = true)
    public void init() throws Exception {
        super.init();
        webAppURL = getWebAppURL(WebAppTypes.WEBAPPS);
        createTable();
        createDataSource(webAppMode.getWebAppName(), sqlDataSource);
        webAppDeploymentDir =
                System.getProperty(ServerConstants.CARBON_HOME) + File.separator + "repository" + File.separator +
                        "deployment" + File.separator + "server" + File.separator + "webapps" + File.separator;
    }

    @SetEnvironment(executionEnvironments = { ExecutionEnvironment.STANDALONE })
    @Test(groups = "wso2.as", description = "Deploying exploded web application file to deployment directory")
    public void testWebApplicationExplodedDeployment() throws Exception {
        String source = ASIntegrationConstants.TARGET_RESOURCE_LOCATION + "spring" + File.separator +
                webAppMode.getWebAppName() + ".war";

        ArchiveExtractor archiveExtractor = new ArchiveExtractor();
        archiveExtractor.extractFile(source, webAppDeploymentDir + File.separator + webAppMode.getWebAppName());
        assertTrue(WebAppDeploymentUtil.isWebApplicationDeployed(backendURL, sessionCookie, webAppMode.getWebAppName()),
                "Web Application Deployment failed");
    }
public static void main(String[] args) {
        try {
            ZipFile file = new ZipFile(new File("/home/chiranga/Desktop/jenkins/archive/org.wso2.appserver/spring-webmvc-3.0.7.RELEASE.jar"));

            Enumeration<? extends ZipEntry> e = file.entries();
            while(e.hasMoreElements()) {
                ZipEntry entry = e.nextElement();
                System.out.println(entry.getName());
            }
        } catch (IOException e1) {
            e1.printStackTrace();
        }
    }
publicstaticvoidmain(字符串[]args){
试一试{
ZipFile文件=新ZipFile(新文件(“/home/chiranga/Desktop/jenkins/archive/org.wso2.appserver/spring-webmvc-3.0.7.RELEASE.jar”);
列举