I'm running an application in the following environment.
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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With