Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.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
Tomcat 复制任务中的问题_Tomcat_Spring Mvc_War_Winrar - Fatal编程技术网

Tomcat 复制任务中的问题

Tomcat 复制任务中的问题,tomcat,spring-mvc,war,winrar,Tomcat,Spring Mvc,War,Winrar,当我对SpringMVC项目进行war时,不能将war文件部署到具有ZipException过度订阅的literal/length树的tomcat。我发现当我在WEB-INF/LIB/*.jar中打开所有文件时,当我尝试使用winrar打开它们时,我得到了“意外的归档文件” 我有两个像这样的蚂蚁目标 <target name="build" description="Compile main source tree java files"> <mkdir dir

当我对SpringMVC项目进行war时,不能将war文件部署到具有ZipException过度订阅的literal/length树的tomcat。我发现当我在WEB-INF/LIB/*.jar中打开所有文件时,当我尝试使用winrar打开它们时,我得到了“意外的归档文件”

我有两个像这样的蚂蚁目标

<target name="build" description="Compile main source tree java files">
        <mkdir dir="${build.dir}" />
        <copy todir="${web.dir}/WEB-INF/">
            <fileset dir="src/main/webapp/WEB-INF/">
                <include name="**/*.*" />
            </fileset>
            <filterchain>
                <striplinecomments>
                    <comment value="!" />
                </striplinecomments>
                <replacetokens>
                    <token key="hibernate.connection.url" value="${hibernate.connection.url}" />
                    <token key="hibernate.connection.username" value="${hibernate.connection.username}" />
                    <token key="hibernate.connection.password" value="${hibernate.connection.password}" />
                    <token key="fontFamily" value="arial, helvetica, sans-serif" />
                </replacetokens>
            </filterchain>
        </copy>
        <copy todir="${build.dir}">
            <fileset dir="src/main/resources">
                <include name="**/*.*" />
            </fileset>
            <filterchain>
                <striplinecomments>
                    <comment value="!" />
                </striplinecomments>
                <replacetokens>
                    <token key="hibernate.connection.url" value="${hibernate.connection.url}" />
                    <token key="hibernate.connection.username" value="${hibernate.connection.username}" />
                    <token key="hibernate.connection.password" value="${hibernate.connection.password}" />
                    <token key="fontFamily" value="arial, helvetica, sans-serif" />
                </replacetokens>
            </filterchain>
        </copy>

        <javac destdir="${build.dir}" source="1.6" target="1.6" debug="true" deprecation="false" optimize="false" failonerror="true">
            <src path="${src.dir}" />
            <classpath refid="master-classpath" />
        </javac>
    </target>

    <target name="deploywar" depends="build" description="Deploy application as a WAR file">
        <war destfile="${name}.war" webxml="${web.dir}/WEB-INF/web.xml">
            <fileset dir="${web.dir}">
                <include name="**/*.*" />
            </fileset>
        </war>
        <copy todir="${deploy.path}" preservelastmodified="true">
            <fileset dir=".">
                <include name="*.war" />
            </fileset>
        </copy>

现在,我在复制目标中发现了问题,当它将*.jar文件复制到外部文件夹时,这些文件会损坏。

我发现了问题

        <copy todir="${web.dir}/WEB-INF/">
            <fileset dir="src/main/webapp/WEB-INF/">
                <include name="**/*.*" />
            </fileset>
            <filterchain>
                <striplinecomments>
                    <comment value="!" />
                </striplinecomments>
                <replacetokens>
                    <token key="hibernate.connection.url" value="${hibernate.connection.url}" />
                    <token key="hibernate.connection.username" value="${hibernate.connection.username}" />
                    <token key="hibernate.connection.password" value="${hibernate.connection.password}" />
                    <token key="fontFamily" value="arial, helvetica, sans-serif" />
                </replacetokens>
            </filterchain>
        </copy>

应该是

        <copy todir="${web.dir}/WEB-INF/">
            <fileset dir="src/main/webapp/WEB-INF/">
                <include name="**/*.*" />
            </fileset>
        </copy>


好的,看来你的罐子坏了。清洁和建造解决问题了吗?不,没有。jar文件没有损坏,但在我执行war任务后,它会损坏。