为什么 STS 无法识别 OSGI 元素



The xml:

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:osgi="http://www.springframework.org/schema/osgi"
       xsi:schemaLocation="
         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
         http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
    <bean id="demoBean"
          class="org.spring.demo.DemoBean">
    </bean>
    <osgi:service ref="demoBean" interface="org.spring.demo.DemoInterface"></osgi:service>
</beans>

SpringExplorer列出了"demoBean"节点,但没有列出"osgi:service"的元素。应该安装其他 Spring Eclipse 插件吗?

实际上,这看起来有点像我最近在 STS 中修复的错误:https://jira.spring.io/browse/INT-3674

因此,可能值得尝试从夜间更新站点更新您的 STS。

也可能是

  • STS 中的另一个错误导致它错过实际存在的豆子
  • Bean 定义或模式出现问题,导致 Bean 未正确定义。

您可以尝试区分这两种情况,方法是确保您认为应该存在的 bean 在实例化应用程序上下文时在运行时确实存在。

如果 bean 确实存在并且没有出现在 STS 模型中,那么我认为这是 STS 中的一个错误,您应该考虑提交错误报告。否则就是另一个问题。

最新更新