Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > jpcap unsatisfiedlinkerror

Reply
Thread Tools

jpcap unsatisfiedlinkerror

 
 
Eelco
Guest
Posts: n/a
 
      11-13-2006
Hi,

I am trying to use the jpcap
(http://netresearch.ics.uci.edu/kfuji...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.jav a:1586)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1503)
at java.lang.Runtime.loadLibrary0(Runtime.java:78
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---

 
Reply With Quote
 
 
 
 
Eelco
Guest
Posts: n/a
 
      11-13-2006
Also "pcap_sendpacket" is defined in pcap.h...

On Nov 13, 11:55 am, "Eelco" <(E-Mail Removed)> wrote:
> Hi,
>
> I am trying to use the jpcap
> (http://netresearch.ics.uci.edu/kfuji...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.jav a:1586)
> at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1503)
> at java.lang.Runtime.loadLibrary0(Runtime.java:78
> 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---


 
Reply With Quote
 
 
 
 
Gordon Beaton
Guest
Posts: n/a
 
      11-13-2006
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
 
Reply With Quote
 
Gordon Beaton
Guest
Posts: n/a
 
      11-13-2006
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
 
Reply With Quote
 
Eelco
Guest
Posts: n/a
 
      11-14-2006
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bug when using both Jpcap + jFreeChart Libs Bentow Java 2 09-22-2009 09:29 PM
How to get IP address using jpcap? yikaikai Java 2 03-21-2007 08:33 AM
Using Jpcap Unexplored Dimension Java 1 03-27-2006 07:37 PM
Answer to UnsatisfiedLinkError - JNI sharad nangia Java 0 09-02-2003 05:24 AM
Newbie: Why 'UnsatisfiedLinkError & Access is denied' over network drive? Rachel Java 1 08-06-2003 07:47 AM



Advertisments