在空文件夹中运行时,JXbrowser初始化失败:java.nio.file.NoSuchFileException:... jxbrowser-browser.log.lck

时间:2017-07-30 15:37:37

标签: javafx jxbrowser

操作系统:macOS Sierra 10.12.3(16D32)

jxbrowser version:6.14.2

我将jxbrowser cache和logs目录设置为执行的jar文件附近的单个文件夹。当它从头开始运行时异常上升:java.nio.file.NoSuchFileException:... jxbrowser-browser.log.lck

如果运行以前的版本(6.3),然后运行当前版本,那么一切正常。

[DEBUG] 2017-07-30 15:55:00.411 [main] ScalarSelectOperation - select from result set
Exception in Application init method
java.lang.RuntimeException: Exception in Application init method
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:912)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.nio.file.NoSuchFileException: /%PATH_TO_JAR_FOLDER%/.cache/jxbrowser-browser.log.lck
    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
    at sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:177)
    at java.nio.channels.FileChannel.open(FileChannel.java:287)
    at java.nio.channels.FileChannel.open(FileChannel.java:335)
    at java.util.logging.FileHandler.openFiles(FileHandler.java:459)
    at java.util.logging.FileHandler.<init>(FileHandler.java:292)
    at ru.mybetter.ui.desktop.BetterClient.redirectLogMessagesToFile(BetterClient.java:174)
    at ru.mybetter.ui.desktop.BetterClient.init(BetterClient.java:106)
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:841)
    ... 2 more

2017-07-30 15:55:00,610 pool-2-thread-1 DEBUG Stopping LoggerContext[name=2a139a55, org.apache.logging.log4j.core.LoggerContext@f5a3839]
2017-07-30 15:55:00,611 pool-2-thread-1 DEBUG Stopping LoggerContext[name=2a139a55, org.apache.logging.log4j.core.LoggerContext@f5a3839]...

1 个答案:

答案 0 :(得分:0)

根据异常堆栈跟踪,错误来自:

ru.mybetter.ui.desktop.BetterClient.redirectLogMessagesToFile(BetterClient.java:174)

我想你创建了FileHandler实例,其中包含一个不存在的文件的无效路径。或者,根据FileHandler(String pattern)的Javadoc,IOExceptionthere are IO problems opening the files可以从其构造函数中抛出FileHandler

请确保您传递给class a{ public $b=['f'=>'c']; } $a=new a; $b='b'; echo $a->$b['f']; 构造函数的文件的路径可以从Java程序访问,并且没有读/写权限问题。