WELD-001519 An InjectionTarget implementation is created for an abstract class 'xxx'. It will not be possible to produce instances of this type
Asked Answered
A

1

5

I'm running an application in the following environment.

  • GlassFish Server 4.0
  • Mojarra 2.2.4
  • PrimeFaces 4.0 final
  • PrimeFaces Extension 1.1.0
  • OmniFaces 1.6.3

After adding OmniFaces, the following warnings appear on the server terminal.

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.

Is there any problem with OmniFaces in the given environment?

Actinal answered 4/12, 2013 at 10:11 Comment(0)
M
5

Nope, those are just warnings, not errors. Weld is just not able to create injection targets for abstract classes or classes which does not have a default constructor. Injection targets need to be able to do Class.forName(className).newInstance() without any trouble.

This disturbance in logging is already reported as Weld issue 1547 and hereby the WARNING level is lowered to DEBUG level since Weld 2.1.1 / 2.2.0.

Noted should be that there's another bug, most likely related to GlassFish classloading. OmniFaces has namely a VetoAnnotatedTypeExtension which should exclude all those OmniFaces classes from unnecessarily being scanned as CDI managed beans. This works fine when Weld is used in Tomcat 7 and JBoss 6/7/8. I.e. those warnings doesn't appear at all for OmniFaces classes.

Medicament answered 4/12, 2013 at 13:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.