Hawtio简单插件示例-选项卡不可见 [英] Hawtio simple plugin example - tab is not visible
问题描述
我正在尝试开发自定义的hawtio插件.我已经基于hawtio-default 1.4.37在Tomcat中部署了自定义WAR.它可以正常工作
I am trying to develop a custom hawtio plugin. I have custom WAR deployed in Tomcat based on hawtio-default 1.4.37. It works correctly
我按照 https:构建了simple-plugin.war: //github.com/hawtio/hawtio/tree/master/hawtio-plugin-examples/simple-plugin 指令(不做任何更改)并将其部署在同一Tomcat中.
I built simple-plugin.war following https://github.com/hawtio/hawtio/tree/master/hawtio-plugin-examples/simple-plugin instruction (no changes are done) and deployed it in the same Tomcat.
没有错误,所有日志都是干净的,我可以在JMX bean中看到简单插件作为hawtio的插件,但是没有新的选项卡可见(尽管我猜从.js代码简单"选项卡应该出现)
There are no errors, all logs are clean, I can see simple-plugin as plugin of hawtio in JMX bean, however no new tab is visible (although as I guess from .js code "Simple" tab should appear)
有什么主意吗?与观点有关吗?
Any idea? Is it something to do with perspectives?
只需检查浏览器控制台并看到404错误
Just checked the browser console and seen 404 error
GET http://localhost:8080/myhawtio/plugin/ 404 (Not Found)
似乎我的自定义WAR没有正确配置
It seems that my custom WAR is not correctly reconfigured
下载并部署了干净的hawtio-default-1.4.37.war-简单插件有效,简单"选项卡可见
Downloaded and deployed clean hawtio-default-1.4.37.war - simple-plugin works, "Simple" tab is visible
下载并部署了干净的样本1.4.37.war-简单插件不起作用,选项卡不可见,并显示404错误
Downloaded and deployed clean sample-1.4.37.war - simple-plugin does not work, tab is not visible and get 404 error
GET http://localhost:8080/sample-1.4.37/plugin 404 (Not Found)
推荐答案
如果您获得针对/hawtio/plugin的404,那么您就从战争中丢失了PluginServlet,或者至少它没有运行-> https://github.com/hawtio/hawtio/blob/master/hawtio-system/src/main/java/io/hawt/web/PluginServlet.java
If you're getting a 404 for /hawtio/plugin then you're missing the PluginServlet from your war, or at least it isn't running -> https://github.com/hawtio/hawtio/blob/master/hawtio-system/src/main/java/io/hawt/web/PluginServlet.java
此servlet是前端发现任何要加载的其他插件的方式.我建议将您的web.xml与hawtio-web中的web.xml进行比较,并确保已加载此类.
This servlet is how the frontend discovers any additional plugins to load. I'd suggest comparing your web.xml with the one from hawtio-web and make sure this class is getting loaded.
这篇关于Hawtio简单插件示例-选项卡不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!