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 in Proxy-vole 1.0.5 #50

Closed
gschnepp opened this issue Aug 8, 2018 · 4 comments
Closed

NullPointerException in Proxy-vole 1.0.5 #50

gschnepp opened this issue Aug 8, 2018 · 4 comments

Comments

@gschnepp
Copy link

gschnepp commented Aug 8, 2018

Hello,

a customer of mine is getting a NullPointerException in PacProxySelector#findProxy():

caused by: java.lang.NullPointerException
at com.github.markusbernhardt.proxy.selector.pac.PacProxySelector.findProxy(PacProxySelector.java:128)
at com.github.markusbernhardt.proxy.selector.pac.PacProxySelector.select(PacProxySelector.java:110)
at com.github.markusbernhardt.proxy.selector.misc.BufferedProxySelector.select(BufferedProxySelector.java:137)
at com.github.markusbernhardt.proxy.selector.misc.ProxyListFallbackSelector.select(ProxyListFallbackSelector.java:80)
at de.credo.lookup2.proxy.ProxyHandler.activate<ProxyHandler.java:282)

Relevant line in my program is:
data.proxyObject = proxySelector.select(new URI("https://license.cre-do.de")).get(0);

Program breaks at line 128 in PacProxySelector, which is:
String parseResult = this.pacScriptParser.evaluate(uri.toString(), uri.getHost());

Since given uri parameter is not null and valid by convention, only reason can be that variable pacScriptParser is null. (NPE is not in evaluate() method, so it's not able to call this method.) This variable in turn is set in PacProxySelector constructor with a PacScriptSource as parameter (PacProxySelector:41). This variable can only be null in case a JavaxPacScriptParser can't be created with this source.

To sum it up: A PAC script can't be evaluated by JavaxPacScriptParser and kills subsequent methods by not catching null. I'll try to get this PAC script, but this company may not be able or willing to give it out. Analysis of the PAC script can be the half solution only anyway.

Regards
Guido

@NeXT405
Copy link

NeXT405 commented Aug 21, 2018

Hello Guido

I have the same problem as you. Did you find a way around it? I tested it with 1.0.4 and 1.0.5.

Regards
Marcel

@gschnepp
Copy link
Author

No, not yet. I had two customers recently with the same problem, both using unknown PAC/WPAD scripts. And both were not willing to share any part of their script with me (resp. us, I pointed them to this issue here, with no further responds).

Workaround was is to catch NPE on my side and deactivate automatic proxy detection (resp. direct/no proxy). When my application starts, users can select their proxy by hand. This seem to work.

Since customers are not willing to share their detailed proxy settings with me/us, I have no more information but to work around as described.

Are you able to get their script for a detail analysis?

Regards
Guido

@MarkusBernhardt
Copy link
Owner

Sorry. It took some time to look into this. Do you see in the log before the NullPointerException the following error: "PAC parser error."?

I will add a check for null to avoid the NPE and return a NO_PROXY in this case.

@MarkusBernhardt
Copy link
Owner

Will be in release 1.0.6

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

No branches or pull requests

3 participants