【问题标题】:WELD-001519 An InjectionTarget implementation is created for an abstract class 'xxx'. It will not be possible to produce instances of this typeWELD-001519 为抽象类“xxx”创建了 InjectionTarget 实现。不可能产生这种类型的实例
【发布时间】:2013-12-20 18:24:07
【问题描述】:

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

  • GlassFish 服务器 4.0
  • Mojarra 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 在给定环境中是否有任何问题?

【问题讨论】:

    标签: jsf glassfish cdi omnifaces weld


    【解决方案1】:

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

    日志记录中的这种干扰已报告为Weld issue 1547,因此自 Weld 2.1.1 / 2.2.0 以来,警告级别已降至调试级别。

    应该注意还有另一个错误,很可能与 GlassFish 类加载有关。 OmniFaces 有一个VetoAnnotatedTypeExtension,它应该排除所有这些 OmniFaces 类,因为它们会被不必要地作为 CDI 管理的 bean 进行扫描。当在 Tomcat 7 和 JBoss 6/7/8 中使用 Weld 时,这可以正常工作。 IE。 OmniFaces 类根本不会出现这些警告。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-01-09
      • 1970-01-01
      • 2011-07-05
      • 1970-01-01
      • 2021-01-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多