匹配的通配符是严格的,但找不到元素'osgi:service'的声明


<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    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"
    xmlns:osgi="http://www.springframework.org/schema/osgi">

这些是我得到的错误:

  • 匹配的通配符是严格的,但是没有为元素'osgi:service'找到声明
  • 匹配的通配符是严格的,但是没有为元素'osgi:reference'找到声明

我在第6行中将版本添加到shemaLocation中。

您可以在这里找到所有版本(第5行):http://www.springframework.org/schema/osgi

<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    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-1.2.xsd"
    xmlns:osgi="http://www.springframework.org/schema/osgi">

最新更新