WARNING: Parameter 1 of type List<Bean<?>> from public void org.omnifaces.cdi.eager.EagerBeansRepository.setXxx is not resolvable to a concrete type

早过忘川 提交于 2019-12-10 12:50:03

问题


I'm using Omnifaces 1.8.1 and Whenever I deploy my application to Glassfish I get the following warning which causes some delay in the deploy process.

Warning:   WELD-001519 An InjectionTarget implementation is created for an abstract class org.omnifaces.eventlistener.DefaultHttpSessionListener. 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.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.eventlistener.DefaultServletRequestListener. 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:   The following warnings have been detected: 

WARNING: Parameter 1 of type java.util.List<javax.enterprise.inject.spi.Bean<?>> from public void org.omnifaces.cdi.eager.EagerBeansRepository.setApplicationScopedBeans(java.util.List<javax.enterprise.inject.spi.Bean<?>>) is not resolvable to a concrete type.   
WARNING: Parameter 1 of type java.util.Map<java.lang.String, java.util.List<javax.enterprise.inject.spi.Bean<?>>> from public void org.omnifaces.cdi.eager.EagerBeansRepository.setRequestScopedBeansViewId(java.util.Map<java.lang.String, java.util.List<javax.enterprise.inject.spi.Bean<?>>>) is not resolvable to a concrete type.
WARNING: Parameter 1 of type java.util.Map<java.lang.String, java.util.List<javax.enterprise.inject.spi.Bean<?>>> from public void org.omnifaces.cdi.eager.EagerBeansRepository.setRequestScopedBeansRequestURI(java.util.Map<java.lang.String, java.util.List<javax.enterprise.inject.spi.Bean<?>>>) is not resolvable to a concrete type.
WARNING: Parameter 1 of type java.util.List<javax.enterprise.inject.spi.Bean<?>> from public void org.omnifaces.cdi.eager.EagerBeansRepository.setSessionScopedBeans(java.util.List<javax.enterprise.inject.spi.Bean<?>>) is not resolvable to a concrete type.

I have upgraded to Omnifaces 2.0 and still getting the same warning which is quite annoying in the development process where deployment is applied frequently. What is causing these warnings?

PS: Development environment:

  • Glassfish 4.1
  • Java 8
  • JSF 2.2.0 (Mojarra)
  • Primefaces 4.0
  • Netbeans 8

回答1:


This is Weld specific. Those warnings are innocent and actually doesn't significantly delay deploy.

As to unresolvable parameter warning, CDI indeed doesn't support proxying methods with wildcard-parameterized arguments like List<?>. The annoyance of those warnings is however understood. As those methods are package-private anyway, I've reduced as per this commit the visibility so that Weld doesn't attempt to inspect them. The fix is available in OmniFaces 2.1 SNAPSHOT.

As to WELD-001519 warning on abstract classes, this is indeed totally unnecessary. This is already fixed in Weld 2.1.1/2.2.0. See also the duplicate question: WELD-001519 An InjectionTarget implementation is created for an abstract class 'xxx'. It will not be possible to produce instances of this type.



来源:https://stackoverflow.com/questions/29249204/warning-parameter-1-of-type-listbean-from-public-void-org-omnifaces-cdi-ea

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!