WELD-001519 An InjectionTarget implementation is created for the abstract class "xxx". Unable to create instances of this type

I am running the 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 will 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. 

Are there any problems with OmniFaces in this environment?

+5
jsf omnifaces cdi weld glassfish
source share
1 answer

No, these are just warnings, not errors. Weld simply cannot create injection targets for abstract classes or classes that do not have a default constructor. The injection targets should be able to do Class.forName(className).newInstance() without any problems.

This registration violation has already been declared as Weld issue 1547 , and therefore the WARNING level is reduced to the DEBUG level, since Weld 2.1.1 / 2.2.0.

It is noted that there is another error, most likely related to loading GlassFish classes. OmniFaces has VetoAnnotatedTypeExtension , which should eliminate the need for all of these OmniFaces classes to be scanned as CDI managed beans. This works great when Weld is used in Tomcat 7 and JBoss 6/7/8. That is, these warnings do not appear at all for OmniFaces classes.

+5
source share

All Articles