JackieJ / proxy-vole

Automatically exported from code.google.com/p/proxy-vole
0 stars 1 forks source link

RuntimeException: No Context associated with current Thread #5

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When evaluating pac scripts, I get a runtime exception from rhino: No
Context associated with current Thread.

After some investigation, I found that Javascript context has to be
initialized with org.mozilla.javascript.Context.enter(). 

In PacProxySelector.java, I changed the findProxy() method, and now it works:

org.mozilla.javascript.Context.enter();  // <<<<< new line
String parseResult = this.pacScriptParser.evaluate(uri.toString(),
uri.getHost());
org.mozilla.javascript.Context.exit(); // <<<<< new line

Original issue reported on code.google.com by pedro.h....@gmail.com on 1 Jun 2010 at 6:21

GoogleCodeExporter commented 8 years ago
Hi 
thanks for reporting this. Yes this seems to be an ugly bug. The PAC selector 
is not
threadsave. Your proposed fix seems good.
I will do some testing on this an release a fixed version within the next week.

- Bernd 

Original comment by rosstaus...@googlemail.com on 6 Jun 2010 at 5:29

GoogleCodeExporter commented 8 years ago
Hi,
Finally I found some time to fix this and to improve the pac parser.
The issue is fixed in the repository and I have build a new download build.

Have fun,
- Bernd

Original comment by rosstaus...@googlemail.com on 24 Jul 2010 at 8:31