2015-03-25 36 views
7

我正在使用Omnifaces 1.8.1,並且每當我將應用程序部署到Glassfish I得到以下警告,這會在部署過程中造成一些延遲。警告:來自public void org.omnifaces.cdi.eager.EagerBeansRepository.setXxx的List <Bean<?>>類型的參數1無法解析爲具體類型

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:開發環境:

  • Glassfish的4.1
  • 的Java 8
  • JSF 2.2.0(鑽嘴魚科)
  • Primefaces 4.0
  • Netbeans的8

回答

8

這是焊接具體。這些警告是無辜的,實際上並沒有顯着延遲部署。對於無法解析的參數警告,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

+0

謝謝!這很有幫助。 – fareed 2015-03-25 12:57:22

+0

不客氣。 – BalusC 2015-03-26 11:03:55

相關問題