将Windows Server的共享文件夹设置为Storage时,部署war文件后启动Resin,可能输出以下错误导致Resin无法启动。
英语版的错误信息是“There are no more files”。
----
java.io.IOException: 没有更多文件。
at java.base/java.io.WinNTFileSystem.canonicalizeWithPrefix0(Native Method)
at java.base/java.io.WinNTFileSystem.canonicalizeWithPrefix(WinNTFileSystem.java:461)
at java.base/java.io.WinNTFileSystem.canonicalize(WinNTFileSystem.java:432)
at java.base/java.io.File.getCanonicalPath(File.java:618)
at jp.co.intra_mart.system.service.client.file.StorageLocalFileImpl.getCanonicalPath(StorageLocalFileImpl.java:481)
at jp.co.intra_mart.system.service.client.file.StorageLocalFileImpl.checkAccessable(StorageLocalFileImpl.java:394)
at jp.co.intra_mart.system.service.client.file.StorageLocalFileImpl.<init>(StorageLocalFileImpl.java:91)
at jp.co.intra_mart.system.service.client.file.StorageLocalFileImpl.<init>(StorageLocalFileImpl.java:102)
at jdk.internal.reflect.GeneratedConstructorAccessor45.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at jp.co.intra_mart.foundation.service.client.file.AbstractStorage.<init>(AbstractStorage.java:108)
at jp.co.intra_mart.foundation.service.client.file.SystemStorage.<init>(SystemStorage.java:40)
at jp.co.intra_mart.system.service.provider.SystemStorageFileUpdater.copySystemStorage(SystemStorageFileUpdater.java:48)
at jp.co.intra_mart.system.service.provider.SystemStorageFileUpdater.copySystemStorage(SystemStorageFileUpdater.java:57)
at jp.co.intra_mart.system.service.provider.SystemStorageFileUpdater.copySystemStorage(SystemStorageFileUpdater.java:57)
at jp.co.intra_mart.system.service.provider.SystemStorageFileUpdater.copySystemStorage(SystemStorageFileUpdater.java:57)
at jp.co.intra_mart.system.service.provider.SystemStorageFileUpdater.copySystemStorage(SystemStorageFileUpdater.java:57)
at jp.co.intra_mart.system.service.provider.SystemStorageFileUpdater.copySystemStorage(SystemStorageFileUpdater.java:57)
at jp.co.intra_mart.system.service.provider.SystemStorageFileUpdater.copySystemStorage(SystemStorageFileUpdater.java:57)
at jp.co.intra_mart.system.service.provider.SystemStorageFileUpdater.copySystemStorage(SystemStorageFileUpdater.java:57)
at jp.co.intra_mart.system.service.provider.SystemStorageFileUpdater.copySystemStorage(SystemStorageFileUpdater.java:57)
at jp.co.intra_mart.system.service.provider.SystemStorageFileUpdater.update(SystemStorageFileUpdater.java:33)
at jp.co.intra_mart.system.service.impl.ServiceControllerImpl.startCoordinator(ServiceControllerImpl.java:189)
at jp.co.intra_mart.system.service.impl.ServiceControllerImpl.accept(ServiceControllerImpl.java:664)
at jp.co.intra_mart.system.service.impl.ServiceControllerImpl.start(ServiceControllerImpl.java:126)
at jp.co.intra_mart.foundation.service.ServiceController.start(ServiceController.java:49)
at jp.co.intra_mart.system.servlet.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:125)
at com.caucho.server.webapp.WebApp.callInitializers(WebApp.java:3570)
at com.caucho.server.webapp.WebApp.startImpl(WebApp.java:3890)
at com.caucho.server.webapp.WebApp.access$700(WebApp.java:209)
at com.caucho.server.webapp.WebApp$StartupTask.run(WebApp.java:5476)
at com.caucho.env.thread2.ResinThread2.runTasks(ResinThread2.java:173)
at com.caucho.env.thread2.ResinThread2.run(ResinThread2.java:118)
----
【发生条件】
将Windows Server的共享文件夹设置为Storage时,可能发生。
【原因】
在OS返回“ERROR_NO_MORE_FILES”的错误ID时, JDK将其视为异常来处理。
这可能是由以下JDK的Bug所引起的。
https://bugs.openjdk.java.net/browse/JDK-8234363 (英语)
【规避方法】
目前,已确认通过以下方法可以规避此现象。
1. 复制在Resin下所展开的以下目录中包含的所有文件夹。
复制源:WEB-INF/storage/system 下层
2. 将上一步复制的文件夹粘贴到以下目录。
粘贴处:{系统Storage目录}/storage 下层
例:在Storage根路径是X://storage/imart ,系统Storage目录名称是system的情况下,结果为 X://storage/imart/system/storage
※根据设置的不同,粘贴处的系统Storage目录会有所不同,因此请确认所使用环境的设置。
配置文件参考 - Storage配置文件
https://www.intra-mart.jp/document/library/iap/public/configuration/im_configuration_reference/texts/im_core/storage-config/index.html#%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0%E3%82%B9%E3%83%88%E3%83%AC%E3%83%BC%E3%82%B8%E3%83%87%E3%82%A3%E3%83%AC%E3%82%AF%E3%83%88%E3%83%AA%E5%90%8D%E8%A8%AD%E5%AE%9A
【相关需求】
此现象已在“2020 Summer”中进行了改进。
需求[31955]将Windows Server的共享文件夹设置为Storage时,Accel Platform可能无法启动。
https://issue.intra-mart.jp/issues/31955
-- 适用对象 -------------------------------------------
iAP/Accel Platform/所有更新版本
-----------------------------------------------------------
FAQID:1029
将Windows Server的共享文件夹设置为Storage时,Resin可能无法启动。