我目前正在 JBoss AS 5.0.0.GA 上开发基于 EJB 3.0 的应用程序,最近服务器日志中出现以下警告:
09:50:19,735 WARN [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container 09:50:19,735 WARN [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container 09:50:19,735 WARN [InterceptorRegistry] applicable interceptors is non-existent for ... ...
一旦将 EJB(无状态 session Bean)注入(inject)到我的 JSF Web 应用程序的支持 Bean 中,就会生成警告。虽然这些 bean 确实可以正常工作,但我仍然想知道该警告从何而来以及我可以采取哪些措施来避免它。
我已经搜索了一下,但还没有找到一个好的答案(有人说,bean 开发人员不必担心,但这是一个警告,所以我希望有一个更好的解决方案):
- http://www.jboss.com/index.html?module=bb&op=viewtopic&t=147292
- http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180366
- http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140136
- JBoss JIRA Issue about the warning (我认为没什么帮助)
那么有没有人解释一下导致警告的原因(就 bean 开发人员而言,而不是应用程序服务器开发人员而言)以及如何避免它?
更新:我刚刚将 JBoss 升级到 5.0.1.GA( Download 、 Release-Notes ),但不幸的是,警告仍然出现。
最佳答案
据我了解此警告的所有可用来源,JBoss 5 用户对此无能为力,本质上只是提醒 JBoss 开发人员,他们错误地使用了自己的类。
根据开发人员的建议,我现在通过更改conf/jboss-log4j.xml 中的日志配置来忽略它。我刚刚添加:
<category name="org.jboss.ejb3.interceptors">
<priority value="ERROR" />
</category>
关于JBoss:InterceptorRegistry 发出的警告 EJBTHREE-1246 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/491007/