【问题标题】:Tomcat: java.lang.UnsatisfiedLinkError: no jnetpcap in java.library.pathTomcat:java.lang.UnsatisfiedLinkError:java.library.path 中没有 jnetpcap
【发布时间】:2014-12-09 01:34:37
【问题描述】:

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

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

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

build.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 命令:

ant build-war

我的 build.xml 中可能有很多无关紧要的东西,我仍在努力学习如何绕过 Ant。

谁能解释一下我的问题?

【问题讨论】:

    标签: tomcat ant build.xml jnetpcap


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2011-04-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-07
      • 1970-01-01
      • 2017-03-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多