style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-7505528228218001"
data-ad-slot="1225241371">

Exception in thread "WinPcap version 4.1.1...

4 replies [Last post]
sjp156
Offline
Joined: 11/22/2015

Hi there

I am using jNetPcap for decoding rtp packets. Whilst attempting to do so, I keep getting an exception error of the form:

Exception in thread "WinPcap version 4.1.1 (packet.dll version 4.1.0.1753), based on libpcap version 1.0 branch 1_0_rel0b (20091008)" org.jnetpcap.packet.structure.AnnotatedMethodException: [Sdp.] java.lang.NullPointerException
at org.jnetpcap.packet.structure.AnnotatedHeaderLengthMethod.getHeaderLength(Unknown Source)
at org.jnetpcap.packet.JHeaderScanner.setAllLengths(Unknown Source)
at org.jnetpcap.packet.JHeaderScanner.scanHeader(Unknown Source)
at org.jnetpcap.Pcap.loop(Native Method)
at org.jnetpcap.Pcap.loop(Unknown Source)
at rtp_simple.rtp_extract$2.run(rtp_extract.java:139)
at org.jnetpcap.PcapTask$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at org.jnetpcap.protocol.voip.Sdp.headerLength(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
... 8 more

I am using PcapPacketHandler when looping through the pcap:

this.result = pcap.loop(end - start, new PcapPacketHandler() {
int i = 0;
public void nextPacket(PcapPacket packet, Pcap pcap) {
if (i >= start) {
try {
barrier.exchange(packet);
} catch (InterruptedException e) {
throw new IllegalStateException(e);
}
}
i++;
}
}, pcap);

Does anyone have an idea what might be the issue?

Thanks Shiv

sjp156
Offline
Joined: 11/22/2015
Correction

The error occurs for only large pcap files and occurs at random; i.e. for one run the decoding may work perfectly and for another it throws the exception error.

sjp156
Offline
Joined: 11/22/2015
Edit

The error occurs for only large pcap files and occurs at random; i.e. for one run the decoding may work perfectly and for another it throws the exception error.

sjp156
Offline
Joined: 11/22/2015
Edit

The error occurs for only large pcap files and occurs at random; i.e. for one run the decoding may work perfectly and for another it throws the exception error.

ShaneMichaels
Offline
Joined: 01/20/2016
Thanks for sharing this idea.

Thanks for sharing this idea. I might as well look into this information and try to learn the right steps. - Dennis Wong YOR Health

Comment viewing options

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