Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 249
Tiny Avatar asked Dec 04 '13 10:12

Tiny


1 Answers

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.

like image 129
BalusC Avatar answered Nov 07 '22 07:11

BalusC