我正在使用Omnifaces 1.8.1,每当我将我的应用程序部署到Glassfish时,我都会收到以下警告,这会导致部署过程出现延迟。
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.
我已经升级到Omnifaces 2.0并且仍然得到相同的警告,这在经常应用部署的开发过程中非常烦人。是什么导致了这些警告?
PS:开发环境:
答案 0 :(得分:9)
这是Weld特有的。这些警告是无辜的,实际上并没有显着延迟部署。
对于无法解析的参数警告,CDI确实不支持使用通配符参数化参数(如List<?>
)的代理方法。然而,这些警告的烦恼是可以理解的。由于这些方法都是包私有的,因此我按照this commit的可见性进行了缩减,以便Weld不会尝试检查它们。该修复程序位于OmniFaces 2.1 SNAPSHOT。
关于抽象类的WELD-001519警告,这确实是完全没必要的。这在Weld 2.1.1 / 2.2.0中已经是fixed。另请参阅重复的问题:WELD-001519 An InjectionTarget implementation is created for an abstract class 'xxx'. It will not be possible to produce instances of this type。