警告:List< Bean<>>类型的参数1>来自public void org.omnifaces.cdi.eager.EagerBeansRepository.setXxx不能解析为具体类型 [英] WARNING: Parameter 1 of type List<Bean<?>> from public void org.omnifaces.cdi.eager.EagerBeansRepository.setXxx is not resolvable to a concrete type
问题描述
我使用的是Omnifaces 1.8.1,并且每当我将应用程序部署到Glassfish时,我都会收到以下警告,这会在部署过程中造成一些延迟。
警告:WELD-001519为抽象类org.omnifaces.eventlistener.DefaultHttpSessionListener创建了一个InjectionTarget实现。不可能产生这种类型的实例!
警告:WELD-001519为抽象类org.omnifaces.eventlistener.DefaultServletContextListener创建了一个InjectionTarget实现。不可能产生这种类型的实例!
警告:WELD-001519为抽象类org.omnifaces.eventlistener.DefaultServletRequestListener创建了一个InjectionTarget实现。不可能产生这种类型的实例!
警告:WELD-001519为抽象类org.omnifaces.filter.HttpFilter创建InjectionTarget实现。不可能产生这种类型的实例!
警告:已检测到以下警告:
警告:类型为java.util.List的参数1< javax.enterprise.inject.spi.Bean<?> > from public void org.omnifaces.cdi.eager.EagerBeansRepository.setApplicationScopedBeans(java.util.List< javax.enterprise.inject.spi.Bean<>>)不能解析为具体的类型。
警告:类型为java.util.Map的参数1< 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<>>> )不能解析为具体类型。
警告:类型为java.util.Map的参数1< 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<>>> )不能解析为具体类型。
警告:类型为java.util.List的参数1< javax.enterprise.inject.spi.Bean<?>> from public void org.omnifaces.cdi.eager.EagerBeansRepository.setSessionScopedBeans(java.util.List< javax.enterprise.inject.spi.Bean<>>)不能解析为具体类型。
我已经升级到Omnifaces 2.0并且仍然得到相同的警告,这在开发过程中非常烦人部署经常被应用。是什么导致这些警告?
PS:开发环境:
这些警告是无辜的,实际上并没有显着延迟部署。对于无法解析的参数警告,CDI确实不支持使用通配符参数化参数的代理方法,如 List <?>>
。然而,这些警告的烦恼却被理解了。由于这些方法无论如何都是包私有的,我已经按照这个提交能见度,以便Weld不会试图检查它们。该修补程序可在 OmniFaces 2.1 SNAPSHOT 。
至于抽象类的WELD-001519警告,这确实是完全没有必要的。这已经在Weld 2.1.1 / 2.2.0中修复了。另请参阅重复问题:WELD-001519 An InjectionTarget实现是为抽象类xxx创建的。无法生成此类型的实例。
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
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.
这篇关于警告:List< Bean<>>类型的参数1>来自public void org.omnifaces.cdi.eager.EagerBeansRepository.setXxx不能解析为具体类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!