java - 在 Glassfish/Payara 上禁用或隐藏 "ejb-timer-service-app"

标签 java jakarta-ee timer glassfish payara

运行现有的 Glassfish 或 Payara Server 时,会部署一个名为“ejb-timer-service-app”的默认应用程序,其中包含一个位于 http://localhost:8080/ejb-timer-service-app/timer 的 Web 前端。

enter image description here

更多信息请点击:https://docs.oracle.com/cd/E18930_01/html/821-2418/beahw.html

遗憾的是,前端无法通过 protected 管理控制台(端口 4848)访问,但可以通过主主机(端口 8080 和 8181)访问。这样每个知道我的服务器 URL 的人都可以访问此页面。

有没有办法在没有一些奇特的防火墙或负载均衡器配置的情况下停用应用程序(而不是 ejb-timer-service 本身)或至少使前端页面不再可访问(隐藏它)?

最佳答案

显然目前还没有办法立即禁用该应用程序。我在 github 上请求了 payara 的新功能:https://github.com/payara/Payara/issues/1803

由于应用程序服务器需要 ejb-timer-service-app.war 才能提供 EJB 计时器服务,因此无法删除它。

但是我创建了一个解决方法来至少禁用前端部分:

I did some quick tests locally on how to remove the frontend without damaging the EJB timer-service. Here is what I've changed inside the ${PAYARA_HOME}/glassfish/lib/install/applications/ejb-timer-service-app.war:

Delete file WEB-INF\sun-web.xml
Delete file WEB-INF\web.xml
Delete folder WEB-INF\classes\com

Shell commands:

zip -d ejb-timer-service-app.war "WEB-INF/sun-web.xml"
zip -d ejb-timer-service-app.war "WEB-INF/web.xml"
zip -d ejb-timer-service-app.war "WEB-INF/classes/com/*"

If the domain has been started before you also have to delete the folder glassfish\domains\domain1\applications\ejb-timer-service-app to clean up the already deployed frontend.

After a domain restart the servlet at http://localhost:8080/ejb-timer-service-app/timer is no longer available (HTTP 404) nevertheless the EJB timers are working properly

关于java - 在 Glassfish/Payara 上禁用或隐藏 "ejb-timer-service-app",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45326963/

相关文章:

java - 在 apache shiro 中提交 token 时获取异常身份验证失败

java - 无法获取包含在 servlet 中的 <...> 中的文本区域内容

java - 项目部署正确,但服务器返回404未找到

java - Glassfish - 无法更新 http 端口。服务器关闭

python - 为什么此Python Tkinter秒表脚本崩溃?

java - 如何将用户名和密码字段输入 Blackberry 文本框?

java关键词提取

java - 对基本框架类进行子类化是否安全?

c# - XAML DispatcherTimer 间隔太慢

android - 模拟按钮android的闪烁