1. 程式人生 > >OSGI嵌入tomcat應用服務器(gem-web)——tomcat插件環境搭建

OSGI嵌入tomcat應用服務器(gem-web)——tomcat插件環境搭建

version code end har java 服務 文件 charset pat

相關的資源下載,參考:https://www.cnblogs.com/dyh004/p/10642769.html

  • 新建普通的plugin工程

技術分享圖片

技術分享圖片

技術分享圖片

  • 新建工程運行環境

技術分享圖片

技術分享圖片

技術分享圖片

在工程中,新建運行環境

技術分享圖片

技術分享圖片

新建存放運行環境的依賴包目錄

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

添加運行環境相關的依賴包

1、把OSGI嵌入tomcat應用服務器(gem-web)——t資源下載(https://www.cnblogs.com/dyh004/p/10642769.html)章節下載的the Equinox Console放入plugins目錄下

技術分享圖片

把OSGI嵌入tomcat應用服務器(gem-web)——t資源下載(https://www.cnblogs.com/dyh004/p/10642769.html)章節下載的gemini.web相關的包及依賴包,放入plugins目錄下

技術分享圖片

至此,所有相關的包都存放完畢

技術分享圖片

配置target

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

  • 新建WEB工程

技術分享圖片

技術分享圖片

技術分享圖片

配置生成相關的web文件

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

這樣,對應的web目錄結構就生成了

技術分享圖片

修改MANIFEST.MF文件

Manifest-Version: 1.0
Bundle
-ManifestVersion: 2 Bundle-Name: UMP Manager web Console Bundle-SymbolicName: com.kszsa.console Bundle-Version: 1.0.0.qualifier Bundle-Vendor: KSZSA Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-ClassPath: WEB-INF/classes Web-ContextPath: /web-console

在webapp下,新建index.html

<!
DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>首頁</title> </head> <body> 這是首頁 </body> </html>

導出對應的war,並放入com.kszsa.target工程下的server目錄下的plugins目錄

技術分享圖片

技術分享圖片

刷新下plugins,重新設置下target

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

  • 配置運行環境

技術分享圖片

技術分享圖片

運行之後,控制臺輸出

技術分享圖片

訪問界面,查看結果,地址:http://127.0.0.1:8080/web-console/index.html

技術分享圖片

至此,Gem-web環境搭建完畢。

OSGI嵌入tomcat應用服務器(gem-web)——tomcat插件環境搭建