-
Notifications
You must be signed in to change notification settings - Fork 671
Description
I didn't have this issue last week, but when I try to call newHar I get an exception. I tried running it a few ways, in intellij, just the jar, ect.. but here are some scenarios I tried.
BrowserMobProxy proxy = new BrowserMobProxyServer(); proxy.start(0);
// get the Selenium proxy object
Proxy seleniumProxy = ClientUtil.createSeleniumProxy(proxy);
// configure it as a desired capability
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.PROXY, seleniumProxy);
// start the browser up
WebDriver driver = new FirefoxDriver(capabilities);
// enable more detailed HAR capture, if desired (see CaptureType for the complete list)
proxy.enableHarCaptureTypes(CaptureType.REQUEST_CONTENT, CaptureType.RESPONSE_CONTENT);
// create a new HAR with the label "yahoo.com"
proxy.newHar("yahoo.com");
// open yahoo.com
driver.get("http://yahoo.com");
// get the HAR data
Har har = proxy.getHar();
Even removing selenium from the equation throws an error:
BrowserMobProxy proxy = new BrowserMobProxyServer(); proxy.start(0); proxy.enableHarCaptureTypes(CaptureType.REQUEST_CONTENT, CaptureType.RESPONSE_CONTENT); proxy.newHar("yahoo.com"); Har har = proxy.getHar();
If I uncomment proxy.newHar("yahoo.com") everything runs, minus the fact that I can't get a HAR. Here is the stack trace for the error. I appreciate any help as I've been struggling to figure out the issue:
java.lang.ExceptionInInitializerError at net.lightbody.bmp.util.BrowserMobProxyUtil.getUserAgentStringParser(BrowserMobProxyUtil.java:63) at net.lightbody.bmp.BrowserMobProxyServer.newHar(BrowserMobProxyServer.java:455) at net.lightbody.bmp.BrowserMobProxyServer.newHar(BrowserMobProxyServer.java:449) at org.finra.aw.test.BrowserMobBroken.init(BrowserMobBroken.java:41) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144) Caused by: java.lang.IllegalStateException: Argument 'data' must not be empty. at net.sf.uadetector.datastore.AbstractDataStore.checkData(AbstractDataStore.java:48) at net.sf.uadetector.datastore.AbstractDataStore.<init>(AbstractDataStore.java:168) at net.sf.uadetector.service.UADetectorServiceFactory$ResourceModuleXmlDataStore.<init>(UADetectorServiceFactory.java:84) at net.sf.uadetector.service.UADetectorServiceFactory.<clinit>(UADetectorServiceFactory.java:92) ... 31 more