如何检测 Java Web Start 何时/为何无法为用户启动
情况:
大型公司,拥有多个内部 Java 应用程序,这些应用程序通过 Java Web Start 从 Java Web 应用程序启动。用户登录 Java Web 应用程序并选择通过 Java WebStart 启动的程序。当用户尝试运行应用程序时,应用程序会登录数据库。应用程序启动后,它会在数据库中标记行已成功。
问题:
数据库中存在用户启动程序的行,但应用程序从未更新其启动的数据库。我能想到的原因只有几个:
- 用户没有安装 JVM 或者可能没有安装正确的版本
- 由于 Web 服务器/部署问题,应用程序无法加载。 (例如,并非应用程序所需的所有 .jar 都部署到 Web 服务器。
- 应用程序存在与数据库的连接问题或导致其无法写入数据库的错误。
目标/问题:
我想确定原因的数量。是否有办法检测 Java Web Start 应用程序无法启动的原因,以便我可以了解出现这种情况的频率?是否还有其他我可能没有考虑的原因?
Situation:
Large company with several internal Java applications that launched via Java Web Start from a Java Web Application. Users login into the Java Web Application and select a program that launches via Java WebStart. The application logs in a database when a user attempts to run an application. Once the application starts it marks the row in the database that it was successful.
Problem:
There are rows in the database where a user launched a program, but the application never updated the database that it started. There are a only a few causes that I can think of:
- The user did not have JVM installed or possibly the correct version
- The application failed to load due to a web-server/deployment issue. (For example not all .jars required by the application were deployed to the web server.
- The application had a connection issue with the database or a bug that caused it to not write to the database.
Goal/Question:
I would like to identify the quantities of the causes. Is there anyway to detect why a Java Web Start App failed to start, so that I can see how often this is the case? Is there another cause I might not be considering?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的原因似乎都很合理,但我认为通过添加更多代码很难解决这些问题,尤其是前两个原因。我认为您将需要进行一些更老式的故障排除,以便您可以重现用户遇到的问题。
也许在网络应用程序中出现“启动时遇到问题?”遇到前两个问题之一的用户可以使用该链接来报告问题,因为他们应该能够轻松检测到应用程序未启动。
为了消除第三个原因,不要让应用程序本身直接连接到数据库,而是仅让它们通过 HTTP 与启动 JNLP 的 Web 应用程序进行通信 - 您可以合理地确信它们已连接到该服务器。然后让该网络应用程序插入适当的数据库记录。
Your causes all seem plausible, but I think they're going to be difficult to troubleshoot by adding more code, especially the first two causes. I think you're going to need to do some more old-fashioned troubleshooting so that you can replicate the issues your users are experiencing.
Perhaps in the web-app have a "Trouble launching?" link that a user who experienced one of the first two issues could use to report the issue, because they should be able to readily detect that the app didn't launch.
To eliminate the third cause, don't have the apps themselves connect directly to the database, but instead only have them communicate back over HTTP to the web app that launched the JNLP - you can be reasonably assured that they have connectivity to that server. Then have that web-app insert the appropriate database records.
我想分别建议您针对每种情况的解决方案。
通常,用户通过单击浏览器中 JNLP 文件的链接来启动 Web 启动应用程序。尝试检查java插件是否安装。您可以使用 java 脚本来完成它。这样您将避免用户没有 java 插件来启动应用程序。我知道这不是理想的解决方案:
- 可能插件没有安装,但桌面java可以运行。这是“假阴性”
- 用户可能第一次成功运行应用程序,但随后卸载 JVM 并尝试再次运行应用程序。
所有其他问题都可以使用某种加载程序来解决。
I'd like to suggest you solution for each case separately.
Typically user starts web start application by clicking link to JNLP file in browser. Try to check that java plugin is installed. You can do it using java script. This way you will avoid user that does not have java plugin to start application. I know that it is not ideal solution:
- probably plugin is not installed but desktop java can run. this is "false negative"
- user may run application first time successfully but then uninstall the JVM and try to run application again.
All other issues could be solved using some kind of loader.