CodeMason / proxy-vole

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

Invalid java.io.tmpdir will cause NullPointerException in static initializer which leads to ExceptionInInitializerError #46

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set system property java.io.tmpdir to a directory which does not exist
2. Run proxy-vole on Windows with the Browser Strategy
3. => Exception occurs because the result from File.listFiles() in 
DLLManager.cleanupTempFiles() is not checked for null, but is invoked via 
static initializer in Win32ProxyUtils:

java.lang.ExceptionInInitializerError
    at ProxySelectorInvalidTempdirTest.testNPEDllLoad(ClientProxySelectorInvalidTempdirTest.java:39)
Caused by: java.lang.RuntimeException: Error loading dllThe system cannot find 
the path specified
    at com.btr.proxy.search.desktop.win.Win32ProxyUtils.<clinit>(Win32ProxyUtils.java:40)
    ... 24 more
Caused by: java.io.IOException: The system cannot find the path specified
    at java.io.WinNTFileSystem.createFileExclusively(Native Method)
    at java.io.File.createNewFile(File.java:1006)
    at java.io.File.createTempFile(File.java:1989)
    at java.io.File.createTempFile(File.java:2040)
    at com.btr.proxy.search.desktop.win.DLLManager.extractToTempFile(DLLManager.java:103)
    at com.btr.proxy.search.desktop.win.DLLManager.findLibFile(DLLManager.java:50)
    at com.btr.proxy.search.desktop.win.Win32ProxyUtils.<clinit>(Win32ProxyUtils.java:36)
    ... 24 more

What is the expected output? What do you see instead?
* Proxy vole detects browser settings and does not throw Exceptions

What version of the product are you using? On what operating system?
* last released version, Windows

Please provide any additional information below.

Original issue reported on code.google.com by Dominik....@gmail.com on 28 Nov 2013 at 3:09

GoogleCodeExporter commented 9 years ago
Hi
I added some null checks and catch all errors that occure during cleanup.
This is fixed with revision 116. 

This will be included in the next release that will come this week.

Regards,
- Rossi

Original comment by rosstaus...@googlemail.com on 3 Dec 2013 at 12:37