2010-09-06 17 views
3

除了增加日誌級別之外,任何人都知道擺脫此警告的好方法?請注意,服務器中的所有內容仍按預期工作,但每次服務器重新啓動時都會發生這種情況。煩惱 - 在Spring 3.x中使用Mina 2.x時發出警告

 
o.s.b.f.c.CustomEditorConfigurer - Passing PropertyEditor instances into CustomEditorConfigurer is deprecated: use PropertyEditorRegistrars or PropertyEditor class names instead. Offending key [java.net.SocketAddress; offending editor instance: [email protected] 

Red5服務器使用的是Apache Mina 2.0和Spring 3.0.4,但從Spring 2.5開始,警告就已經出現。

+0

的警告是有原因的 - 它使用Spring的可能功能在將來的版本中刪除。 – skaffman 2010-09-06 22:23:13

+0

是的,我明白了;所以我應該說「有人知道如何解決這個問題」? – 2010-09-06 22:28:37

回答

4

我猜你可能在Spring XML文件是這樣的:

<bean class="org.springframework.beans.factory.config.CustomEditorConfigurer"> 
    <property name="customEditors"> 
     <map> 
      <entry key="java.net.SocketAddress"> 
       <bean class="org.apache.mina.integration.beans.InetSocketAddressEditor" /> 
      </entry> 
     </map> 
    </property> 
</bean> 

正如警告說,經過PropertyEditor實例爲CustomEditorConfigurer已被棄用。但是,可以使用PropertyEditor類名代替。

您可以在Javadoc for CustomEditorConfigurer中閱讀更多關於此的內容。

在你的情況下,簡單的解決方法就是使用一個類名的映射條目值,而不是InetSocketAddressEditor實例:

<bean class="org.springframework.beans.factory.config.CustomEditorConfigurer"> 
    <property name="customEditors"> 
     <map> 
      <entry key="java.net.SocketAddress" value="org.apache.mina.integration.beans.InetSocketAddressEditor" /> 
     </map> 
    </property> 
</bean> 
+0

感謝它現在已經修復! – 2010-09-07 22:50:26