wood burning stoves 2.0*
The moose likes Sockets and Internet Protocols and the fly likes JPcap Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "JPcap Problem" Watch "JPcap Problem" New topic
Author

JPcap Problem

Parth Mankad
Greenhorn

Joined: Jan 27, 2003
Posts: 18
i am using Jpcap api library for packet captuirng.i am able to find the device on my machine with the finddevice() function.it shows me

\Device\NPF_GenericNdisWanAdapter.but when i try to open the device it gives me error.

net.sourceforge.jpcap.capture.CaptureDeviceOpenException: Error opening adapter:
The system cannot find the device specified
plz help me in solving this problme
D Dawg
Greenhorn

Joined: Aug 18, 2005
Posts: 1
Were you able to resolve this problem? What was the solution? Thanks.


Originally posted by Parth Mankad:
i am using Jpcap api library for packet captuirng.i am able to find the device on my machine with the finddevice() function.it shows me

\Device\NPF_GenericNdisWanAdapter.but when i try to open the device it gives me error.

net.sourceforge.jpcap.capture.CaptureDeviceOpenException: Error opening adapter:
The system cannot find the device specified
plz help me in solving this problme

[ August 18, 2005: Message edited by: D Dawg ]
James Taylor
Greenhorn

Joined: Sep 13, 2005
Posts: 1
When specifing the device, you need to double escape the slashes. For the device:

\Device\NPF_GenericNdisWanAdapter

it should be changed to:

\\\\Device\\\\NPF_GenericNdisWanAdapter
Axl Weslowski
Greenhorn

Joined: Jan 23, 2006
Posts: 2
Originally posted by Parth Mankad:
i am using Jpcap api library for packet captuirng.i am able to find the device on my machine with the finddevice() function.it shows me

\Device\NPF_GenericNdisWanAdapter.but when i try to open the device it gives me error.

net.sourceforge.jpcap.capture.CaptureDeviceOpenException: Error opening adapter:
The system cannot find the device specified
plz help me in solving this problme



I get the same problem connecting to the generic adapter, then another problem connecting to the specific adapter. Try this code:



If you don't get this error, you're in luck:
An unexpected error has been detected by HotSpot Virtual Machine:
EXCEPTION_ACCESS_VIOLATION (0xc0000005)
Albert Stifter
Greenhorn

Joined: May 15, 2006
Posts: 1
There is a bug in the open method when used on Windows XP
see bug at sourceforge

You have to delete everything after a \n

Example (without exception handling):
Rajkumar Chandrasekaran
Greenhorn

Joined: Nov 23, 2004
Posts: 11
Hi,

I am trying to do a packet count using jpcap on windows xp. After installing all the necessary things i am getting the following error on my system

using device '\Device\NPF_GenericDialupAdapter
Generic dialup adapter'.
'\Device\NPF_GenericDialupAdapter
Generic dialup adapter' was found but couldn't be properly opened.
Error: Error opening adapter: The system cannot find the device specified. (20)
You may need to run this tool as root in order to capture packets.


I have logged in as the Administrator user only.

Is there something which i am missing out.

Please let me know

Thanks
Rajkumar
fxdk fxdk
Greenhorn

Joined: Jul 04, 2006
Posts: 3
Hi,
The Generic Dialup is your dialup modem - your phone line.
By default it detects that first.

You can get ur internet line by getting your interface by name "ppp0" or "ppp" , one of the two - i forgot which.

If you connect to the internet through the network, you can get it by "eth0" or "ethx" where x is whichever number ur card is located at.
Kishore Rajendra
Greenhorn

Joined: Apr 11, 2014
Posts: 1
Hi all, the error is because of an extra space you get when you use the method/function findDevice(). The solution is ..


 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JPcap Problem
 
Similar Threads
HTTPS packet Capturing
net. sourceforge.jpcap. capture. CaptureDeviceOpenException: Error opening adapter
Developing a traceroute clone
Help-JPcap library and Network Statistics
Counting Network Traffic in Java