尝试读取har文件时出现空指针异常

时间:2013-01-17 19:40:29

标签: java file har

我正在尝试读取一个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.jav‌​a:43)

0 个答案:

没有答案