0

将应用程序部署到 Tomcat 时出现以下错误: Tomcat错误

我已将jnetpcap jar 文件添加到 Tomcat 的lib文件夹中。我还在 Eclipse 中将它添加到我的类路径中。

我正在将我的应用程序部署为使用 Apache ant 从命令行构建的 WAR 文件。我认为问题可能出在我的build.xml文件中。

构建.xml

<?xml version="1.0" ?>
<project name="IBM_Project" default="dist" basedir=".">
<description>
    sample
</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist"  location="dist"/>
<property name="lib"  location="lib"/>
<property name="web.dir"  location="WebContent"/>

<path id="class.path">
  <pathelement path="${classpath}"/>
  <fileset dir="lib">
    <include name="**/*.jar"/>
  </fileset>
</path>

<javac srcdir="${src}"
    destdir="${build}"
    classpathref="class.path"/>

<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>

<target name="compile" depends="init"
    description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}"/>
</target>

<target name="dist" depends="compile"
    description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>  
<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
<jar jarfile="${dist}/PROJECT-${DSTAMP}.jar" basedir="${build}"/> 
</target>

<target name="build-war">
<war destfile="${dist}/ROOT.war" webxml="${web.dir}/WEB-INF/web.xml">
<fileset dir="${web.dir}">
  <include name="**/*.*"/>
</fileset>
<lib dir="${lib}">
</lib>
<classes dir="${build}"/>
</war>
</target>

<target name="clean"
    description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>

</project>

运行的 Ant 命令:

蚂蚁建造战

我的 build.xml 中可能有很多无关紧要的东西,我仍在尝试了解 Ant 的方法。

任何人都可以阐明我的问题吗?

4

1 回答 1

1

这意味着没有找到本机 jnetpcap 共享库。jnetpcap 是原生 libpcap 库的 Java 包装器。在 Windows 系统上安装“libpcap”库或 WinPcap 是安装jnetpcap 的先决条件。
该库随 jNetPcap 一起提供。您需要确保在每个特定系统上正确定义库所在的文件夹或目录。有关解决问题的详细信息,请参阅 jnetpcap常见问题解答

于 2014-12-08T15:29:10.337 回答