5

我正在以下环境中运行应用程序。

  • GlassFish 服务器 4.0
  • 莫哈拉 2.2.4
  • PrimeFaces 4.0 最终版
  • PrimeFaces 扩展 1.1.0
  • OmniFaces 1.6.3

添加 OmniFaces 后,服务器终端上会出现以下警告。

WARNING:   WELD-001519 An InjectionTarget implementation is created for an abstract class org.omnifaces.eventlistener.DefaultServletContextListener. It will not be possible to produce instances of this type!    
WARNING:   WELD-001519 An InjectionTarget implementation is created for an abstract class org.omnifaces.filter.HttpFilter. It will not be possible to produce instances of this type!

//WARNING:   Class 'javax.ejb.PostActivate' not found, interception based on it is not enabled
//WARNING:   Class 'javax.ejb.PrePassivate' not found, interception based on it is not enabled
INFO:   Initializing Mojarra 2.2.4 ( 20131003-1354 https://svn.java.net/svn/mojarra~svn/tags/2.2.4@12574) for context '/Project-war'

WARNING:   WELD-001529 An InjectionTarget implementation is created for a class org.omnifaces.application.OmniApplicationFactory which does not have any appropriate constructor.
WARNING:   WELD-001529 An InjectionTarget implementation is created for a class org.primefaces.context.PrimeFacesContextFactory which does not have any appropriate constructor.
WARNING:   WELD-001529 An InjectionTarget implementation is created for a class org.omnifaces.context.OmniPartialViewContextFactory which does not have any appropriate constructor.
WARNING:   WELD-001529 An InjectionTarget implementation is created for a class org.primefaces.context.PrimePartialViewContextFactory which does not have any appropriate constructor.

INFO:   Running on PrimeFaces 4.0
INFO:   Running on PrimeFaces Extensions null
INFO:   Using OmniFaces version null

INFO:   Loading application [Project#Project-war.war] at [Project-war]
INFO:   Project was successfully deployed in 22,734 milliseconds.

给定环境中的 OmniFaces 是否有任何问题?

4

1 回答 1

5

不,这些只是警告,而不是错误。Weld 只是无法为抽象类或没有默认构造函数的类创建注入目标。注射目标需要能够做到Class.forName(className).newInstance()没有任何麻烦。

记录中的这种干扰已报告为Weld 问题 1547,因此自 Weld 2.1.1 / 2.2.0 以来,警告级别已降低到调试级别。

应该注意的是还有另一个错误,很可能与 GlassFish 类加载有关。OmniFaces 有一个VetoAnnotatedTypeExtension应该排除所有那些 OmniFaces 类不必要地被扫描为 CDI 托管 bean。这在 Tomcat 7 和 JBoss 6/7/8 中使用 Weld 时效果很好。即这些警告根本不会出现在 OmniFaces 类中。

于 2013-12-04T13:05:18.127 回答