Null Pointer running CommonUsageExamples.java

1 reply [Last post]
hr00
Offline
Joined: 09/08/2010

I am running the latest version of jnetPcap (jnetpcap-1.4.b0004-1.win32) downloaded today on Windows Vista 32-bit

I am trying to run the example file CommonUsageExamples.java and I am getting the following exception:

superFlowMap::Exception in thread "main" java.lang.NullPointerException
at org.jnetpcap.packet.JFlow.toString(JFlow.java:129)
at org.jnetpcap.packet.JFlowMap.toString(JFlowMap.java:93)
at java.util.Formatter$FormatSpecifier.printString(Unknown Source)
at java.util.Formatter$FormatSpecifier.print(Unknown Source)
at java.util.Formatter.format(Unknown Source)
at java.io.PrintStream.format(Unknown Source)
at java.io.PrintStream.printf(Unknown Source)
at CommonUsageExamples.main(CommonUsageExamples.java:343)

Corresponding to this line:

System.out.printf("superFlowMap::%s%n", superFlowMap); [line 303 in the current source version]

Note: I added some print statements in the earlier parts of the file and so my line numbers are probably a bit off of the original. I have attached the pcap file I was using, but I also get the same error when using the originally suggested test file: tests/test-http-jpeg.pcap

Thanks for any help you could provide.

AttachmentSize
http_witp_jpegs.cap319.1 KB
Mark Bednarczyk
Mark Bednarczyk's picture
Offline
Joined: 03/22/2008
Thats a bug in latest code.

Thats a bug in latest code. I have it fixed already but not released yet. It will be fixed in next build. The same bug is in the 1.3 release. The fix is already checked in, so if you can build from source it will have it fixed.

Sorry about that, if you really need it quick, I can send you an update with the fix.

Sly Technologies, Inc.
R&D

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.