2012-04-15 19 views
13

Tôi có một trình hỗ trợ MVC mùa xuân chạy trên nền tảng OSGi eclipse virgo. Khi tôi cố gắng để nhập khẩu một dịch vụ OSGi sử dụng <osgi:reference> thẻ tôi nhận được ngoại lệ sau đây:Mùa xuân không thể định vị trình xử lý không gian tên 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] 

Đây là ứng dụng tập tin bối cảnh của tôi:

<?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> 

Và cuối cùng trong file MANIFEST.MF của tôi Tôi làm điều này:

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]" 

Tôi đang làm gì sai?

+3

Tôi không hiểu tại sao câu hỏi này đã bị bỏ qua ... –

+0

Tôi cũng thế. Không ai trả lời tôi và tôi vẫn không có giải pháp: ( –

+0

@HoucemBerrayana, câu hỏi đã được đăng hơn năm trước. Bạn có giải quyết được vấn đề không? Nếu có, bạn có thể chia sẻ cách bạn đã làm không? Yêu cầu NamespaceResolver cho http://www.springframework.org/schema/osgi? –

Trả lời

0

Tôi nghi ngờ rằng bạn cần nhập org.springframework.osgi.core, vì vậy hãy thử xóa việc nhập đó.

+0

Điều đó không giải quyết được vấn đề. Tôi đã gặp phải vấn đề này nhiều lần và nó luôn liên quan đến những cái lọ còn thiếu. Nhưng lần này tôi không hiểu tôi đang làm gì sai. –

0

Cố gắng thay đổi nó từ:

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

tới:

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

Các lỗi cho thấy OSGi bạn schemaLocation là sai.

Các vấn đề liên quan