我們有一個需要彈簧和休眠功能的OSGi項目。我嘗試將它們分別添加爲捆綁包,但它們在運行時環境中不可見。以下是我們項目的屏幕截圖(更好的圖片http://i.stack.imgur.com/d6gV9.png)。在圖片中,插件以spring開頭,hibernate包含jar,並將它們添加到所需包中的導入包中。我也附上了一個樣本清單。任何幫助表示讚賞。我總是獲得春季班的classnotfoundexceptions。如何將Spring和Hibernate jar添加到OSGi項目中?
我使用eclipse的create plugin來創建jar包。在嚮導中,我選擇了它們作爲標準的OSGi插件(不確定這是否是正確的方式)。我正在通過IBM RAD(Aries)構建項目。
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: org.xxx.scar.web1
Bundle-SymbolicName: org.xxx.scar.web1
Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: WEB-INF/classes
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Web-ContextPath: /org.frb.scar.web1
Import-Package: javax.el;version="2.0";resolution:=optional,
javax.faces,
javax.faces.application,
javax.faces.component,
javax.faces.component.html,
javax.faces.context,
javax.faces.convert,
javax.faces.el,
javax.faces.event,
javax.faces.lifecycle,
javax.faces.model,
javax.faces.render,
javax.faces.validator,
javax.faces.webapp,
javax.servlet;version="2.5",
javax.servlet.annotation;resolution:=optional,
javax.servlet.http;version="2.5",
javax.servlet.jsp;version="2.0",
javax.servlet.jsp.el;version="2.0",
javax.servlet.jsp.tagext;version="2.0",
org.frb.scar.entity,
org.frb.scar.manager,
org.frb.scar.services,
org.frb.scar.utils,
org.springframework.beans,
org.springframework.beans.annotation,
org.springframework.beans.factory,
org.springframework.beans.factory.access,
org.springframework.beans.factory.access.el,
org.springframework.beans.factory.annotation,
org.springframework.beans.factory.config,
org.springframework.beans.factory.parsing,
org.springframework.beans.factory.serviceloader,
org.springframework.beans.factory.support,
org.springframework.beans.factory.wiring,
org.springframework.beans.factory.xml,
org.springframework.beans.propertyeditors,
org.springframework.beans.support
多春瓶,直到網絡。
錯誤
- 拋出java.lang.ClassNotFoundException:org.springframework.web.context.request.RequestContextListener
- 拋出java.lang.ClassNotFoundException:org.springframework.web.context.ContextLoaderListener 和很多....
謝謝, 巴布。
進口只是一個樣本,因爲名單太大,我沒有把整個事情。我在導入中包含所有Spring Web包。當我在清單的動態Web項目部分添加Web項目時,一切正常。但是,當Web項目被添加爲Web捆綁包時,問題就會出現。由於OSGi在運行期間查找庫,不確定如何使它們可見。 – Bab
「當我在清單的動態Web項目部分中添加Web項目時」<<什麼意思? –
我正在IBM RAD中構建這個項目。該句與OSGi應用程序的清單控制檯相關。請原諒我的解釋方式。 – Bab