-
Notifications
You must be signed in to change notification settings - Fork 786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IlegalAccessError throws when using browsermob with WebDriver 2.30.0 to capture n/w #90
Comments
Jane, |
Hi, lightbody, My java version is "1.6.0_07". The browsermob dependency of selenium-api version is 2.20.0. We tested when my project configured with following selenium-server version, browsermob works fine. But not OK with the version larger than 2.26.0. Pls help to confirm whether the error is related to it? YOURS, |
Interesting. Do you have any unique policies/access rights on the JVM? How are you launching it? java.lang.IllegalAccessError: tried to access method java.net.InetSocketAddress.getHostString()Ljava/lang/String; from class org.browsermob.proxy.http.SimulatedSocketFactory On Mar 14, 2013, at 6:21 AM, Jane Li notifications@github.com wrote:
|
I'm getting the exact same error using the 2.0-beta-7 standalone REST API. I'm using Java version 1.6.0_26 on a 64-bit Debian Squeeze VM. |
Can you boil it down to a bare bones test case? On Mar 14, 2013, at 10:23 AM, schwartzie notifications@github.com wrote:
|
I didn't get any farther than a bare bones test case myself, so here's a complete rundown of what I did: Launch proxy server:
Create proxy instance, and add page to HAR:
...results in the following output from the server:
Make a request via the proxy:
...results in the following output from the server:
Retrieve HAR:
Let me know if there's anything else I can provide that will help. |
HI, lightbody, To getting more clear with this issue, we tried to test on much more different scenarios. Those are our testing result:
Maybe this result can do some help. Pls help to check. YOURS, |
I just tried my test case with 2.0-beta-6, and it worked for me too. |
will this issue be resolved at 2.0-beta-7 version? |
OK it looks like this all came from this comment: e4c53e1#src/main/java/org/browsermob/proxy/http/SimulatedSocketFactory.java I'm hoping that @rexhoffman can help us get it resolved. Rex? |
Hmm... I was using a mac os x version of java 6 when I wrote this, and didn't experience any security based exceptions/issues. I started a new gig since writing this however and don't have any tests set up around the code. What os/jvms were used? I have no need to support java 6 at this point. Just seemed a little sad to force 1.7 for one method. I believe the there were concerns regarding the time constraints of using other methods to determine the host. Though we never discussed caching. Having done some work configuring policies/building hacks to prevent resource access during testing, this smells like a jvm doing security policy checking in the method. Java security models are painful at best, and seems to diverge between different jvm providers, so my hack to work around getting access to non-public methods should probably be reverted -- since it has been proven to break with some jvms default policy configurations. I'm not sure if another work-around would be accepted targeting some other method to calculate the host and potentially cache it. Lesson learned: don't use reflection to grab non-public methods in the jvm -- they may get tightened up/be tighter in another jvm. |
@JaneLee and @schwartzie - can you get back to @rexhoffman with any info you have about the issue? |
My OS is window-xp; And using default jvm configration in Intellij IDEA. |
Just confirming the bug, java.lang.IllegalAccessError is being thrown when trying to use proxy. Environment: # browsermob-proxy version: 2.0-beta-7 $ uname -a Linux aleksander-cuda 3.2.0-39-generic-pae #62-Ubuntu SMP Wed Feb 27 22:25:11 UTC 2013 i686 i686 i386 GNU/Linux $ java -version java version "1.6.0_43" Java(TM) SE Runtime Environment (build 1.6.0_43-b01) Java HotSpot(TM) Server VM (build 20.14-b01, mixed mode) Steps to reproduce: # as in tutotorial $ sh browsermob-proxy -port 9090 & ... $ curl -X POST http://localhost:9090/proxy {"port":9091} $ curl -x localhost:9091 http://google.com java.lang.IllegalAccessError: tried to access method java.net.InetSocketAddress.getHostString()Ljava/lang/String; from class org.browsermob.proxy.http.SimulatedSocketFactory at org.browsermob.proxy.http.SimulatedSocketFactory.connectSocket(SimulatedSocketFactory.java:118) ... |
I got the same error on mac with JDK 1.7. |
@rexhoffman What do you suggest we do? Looks like quite a few people are having trouble and I'd like to get this resolved before making the next release. |
Definitely surprised by the jdk7 issue on mac as the method was supposed to As per #74 My understand is that we wanted to use that method for performance reasons We don't have many good options. Tightening java security/desire for a Personally I'd think taking the performance hit and using http://docs.oracle.com/javase/6/docs/api/java/net/InetSocketAddress.html#getHostName()is wdyt? I'd have no problem doing this tomorrow and putting this issue down. I'll On Sun, Apr 7, 2013 at 2:29 PM, Patrick Lightbody
|
Hi, I'm getting this error too, 2.0-beta-7, java 6. |
I will get this fixed soon. On Fri, Apr 19, 2013 at 5:00 AM, annagrgr notifications@github.com wrote:
|
can confirm this error: MacOS X, java version "1.6.0_43", 2.0-beta-7 |
I've got it reproduced. Now to fix it. Should be tonight I hope. On Mon, Apr 22, 2013 at 3:08 AM, cpuser notifications@github.com wrote:
|
I'm also seeing this. Hoping for a beta-8 soon! :) |
I just committed a fix for this. For those of you who can build from master, please try it out and confirm it works for you now. I hope to release beta-8 soon! |
I'm getting failures when attempting to build from master. See http://www.pastebin.mozilla.org/2359519 for details. If you're able to build, could you make a release candidate available? I'm happy to test it. |
@davehunt That was actually a goof on my part. Try updating again and doing the build. Everyone else is encouraged to try this latest build out too, since to fully resolve this bug I upgraded from HttpClient 4.1 to 4.2 and it might introduce some weird artifacts. |
@lightbody beta 8 works for me! :) |
Hi, Where can I find beta 8? Im using maven dependency by the way. Thanks. |
Thanks! |
Hi , lightbody,
I was so excited after reading a blog about how to capture n/w using WebDriver. One solution is to use browsermob-proxy. But unfortunately I met one issue during my practise project with latest firefox version. And it works not OK etither on IE8 or on Chrome browsers. Causing we need to cover mutliple browsers testing. Pls let me know how to solve this issue! Thx
Running environment:
Firefox 19.0.2
WebDriver-Server >= 2.27.0
Maven dependency configurations:
My code using browsermob to capture n/w
Following are error logs:
INFO 03/13 07:12:09 o.b.p.j.h.HttpServer - Version Jetty/5.1.x
INFO 03/13 07:12:09 o.b.p.j.u.Container - Started HttpContext[/,/]
INFO 03/13 07:12:09 o.b.p.j.h.SocketLis~ - Started SocketListener on 0.0.0.0:5555
INFO 03/13 07:12:09 o.b.p.j.u.Container - Started org.browsermob.proxy.jetty.jetty.Server@12be1bd
WARN 03/13 07:12:23 o.b.p.j.h.HttpConne~ - GET http://re.taobao.com/search? HTTP/1.1
java.lang.IllegalAccessError: tried to access method java.net.InetSocketAddress.getHostString()Ljava/lang/String; from class org.browsermob.proxy.http.SimulatedSocketFactory
at org.browsermob.proxy.http.SimulatedSocketFactory.connectSocket(SimulatedSocketFactory.java:118)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:148)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:150)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:575)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:425)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
at org.browsermob.proxy.http.BrowserMobHttpClient.execute(BrowserMobHttpClient.java:561)
at org.browsermob.proxy.http.BrowserMobHttpClient.execute(BrowserMobHttpClient.java:372)
at org.browsermob.proxy.http.BrowserMobHttpRequest.execute(BrowserMobHttpRequest.java:157)
at org.browsermob.proxy.BrowserMobProxyHandler.proxyPlainTextRequest(BrowserMobProxyHandler.java:270)
at org.browsermob.proxy.selenium.SeleniumProxyHandler.handle(SeleniumProxyHandler.java:185)
at org.browsermob.proxy.jetty.http.HttpContext.handle(HttpContext.java:1509)
at org.browsermob.proxy.jetty.http.HttpContext.handle(HttpContext.java:1461)
at org.browsermob.proxy.jetty.http.HttpServer.service(HttpServer.java:892)
at org.browsermob.proxy.jetty.http.HttpConnection.service(HttpConnection.java:815)
at org.browsermob.proxy.jetty.http.HttpConnection.handleNext(HttpConnection.java:981)
at org.browsermob.proxy.jetty.http.HttpConnection.handle(HttpConnection.java:832)
at org.browsermob.proxy.jetty.http.SocketListener.handleConnection(SocketListener.java:245)
at org.browsermob.proxy.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.browsermob.proxy.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
WARN 03/13 07:12:24 o.b.p.j.h.HttpConne~ - GET http://re.taobao.com/favicon.ico HTTP/1.1
java.lang.IllegalAccessError: tried to access method java.net.InetSocketAddress.getHostString()Ljava/lang/String; from class org.browsermob.proxy.http.SimulatedSocketFactory
at org.browsermob.proxy.http.SimulatedSocketFactory.connectSocket(SimulatedSocketFactory.java:118)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:148)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:150)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:575)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:425)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
at org.browsermob.proxy.http.BrowserMobHttpClient.execute(BrowserMobHttpClient.java:561)
at org.browsermob.proxy.http.BrowserMobHttpClient.execute(BrowserMobHttpClient.java:372)
at org.browsermob.proxy.http.BrowserMobHttpRequest.execute(BrowserMobHttpRequest.java:157)
at org.browsermob.proxy.BrowserMobProxyHandler.proxyPlainTextRequest(BrowserMobProxyHandler.java:270)
at org.browsermob.proxy.selenium.SeleniumProxyHandler.handle(SeleniumProxyHandler.java:185)
at org.browsermob.proxy.jetty.http.HttpContext.handle(HttpContext.java:1509)
at org.browsermob.proxy.jetty.http.HttpContext.handle(HttpContext.java:1461)
at org.browsermob.proxy.jetty.http.HttpServer.service(HttpServer.java:892)
at org.browsermob.proxy.jetty.http.HttpConnection.service(HttpConnection.java:815)
at org.browsermob.proxy.jetty.http.HttpConnection.handleNext(HttpConnection.java:981)
at org.browsermob.proxy.jetty.http.HttpConnection.handle(HttpConnection.java:832)
at org.browsermob.proxy.jetty.http.SocketListener.handleConnection(SocketListener.java:245)
at org.browsermob.proxy.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.browsermob.proxy.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
============2
END!!
INFO 03/13 07:12:24 o.b.p.j.u.ThreadedS~ - Stopping Acceptor ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=5555]
INFO 03/13 07:12:24 o.b.p.j.h.SocketLis~ - Stopped SocketListener on 0.0.0.0:5555
java.lang.NullPointerException
at com.etao.ad.p4p.hotsale.learn.testFirefox.afterClass(testFirefox.java:101)
YOURS,
Jane Li
The text was updated successfully, but these errors were encountered: