2012-08-30 54 views
5

我在我的spring-context.xml配置文件中有一個OSGi參考。當我指定:IntelliJ抱怨OSGi參考屬性

<osgi:reference id="cxfInboundLoggingInterceptor" interface="com.groupgti.esb.cxf.interceptors.MessageLoggerInbound" /> 

IntelliJ說:Attribute id is not allowed here。我osgi前綴指向這個模式:xmlns:osgi="http://www.springframework.org/schema/osgi"

和Schema位置:

http://www.springframework.org/schema/osgi     http://www.springframework.org/schema/osgi/spring-osgi.xsd 

SpringOSGidocumentation

<osgi:reference>元素用於定義一個本地bean充當一個OSGi服務(或一組服務)的代理。唯一需要的 屬性是id(它定義了本地bean的名稱)和 接口(它定義了目標服務在其下注冊的接口 的全限定名稱)。

所以我看到這個ID是必需的,但爲什麼IntelliJ是抱怨呢?

+0

我花了幾個小時,試圖找出同樣的問題,但沒有成功。我懷疑這是一個IDEA錯誤,現在我忽略它。 –

+0

是否可以禁止檢查(任何想法是哪一個?)來抑制這些錯誤? – vikingsteve

回答

0

我注意到,OSGi的XSD確實

<xsd:import namespace="http://www.springframework.org/schema/beans"/> 
<xsd:import namespace="http://www.springframework.org/schema/tool"/> 

和我,他們都沒有發現。但即使你設置它,它似乎並沒有工作。

您可能需要爲提交IntelliJ錯誤報告。

0

也許你需要限定id屬性:xml:id?