如何检测 Java Web Start 何时/为何无法为用户启动

发布于 2024-10-03 16:27:33 字数 550 浏览 3 评论 0原文

情况:

大型公司,拥有多个内部 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

时常饿 2024-10-10 16:27:33

您的原因似乎都很合理,但我认为通过添加更多代码很难解决这些问题,尤其是前两个原因。我认为您将需要进行一些更老式的故障排除,以便您可以重现用户遇到的问题。

也许在网络应用程序中出现“启动时遇到问题?”遇到前两个问题之一的用户可以使用该链接来报告问题,因为他们应该能够轻松检测到应用程序未启动。

为了消除第三个原因,不要让应用程序本身直接连接到数据库,而是仅让它们通过 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.

陌伤ぢ 2024-10-10 16:27:33

我想分别建议您针对每种情况的解决方案。

* The user did not have JVM installed or possibly the correct version

通常,用户通过单击浏览器中 JNLP 文件的链接来启动 Web 启动应用程序。尝试检查java插件是否安装。您可以使用 java 脚本来完成它。这样您将避免用户没有 java 插件来启动应用程序。我知道这不是理想的解决方案:
- 可能插件没有安装,但桌面java可以运行。这是“假阴性”
- 用户可能第一次成功运行应用程序,但随后卸载 JVM 并尝试再次运行应用程序。

* 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.

所有其他问题都可以使用某种加载程序来解决。

  1. 使用 bat 文件/shell 脚本运行应用程序,在运行应用程序本身之前测试 java 是否在这里。我知道 Web Start 本身运行应用程序,但您可以在桌面上创建特殊图标来通过脚本运行您的应用程序。
  2. 使用轻量级加载程序包装“大”应用程序,该加载程序检查类路径和(可能)数据库连接的有效性,然后运行应用程序。加载程序可以向用户和管理员发送失败通知,并提供
  3. 一些疯狂的解决方案。让我们回到剧本。该脚本可以通知服务器端应用程序将要启动。服务器启动计时器任务,在数据库中检查应用程序状态。如果应用程序尚未连接到服务器,服务器可能会通过使用“网络发送”(如果用户在 Windows 上)发送消息或邮件(如果用户在其他平台上)发送消息来通知用户。

I'd like to suggest you solution for each case separately.

* The user did not have JVM installed or possibly the correct version

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.

* 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.

All other issues could be solved using some kind of loader.

  1. run application using bat file/shell script that tests that java is here before running the application itself. I know that web start runs application itself but you can create special icon on desktop that runs your application via the script.
  2. wrap you "big" application(s) using lightweight loader that checks validity of classpath and (probably) DB connectivity and then runs the application. The loader can send failure notifications to user and to administrator
  3. some crazy solution. Let's back to the script. The script may notify the server side that the application is going to start. Server starts timer task that checks in DB the application status. If application has not connected to server the server may notify user by sending message using "net send" (if user is on windows) or mail if user is on other platform.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文