jpcap unsatisfiedlinkerror

E

Eelco

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---
 
G

Gordon Beaton

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
 
G

Gordon Beaton

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
 
E

Eelco

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:
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top