jpcap unsatisfiedlinkerror

Discussion in 'Java' started by Eelco, Nov 13, 2006.

  1. Eelco

    Eelco Guest

    Hi,

    I am trying to use the jpcap
    (http://netresearch.ics.uci.edu/kfujii/jpcap/doc/index.html) package on
    Debian Linux. I have installed and configured jpcap according to the
    installation manual, readme & FAQ. But I am still getting a unsatisfied
    link error.

    jpcap consist of a java package and a shared object library that
    interfaces with libpcap.

    I have also tried another jpcap package (http://jpcap.sourceforge.net/)
    which runs fine. But because this package does not support packet
    sending it is unusable to me. But since this package also bridges call
    to libpcap I believe it is safe to say that libpcap is installed and
    configured properly.

    I have tried running my program on both JDK 1.5 and JDK 1.4.2 but I get
    the same result.

    I have included a stacktrace and a ldconfig dump.

    Any thoughts on this would be greatly appreciated. Also if anyone knows
    of an alternative way of capturing ethernet packages in Java, please
    feel free to do suggestions.

    Kind regards,
    Eelco

    ---8< stack trace >8---
    PNmcrs:~/myapp# java -jar myapp.jar tap1
    Exception in thread "main" java.lang.UnsatisfiedLinkError:
    /usr/lib/j2sdk1.4-sun/jre/lib/i386/libjpcap.so:
    /usr/lib/j2sdk1.4-sun/jre/lib/i386/libjpcap.so: undefined symbol:
    pcap_sendpacket
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503)
    at java.lang.Runtime.loadLibrary0(Runtime.java:788)
    at java.lang.System.loadLibrary(System.java:834)
    at jpcap.JpcapCaptor.<clinit>(Unknown Source)
    at myapp.MyApp.main(MyApp.java:32)
    ---8< eo stack trace >8---

    ---8< ldconfig output >8---
    PNmcrs:/usr/include# ldconfig -p |grep pcap
    libpcap.so.0.8 (libc6) => /usr/lib/libpcap.so.0.8
    libpcap.so.0.7 (libc6) => /usr/lib/libpcap.so.0.7
    ---8< eo ldconfig output >8---
    Eelco, Nov 13, 2006
    #1
    1. Advertising

  2. Eelco

    Eelco Guest

    Also "pcap_sendpacket" is defined in pcap.h...

    On Nov 13, 11:55 am, "Eelco" <> wrote:
    > Hi,
    >
    > I am trying to use the jpcap
    > (http://netresearch.ics.uci.edu/kfujii/jpcap/doc/index.html) package on
    > Debian Linux. I have installed and configured jpcap according to the
    > installation manual, readme & FAQ. But I am still getting a unsatisfied
    > link error.
    >
    > jpcap consist of a java package and a shared object library that
    > interfaces with libpcap.
    >
    > I have also tried another jpcap package (http://jpcap.sourceforge.net/)
    > which runs fine. But because this package does not support packet
    > sending it is unusable to me. But since this package also bridges call
    > to libpcap I believe it is safe to say that libpcap is installed and
    > configured properly.
    >
    > I have tried running my program on both JDK 1.5 and JDK 1.4.2 but I get
    > the same result.
    >
    > I have included a stacktrace and a ldconfig dump.
    >
    > Any thoughts on this would be greatly appreciated. Also if anyone knows
    > of an alternative way of capturing ethernet packages in Java, please
    > feel free to do suggestions.
    >
    > Kind regards,
    > Eelco
    >
    > ---8< stack trace >8---
    > PNmcrs:~/myapp# java -jar myapp.jar tap1
    > Exception in thread "main" java.lang.UnsatisfiedLinkError:
    > /usr/lib/j2sdk1.4-sun/jre/lib/i386/libjpcap.so:
    > /usr/lib/j2sdk1.4-sun/jre/lib/i386/libjpcap.so: undefined symbol:
    > pcap_sendpacket
    > at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586)
    > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503)
    > at java.lang.Runtime.loadLibrary0(Runtime.java:788)
    > at java.lang.System.loadLibrary(System.java:834)
    > at jpcap.JpcapCaptor.<clinit>(Unknown Source)
    > at myapp.MyApp.main(MyApp.java:32)
    > ---8< eo stack trace >8---
    >
    > ---8< ldconfig output >8---
    > PNmcrs:/usr/include# ldconfig -p |grep pcap
    > libpcap.so.0.8 (libc6) => /usr/lib/libpcap.so.0.8
    > libpcap.so.0.7 (libc6) => /usr/lib/libpcap.so.0.7
    > ---8< eo ldconfig output >8---
    Eelco, Nov 13, 2006
    #2
    1. Advertising

  3. On 13 Nov 2006 02:55:50 -0800, Eelco wrote:
    > Also if anyone knows of an alternative way of capturing ethernet
    > packages in Java, please feel free to do suggestions.


    I know of no other way. But you rejected the working jpcap because it
    wouldn't let you *send* packets. Which is it?

    > Exception in thread "main" java.lang.UnsatisfiedLinkError:
    > /usr/lib/j2sdk1.4-sun/jre/lib/i386/libjpcap.so:
    > /usr/lib/j2sdk1.4-sun/jre/lib/i386/libjpcap.so: undefined symbol: pcap_sendpacket


    [...]

    > libpcap.so.0.8 (libc6) => /usr/lib/libpcap.so.0.8
    > libpcap.so.0.7 (libc6) => /usr/lib/libpcap.so.0.7


    According to the libpcap changelog, support for sending packets was
    not introduced until version 0.9.3.

    > Also "pcap_sendpacket" is defined in pcap.h...


    But not in the library, apparently.

    /gordon

    --
    [ don't email me support questions or followups ]
    g o r d o n + n e w s @ b a l d e r 1 3 . s e
    Gordon Beaton, Nov 13, 2006
    #3
  4. On 13 Nov 2006 12:11:24 GMT, Gordon Beaton wrote:
    > On 13 Nov 2006 02:55:50 -0800, Eelco wrote:
    >> libpcap.so.0.8 (libc6) => /usr/lib/libpcap.so.0.8
    >> libpcap.so.0.7 (libc6) => /usr/lib/libpcap.so.0.7

    >
    > According to the libpcap changelog, support for sending packets was
    > not introduced until version 0.9.3.


    In fact, according "Requirements" in the jpcap-0.5.1 README, you need
    libpcap 0.9.4 or later.

    (I was not aware until just now that the jpcap you're using is not
    related to the one on sourceforge).

    /gordon

    --
    [ don't email me support questions or followups ]
    g o r d o n + n e w s @ b a l d e r 1 3 . s e
    Gordon Beaton, Nov 13, 2006
    #4
  5. Eelco

    Eelco Guest

    Thanks a lot for your reply.

    The reason for this problem was exactly what you described. I was under
    the assumption that version 0.8.3 of libpcap had the needed
    functionality available but apparently I checked wrong :)

    Thanks again.

    Gordon Beaton schreef:

    > On 13 Nov 2006 12:11:24 GMT, Gordon Beaton wrote:
    > > On 13 Nov 2006 02:55:50 -0800, Eelco wrote:
    > >> libpcap.so.0.8 (libc6) => /usr/lib/libpcap.so.0.8
    > >> libpcap.so.0.7 (libc6) => /usr/lib/libpcap.so.0.7

    > >
    > > According to the libpcap changelog, support for sending packets was
    > > not introduced until version 0.9.3.

    >
    > In fact, according "Requirements" in the jpcap-0.5.1 README, you need
    > libpcap 0.9.4 or later.
    >
    > (I was not aware until just now that the jpcap you're using is not
    > related to the one on sourceforge).
    >
    > /gordon
    >
    > --
    > [ don't email me support questions or followups ]
    > g o r d o n + n e w s @ b a l d e r 1 3 . s e
    Eelco, Nov 14, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rachel
    Replies:
    1
    Views:
    2,827
  2. sharad nangia

    Answer to UnsatisfiedLinkError - JNI

    sharad nangia, Sep 2, 2003, in forum: Java
    Replies:
    0
    Views:
    3,006
    sharad nangia
    Sep 2, 2003
  3. Unexplored Dimension

    Using Jpcap

    Unexplored Dimension, Mar 27, 2006, in forum: Java
    Replies:
    1
    Views:
    4,787
    IchBin
    Mar 27, 2006
  4. yikaikai
    Replies:
    2
    Views:
    1,631
    yikaikai
    Mar 21, 2007
  5. Bentow
    Replies:
    2
    Views:
    1,183
    John B. Matthews
    Sep 22, 2009
Loading...

Share This Page