如何为 JBoss MBean 创建资源引用
A 将应用程序部署到 JBoss。 它里面包含我注册的 Quartz MBean,它会触发计划任务。
如何为该 MBean 创建资源引用,以通过任务代码中的 java:/comp/env/*
而不是 java:/*
访问资源?
A have an application deployed to JBoss. It contains inside it I register Quartz MBean which triggers a scheduled task.
How can I create resource ref for that MBean to access resource by java:/comp/env/*
and not java:/*
in my task code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Web 应用程序中,将如下内容添加到 web.xml:
并将如下内容添加到 jboss-web.xml:
就位后,您应该能够使用本地资源引用
查找资源java:comp/env/QuartzObject
.In a web app, add something like the following to web.xml:
and add something like the following to jboss-web.xml:
with that in place, you should be able to lookup the resource using the local resource reference,
java:comp/env/QuartzObject
.