Skip to content
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

NullPointerException when PAC file not available #47

Closed
GoogleCodeExporter opened this issue Feb 5, 2016 · 3 comments
Closed

NullPointerException when PAC file not available #47

GoogleCodeExporter opened this issue Feb 5, 2016 · 3 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant