Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPcap Problem

 
Parth Mankad
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic