JAVA:在Tomcat中部署应用程序时的AbstractMethodError

时间:2016-05-03 17:52:34

标签: java jar comparator

我在部署我的Web应用程序时遇到错误,当我调试时发现我的.jar文件有问题
我确信我的部署程序是正确的 部署应用程序时出错:

  

java.lang.AbstractMethodError:Method   I / Z.compare(Ljava / lang / Object; Ljava / lang / Object;)我是抽象的   I.Z.compare(未知来源)

如果我反编译我的.jar文件,这个I.Z.Compare方法如下所示 enter image description here

我也有正确的.jar文件,但没有源代码。 I.Z.compare如下所示: enter image description here

对于前.jar文件。负责生成此方法的代码如下所示:

static Comparator comparator()
    {
      return new Comparator()
        {
          public int compare(Object o1,Object o2)
          {
            return Range.compare((Range)o1,(Range)o2);
          }
        };
    } 

比较功能中存在一切。仍然没有反映在.jar文件中 下面是我的Build.xml:

<project name="SafePerimeter" default="pack_release" basedir=".">
    <description>
        SafePerimeter Build File
    </description>
    <!-- versions -->    
    <property name="versionNumber" value="3.1.7"/>   

    <!-- copyright year -->
    <property name="copyYear" value="2009"/>

    <!-- set global properties for this build -->
    <property name="source" location="source"/>
    <property name="lib" location="lib" />
    <property name="versionSource" location="work/vsource"/>
    <property name="build" location="work/build"/> 
    <property name="mapping" location="work/mapping"/>   
    <property name="targetlib"  location="work/lib"/>
    <property name="idgen"  location="tools/ant/idgen"/>  
    <property name="legal"  location="legal"/>
    <property name="version"  location="version"/>
    <property name="dist"  location="work/dist"/>
    <property name="work"  location="work"/>
    <property name="package"  location="work/package"/>  
    <property name="packageNamePrefix" value="cw-safeperimeter-"/>
    <property name="context"  location="context"/>      

    <target name="init">
      <!-- Create the time stamp -->
      <tstamp/>
      <buildnumber file="${idgen}/id.txt"/>
      <!-- Create the build directory structure used by compile -->
      <delete dir="${dist}"/>
      <delete dir="${package}"/>      
      <mkdir dir="${dist}"/>      
      <mkdir dir="${package}"/>      
      <mkdir dir="${build}"/>      
      <mkdir dir="${versionSource}"/>
      <mkdir dir="${idgen}"/>
      <mkdir dir="${targetlib}"/>
      <mkdir dir="${mapping}"/>
    </target>

    <target name="version" depends="init"> 
      <touch file="${source}/com/collabworx/redball/PerimeterEngine.java"/>
      <filter token="DATE" value="${DSTAMP}"/>
      <filter token="TIME" value="${TSTAMP}"/>          
      <filter token="BUILD" value="${build.number}"/>
      <filter token="VERSION" value="${versionNumber}"/>
      <filter token="COPYYEAR" value="${copyYear}"/> 
      <copy todir="${versionSource}" filtering="true">
        <fileset dir="${source}"/>
      </copy>
    </target>        

    <target name="compile" depends="version">    
    <javac srcdir="${versionSource}" destdir="${build}" debug="off" optimize="on">
      <classpath>
        <fileset dir="${lib}">
          <include name="**/*.jar"/>
        </fileset>
      </classpath>
    </javac>            
    </target>         

    <target name="make_library" depends="compile">   
         <java jar="tools/jshrink/jshrink.jar" fork="true" output="${mapping}/redball_lib_rename.log">                  
         <arg line=" ${build} -license '06/05/2003 CollabWorx, Inc. RWKWKQWMFOYQGUEC' -script tools/obfuscation/redball_lib_obf.txt -o ${targetlib}/sp.jar -classpath lib/servlet.jar;lib/activation.jar;lib/mail.jar"/>                                        
         <classpath>
           <pathelement location="/tools/jshrink/jshrink.jar"/>
           <fileset dir="${lib}">
             <include name="**/*.jar"/>
           </fileset>
         </classpath>
       </java>
    </target> 

    <target name="compile_debug" depends="version">    
    <javac srcdir="${versionSource}" destdir="${build}" debug="on">
      <classpath>
        <fileset dir="${lib}">
          <include name="**/*.jar"/>
        </fileset>
      </classpath>
    </javac>            
    </target>

    <target name="jar_debug" depends="compile_debug">    
        <jar destfile="${targetlib}/sp.jar" basedir="${build}"/>           
    </target> 

    <target name="prepare_package">
        <!-- re-declaring tokens to make sure they are applied when antcall is
        used -->
        <filter token="DATE" value="${DSTAMP}"/>
        <filter token="TIME" value="${TSTAMP}"/>          
        <filter token="BUILD" value="${build.number}"/>
        <filter token="VERSION" value="${versionNumber}"/>
        <filter token="COPYYEAR" value="${copyYear}"/> 
        <copy todir="${package}/${packageNamePrefix}${versionNumber}"> 
        <fileset dir="./" casesensitive="false">                                                        
          <include name="web-inf/**/*"/>                                               
        </fileset>                     
      </copy>
      <copy todir="${package}" filtering="true"> 
        <fileset dir="${context}" casesensitive="false">                                                        
          <include name="*.xml"/>
          <include name="*.properties"/>
        </fileset>                    
      </copy>
      <copy todir="${package}/${packageNamePrefix}${versionNumber}"> 
        <fileset dir="./" casesensitive="false">   
          <include name="docs/**/*"/>                                                                                              
        </fileset>      
        <fileset dir="jsp" casesensitive="false">                                       
          <include name="**/*"/>                                                                
        </fileset>        
      </copy>
      <copy todir="${package}/${packageNamePrefix}${versionNumber}" filtering="true" overwrite="true">        
        <fileset dir="jsp" casesensitive="false">                                       
          <include name="simjsp/footer.jsp"/>                                                                
        </fileset>        
      </copy>
      <copy todir="${package}/${packageNamePrefix}${versionNumber}/web-inf/lib">
        <fileset dir="${targetlib}" casesensitive="false">
          <include name="sp.jar"/>
        </fileset>
        <fileset dir="${lib}" >
          <exclude name="**/activation.jar"/>
          <exclude name="**/mail.jar"/>
          <exclude name="**/servlet.jar"/>
        </fileset>
      </copy>
      <copy todir="${package}/${packageNamePrefix}${versionNumber}" filtering="true">
            <fileset dir="${legal}"/>
      </copy>
      <copy todir="${package}/${packageNamePrefix}${versionNumber}" filtering="true">
            <fileset dir="${version}"/>
        </copy> 
    </target>

        <target name="prepare_package_debug" depends="jar_debug"> 
            <antcall target="prepare_package"/>
      </target>

        <target name="prepare_package_release" depends="make_library"> 
                <antcall target="prepare_package"/>
        </target>

        <target name="pack">          
          <zip destfile="${dist}/${packageNamePrefix}${versionNumber}.${build.number}.zip" basedir="${package}"/>            
      </target> 

    <target name="pack_release" depends="prepare_package_release" description="creates release package">          
        <antcall target="pack"/>            
    </target> 

        <target name="pack_debug" depends="prepare_package_debug" description="creates debug package">          
            <antcall target="pack"/>            
      </target>

    <target name="cleanup" description="deletes work directories">    
      <delete dir="${work}"/>            
    </target>

        <target name="cleanup_for_eclipse" description="deletes work directories except eclipse directory">    
            <delete includeemptydirs="true">
                <fileset dir="${work}">
                    <exclude name="bin/**/*"/>
                </fileset>      
            </delete>
        </target>

    <target name="deploy_jsp">
        <!-- re-declaring tokens to make sure they are applied when antcall is
            used -->
            <filter token="DATE" value="${DSTAMP}"/>
            <filter token="TIME" value="${TSTAMP}"/>          
            <filter token="BUILD" value="${build.number}"/>
            <filter token="VERSION" value="${versionNumber}"/>
            <filter token="COPYYEAR" value="${copyYear}"/> 

        <copy todir="${package}/${packageNamePrefix}${versionNumber}">          
            <fileset dir="jsp" casesensitive="false">                                       
              <include name="**/*"/>                                                                
            </fileset>        
          </copy>
          <copy todir="${package}/${packageNamePrefix}${versionNumber}" filtering="true" overwrite="true">        
            <fileset dir="jsp" casesensitive="false">                                       
              <include name="simjsp/footer.jsp"/>                                                                
            </fileset>        
          </copy>
    </target>
</project>

在build.xml文件中。有一个混淆器正在重命名函数并分析它的日志,我发现我对流的理解是正确的,但是混淆器的日志文件中有一个错误:

  

在Classpath

上找不到java / util / Comparator.class

如果您需要更多信息。我可以提供。我花了很多时间搞清楚这一点。请帮帮我!

0 个答案:

没有答案