volkertb / proxy-vole

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

NullPointerException when PAC file not available #47

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I noticed this while testing on my laptop.  It is configured to use a PAC file, 
but this file is only available when I am at work on the company network.  If I 
run from another location where the PAC file is not available, I get an NPE.  
The OS will just not use a proxy when the PAC file is not available and I would 
expect the same behavior from proxy-vole.

What steps will reproduce the problem?
1) Configure the OS to use a PAC file that is not available.
2) Run the following code:
      ProxySearch proxySearch = new ProxySearch();
      proxySearch.addStrategy(ProxySearch.Strategy.OS_DEFAULT);
      proxySelector = proxySearch.getProxySelector();

What is the expected output? What do you see instead?
I would expect to get a ProxySelector that would always give me Proxy.NO_PROXY. 
 Instead I get an NPE with the following stack trace:
java.lang.NullPointerException: ProxySelector must not be null.
    at com.btr.proxy.selector.whitelist.ProxyBypassListSelector.<init>(ProxyBypassListSelector.java:39)
    at com.btr.proxy.selector.whitelist.ProxyBypassListSelector.<init>(ProxyBypassListSelector.java:54)
    at com.btr.proxy.search.desktop.osx.OsxProxySearchStrategy.installExceptionList(OsxProxySearchStrategy.java:224)
    at com.btr.proxy.search.desktop.osx.OsxProxySearchStrategy.buildSelector(OsxProxySearchStrategy.java:141)
    at com.btr.proxy.search.desktop.osx.OsxProxySearchStrategy.getProxySelector(OsxProxySearchStrategy.java:113)
    at com.btr.proxy.search.desktop.DesktopProxySearchStrategy.getProxySelector(DesktopProxySearchStrategy.java:34)
    at com.btr.proxy.search.ProxySearch.getProxySelector(ProxySearch.java:193)

What version of the product are you using? On what operating system?
proxy-vole 20131209 on Max OSX 10.7.5

Please provide any additional information below.
In OsxProxySearchStrategy.buildSelector, line 138, installPacProxyIfAvailable 
is returning a null.  This breaks things further down the line when calling 
installExceptionList.

Original issue reported on code.google.com by sappl...@gmail.com on 9 Mar 2014 at 2:38

GoogleCodeExporter commented 9 years ago
I have the exact same problem.

Exception in thread "main" java.lang.NullPointerException: ProxySelector must 
not be null.
at 
com.btr.proxy.selector.whitelist.ProxyBypassListSelector.<init>(ProxyBypassListS
elector.java:39)
at 
com.btr.proxy.selector.whitelist.ProxyBypassListSelector.<init>(ProxyBypassListS
elector.java:54)
at 
com.btr.proxy.search.desktop.osx.OsxProxySearchStrategy.installExceptionList(Osx
ProxySearchStrategy.java:224)
at 
com.btr.proxy.search.desktop.osx.OsxProxySearchStrategy.buildSelector(OsxProxySe
archStrategy.java:141)
at 
com.btr.proxy.search.desktop.osx.OsxProxySearchStrategy.getProxySelector(OsxProx
ySearchStrategy.java:113)
at 
com.btr.proxy.search.desktop.DesktopProxySearchStrategy.getProxySelector(Desktop
ProxySearchStrategy.java:34)
at com.btr.proxy.search.ProxySearch.getProxySelector(ProxySearch.java:193)

Original comment by patilche...@gmail.com on 8 Apr 2014 at 8:49

GoogleCodeExporter commented 9 years ago
I am not an expert but after researching a bit, it seems to be a problem with 
OSX itself.
There are issues relating reading local PAC file on OSX
Source:
https://discussions.apple.com/thread/3202499?tstart=0

Hope this would help,
Cheers

Original comment by patilche...@gmail.com on 8 Apr 2014 at 9:43

GoogleCodeExporter commented 9 years ago
Hi all,
This is a bug that I have recently fixed. It happens if no PAC file is there 
but still settings for a "whitelist" exist then this settings are applied on a 
null selector and this causes the exception. This issue is fixed now in the 
source code repository.
Please checkout the latest version from the source as I can no longer upload 
binary release files to google code.

Thanks for reporting this,
- Rossi

Original comment by rosstaus...@googlemail.com on 9 Feb 2015 at 10:00