简体   繁体   English

为什么 Java.exe 突然无法找到文件/模块,即使 Windows Explorer 显示它们存在

[英]Why does Java.exe suddenly fail to find files/modules even though Windows Explorer shows they exist

We're experiencing a strange issue - has anybody seen anything similar?我们遇到了一个奇怪的问题 - 有没有人看到类似的东西?

We have a Java/JavaFX desktop application that has been running successfully on a Windows platform (Server 2012) for almost a year.我们有一个 Java/JavaFX 桌面应用程序,它已经在 Windows 平台(Server 2012)上成功运行了将近一年。

Recently we moved the application to a different Windows platform (Server 2019, virtual machine).最近,我们将应用程序移至不同的 Windows 平台(Server 2019,虚拟机)。

The app is installed on a shared drive and is started several times a day.该应用程序安装在共享驱动器上,每天启动数次。 It initially runs successfully but at some point in the day will no longer start.它最初运行成功,但在一天中的某个时间点将不再启动。

The command line is:命令行是:

java -p WolfToolkit.jar;WolfToolkit_mods -m com.mycompany.wolftoolkit/com.mycompany.start.StartGUI

WolfToolkit_mods is a folder containing jars for the required modules. WolfToolkit_mods 是一个文件夹,其中包含所需模块的 jars。 When the start-up error occurs, Java.exe reports thatvarying required modules cannot be found.出现启动错误时,Java.exe报告找不到各种所需的模块。 After a lot of diagnostic testing, it appears that Java.exe can no longer detect any of the jar files in the WolfToolkit_mods folder even though Windows Explorer shows the correct content.经过大量诊断测试后,Java.exe 似乎无法再检测到 WolfToolkit_mods 文件夹中的任何 jar 文件,即使 Windows 资源管理器显示正确的内容。

If I copy folder WolfToolkit_mods to WolfToolkit_mods2 and change the command to如果我将文件夹 WolfToolkit_mods 复制到 WolfToolkit_mods2 并将命令更改为

java -p WolfToolkit.jar;WolfToolkit_mods2...

then the app starts correctly.然后应用程序正确启动。

If I re-copy just one of the jar files into WolfToolkit_mods and use the original command, then only that file is visible.如果我只将 jar 文件之一重新复制到 WolfToolkit_mods 并使用原始命令,则只有该文件可见。 If all files are re-copied then the app runs correctly.如果重新复制所有文件,则应用程序运行正常。

So, the behaviour is as if Java suddenly views WolfToolkit_mods as being empty and only detects each jar file when it is copied back in. Meanwhile Windows sees no problems.因此,行为就像 Java 突然将 WolfToolkit_mods 视为空的,并且仅在将每个 jar 文件复制回时检测到它。同时 Windows 没有问题。 I should also mention that on rare occasions Java.exe suddenly starts reporting that WolfToolkit.jar is "Module format not recognized".我还应该提到,在极少数情况下 Java.exe 突然开始报告 WolfToolkit.jar 是“模块格式无法识别”。 Again, re-copying the file resolves the issue.同样,重新复制文件可以解决问题。

Any ideas on what this could be or how to diagnose?关于这可能是什么或如何诊断的任何想法? Thanks.谢谢。

Windows Server 2019 Standard v10.0 Windows服务器2019标准版v10.0

JVM: OpenJDK 64-bit Server v11.0.10+9 JVM:OpenJDK 64 位服务器 v11.0.10+9

This looks to have been caused by the virus checker which was quarantining all.jar files as "suspicious".这看起来是由将 all.jar 文件隔离为“可疑”的病毒检查程序引起的。 Presumably when java.exe was trying to read the files on the module path the virus checking software intervened and the effect was that java.exe couldn't locate module-info and so reported missing modules.据推测,当 java.exe 试图读取模块路径上的文件时,病毒检查软件进行了干预,结果是 java.exe 无法找到模块信息,因此报告缺少模块。

Thanks to those who took the time to respond.感谢那些花时间回复的人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM