Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

jpcap unsatisfiedlinkerror

Thread view: 
Eelco - 13 Nov 2006 10:55 GMT
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 - 13 Nov 2006 11:59 GMT
Also "pcap_sendpacket" is defined in pcap.h...

> Hi,
>
[quoted text clipped - 45 lines]
>         libpcap.so.0.7 (libc6) => /usr/lib/libpcap.so.0.7
> ---8< eo ldconfig output >8---
Gordon Beaton - 13 Nov 2006 12:11 GMT
> 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

Signature

[ 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 - 13 Nov 2006 12:28 GMT
>> 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

Signature

[ 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 - 14 Nov 2006 19:18 GMT
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:

> >> libpcap.so.0.8 (libc6) => /usr/lib/libpcap.so.0.8
> >> libpcap.so.0.7 (libc6) => /usr/lib/libpcap.so.0.7
[quoted text clipped - 13 lines]
> [ 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.