0
我使用tshark的捕捉到TCP流量,我想創造的是接收來自tshark的數據包的Java應用程序,並提取一些領域,然後直接把這些領域的SQL數據庫管道數據
在tshark的我使用此命令
C:\Program Files\Wireshark>tshark -r 111.pcapng -T fields -e frame.number -e ip.
src -e tcp.window_size_value -e frame.time -e data.text -e tcp.analysis.duplicat
e_ack -e tcp.analysis.out_of_order -e tcp.analysis.retransmission -e tcp.analysi
s.fast_retransmission -e tcp.analysis.spurious_retransmission -e tcp.analysis.ze
ro_window -e tcp.stream -E header=y -E separator=, -l | java JavaApplication5
它的工作原理,並開始管道數據JavaApplication5,但什麼也沒在我看來
在這裏,我在Java中使用的代碼
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.*;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author sheda
*/
public class JavaApplication5 {
/**
* @param args the command line arguments
*/
public static void main(String[] args)throws IOException{
// TODO code application logic here
try {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String s;
while ((s=in.readLine())!=null&&s.length()!=0) {
System.out.println(s);
}
} catch (LinkageError e) {
}
}
}
我使用NetBeans時,我運行它給我java.lang.NoClassDefFoundError
爲什麼?
另一個想法,我想從tshark的直接的STDIN答STDOUT讀取和保存我在讀取字符串以備將來處理(預定義的字符串格式比較字符串和直接提取信息,然後將其轉發到SQL數據庫)
任何幫助這裏?
非常感謝你
能否請您包括異常的完整堆棧跟蹤? – aioobe
我試圖添加printstacktrace,但它給了我這個java.lang.NoClassDefFoundError:javaapplication8/JavaApplication8 線程「主」Java異常結果:1 –
你說你得到java.lang.NoClassDefFoundError,但你怎麼知道這一點?如果它在控制檯上打印該異常,則應該有一個伴隨的堆棧跟蹤。 – aioobe