0

尝试使用 jnetpcap 库读取数据包时发生以下错误。可能是什么原因 ?

ERROR actor.OneForOneStrategy: org.jnetpcap.protocol.network.Ip4java.io.NotSerializableException: org.jnetpcap.protocol.network.Ip4
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1183)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)

at org.apache.spark.streaming.CheckpointWriter.write(Checkpoint.scala:185)
at org.apache.spark.streaming.scheduler.JobGenerator.doCheckpoint(JobGenerator.scala:259)
at org.apache.spark.streaming.scheduler.JobGenerator.org$apache$spark$streaming$scheduler$JobGenerator$$processEvent(JobGenerator.scala:167)
at org.apache.spark.streaming.scheduler.JobGenerator$$anonfun$start$1$$anon$1$$anonfun$receive$1.applyOrElse(JobGenerator.scala:76)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:498)
at akka.actor.ActorCell.invoke(ActorCell.scala:456)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:237)
at akka.dispatch.Mailbox.run(Mailbox.scala:219)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

但它也能够读取一些 Tcp 、 Udp 数据包。

4

1 回答 1

0

我无法想象为什么会出现这样的错误,但我曾经编写了一段非常有效的代码,用于使用 JnetPCap 嗅探 TCP/UDP 和 RTP 数据包,你可以在我的 GitHub 存储库中以“Lizardous”名称找到它: https:// github.com/Longhitano/main_projects/blob/master/Lizardous/src/j1/lizardous.java

于 2014-12-08T10:40:32.867 回答