gpt4 book ai didi

java - Spring 无法定位 OSGi 命名空间处理程序

转载 作者:IT老高 更新时间:2023-10-28 13:53:11 26 4
gpt4 key购买 nike

我有一个在 eclipse virgo OSGi 平台上运行的 Spring MVC 项目。当我尝试使用 <osgi:reference> 导入 OSGi 服务时标记我得到以下异常:

Servlet /Web threw load() exception org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/osgi]

这是我的应用程序上下文文件:

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">


<annotation-driven />


<resources mapping="/resources/**" location="/resources/" />


<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix" value="/WEB-INF/views/" />
<beans:property name="suffix" value=".jsp" />
</beans:bean>

<context:component-scan base-package="com.apptivit.web" />

<osgi:reference id="entityService" interface="com.apptivit.db.service.AbstractEntityService"/>
</beans:beans>

最后在我的 MANIFEST.MF 文件中,我正在这样做:

Manifest-Version: 1.0
Export-Package: com.apptivit.web;uses:="org.springframework.stereotype
,org.springframework.ui,org.springframework.web.bind.annotation"
Tool: Bundlor 1.0.0.RELEASE
Import-Package: com.apptivit.db.service,
org.apache.log4j,
org.slf4j,
org.springframework.context;version="[3.0.5.RELEASE,3.0.5.RELEASE]",
org.springframework.stereotype,
org.springframework.ui,
org.springframework.web.bind.annotation,
org.springframework.web.context,
org.springframework.web.servlet,
org.springframework.web.servlet.view
Bundle-SymbolicName: webs
Bundle-Version: 0.0.1
Bundle-Name: WebSample
Bundle-Vendor: ApptivIT
Import-Bundle: org.springframework.osgi.core;version="[1.2.1,1.2.1]",
org.springframework.beans;version="[3.0.5.RELEASE,3.0.5.RELEASE]",
org.springframework.core;version="[3.0.5.RELEASE,3.0.5.RELEASE]"

我做错了什么???

最佳答案

尝试将其更改为:

xsi:schemaLocation=
http://www.springframework.org/schema/osgi/spring-osgi.xsd"

到:

xsi:schemaLocation=
http://www.springframework.org/schema/osgi/spring-osgi-1.2.xsd

该错误表明您的osgi schemaLocation 错误。

关于java - Spring 无法定位 OSGi 命名空间处理程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10162853/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com