【问题标题】:IntelliJ is complaining about OSGi reference attributeIntelliJ 抱怨 OSGi 引用属性
【发布时间】:2012-08-30 09:59:16
【问题描述】:

我的spring-context.xml 配置文件中有一个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"

以及架构位置:

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

来自SpringOSGidocumentation

&lt;osgi:reference&gt; 元素用于定义充当 OSGi 服务(或服务集)代理的本地 bean。唯一需要的 属性是 id(定义本地 bean 的名称)和 接口(定义接口的全限定名 目标服务注册在)。

所以我看到 id 是必需的,但为什么 IntelliJ 抱怨它?

【问题讨论】:

  • 我花了几个小时试图找出同样的问题,但失败了。我怀疑这是一个 IDEA 错误,现在我忽略了它。
  • 可以禁用检查(知道是哪一个吗?)以抑制这些错误?

标签: java spring intellij-idea osgi


【解决方案1】:

我已经在JetBrains Tracker创建了这个错误的票

【讨论】:

    【解决方案2】:

    我注意到 osgi xsd 可以

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

    对我来说,他们找不到。但是,即使您设置了它们,它似乎也不起作用。

    您可能需要在 http://youtrack.jetbrains.com/issues/IDEA 提交 IntelliJ 错误报告。

    【讨论】:

      【解决方案3】:

      也许你需要限定 id 属性:xml:id?

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-04-08
        • 2017-05-20
        • 2020-05-02
        • 1970-01-01
        • 1970-01-01
        • 2018-08-03
        • 2019-10-22
        • 1970-01-01
        相关资源
        最近更新 更多