I am trying to read a har file and the readHarFile
is throwing a null pointer exception. here is the sample code that i am trying to use:
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 is:
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)