我正在尝试读取一个har文件,而readHarFile
正在抛出空指针异常。这是我尝试使用的示例代码:
public class readhar{
public static void main(String [] args) throws exception{
File f = new File ("file path");
HarFileReader r = new HarFileReader();
HarLog log = r.readHarFile(f);
System.out.println(log);
}
}
例外是:
Exception in thread "main" java.lang.NullPointerException at
edu.umass.cs.benchlab.har.HarLog.<init>(HarLog.java:134) at
edu.umass.cs.benchlab.har.tools.HarFileReader.readHarFile(HarFileReader.java:116) at
edu.umass.cs.benchlab.har.tools.HarFileReader.readHarFile(HarFileReader.java:89) at
readHar.main(readHar.java:18) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)