I am capturing packets using Jpcap and simply printing the captured packets which is working fine, but when i try to write the captured packets in dumpfile i get error message.
A fatal error has been detected by the Java Runtime Environment: EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000002c29eba, pid=6892, tid=0x0000000000001afc JRE version: Java(TM) SE Runtime Environment (8.0_144-b01) (build 1.8.0_144-b01) Java VM: Java HotSpot(TM) 64-Bit Server VM (25.144-b01 mixed mode windows-amd64 compressed oops) Problematic frame: v ~BufferBlob::jni_fast_GetLongField Failed to write core dump. Minidumps are not enabled by default on client versions of Windows An error report file with more information is saved as: C:\Users\Asim\Documents\NetBeansProjects\JavaApplication31\hs_err_pid6892.log If you would like to submit a bug report, please visit:
http://bugreport.java.com/bugreport/crash.jsp The crash happened outside the Java Virtual Machine in native code. See problematic frame for where to report the bug.
JpcapWriter writer = JpcapWriter.openDumpFile(captor, "CapturedPackets");
Packet packet = null;
for (int j = 0; j < 10; j++){
packet = captor.getPacket();
if(packet!=null)
{
System.out.println(packet);
writer.writePacket(packet);
}
}
writer.close();
`
User contributions licensed under CC BY-SA 3.0