NPE in Win32ShellFolder2.access when creating new JFileChooser as Local System Account in Windows 7

前端 未结 3 1262
天涯浪人
天涯浪人 2020-12-18 07:50

I have written unit tests for a Swing GUI that creates JFileChooser. Since the unit tests are run on a build server as a service, the unit tests need to run as the local sys

相关标签:
3条回答
  • 2020-12-18 08:11

    I believe is a Java 7 problem. Check your version and try with another. Or upgrade your java version.

    0 讨论(0)
  • 2020-12-18 08:12

    I happened to have a very similar problem and I managed to solve it configuring the service to be executed with an admin account (in the config, not just starting it being an admin). Be aware that you will not be able to do this with an admin account that has no password (well, not without touching the registry).

    0 讨论(0)
  • 2020-12-18 08:26

    This is not a JVM issue but a permissions issue. I recently encountered a similar stack trace running Java 8v92 on a Windows 10 machine.

    To fix this, set the Windows Service to log on as an Administrator account (launch Services, highlight the service and show Properties, select Log On tab in Windows 10):

    0 讨论(0)
提交回复
热议问题