How to package ordinary jar files into osgi bundles

 

List of recent updates

1. Install jdk in IBM's aix (updated on July 21)
2. Install jdk in Linux (CentOS) (updated on July 21)
3. Install weblogic in Linux (CentOS) (updated on July 22)
4. Install webLogic in Aix system (Updated on July 22) 5.
Create a weblogic domain in IBM physical machine aix (updated on July 23 )
6. Create a weblogic domain through VNC in linux (updated on July 23)
7. Install Oracle 10g under RedHat 5 in detail (July 23 ) 24 update) 8. Linux starts oracle instance (July 24 update) 9. Create oracle instance and network monitoring through VNC in linux (July 25 update) 10. The method of closing ip6 in linux (July 25 update) 11. Jconsole , jvisualvm tool introduction 12. Soupui calls webservies help document 13. Loadrunner calls Webservice interface test optimization14. Loadrunner script reads XMl files 15. Remote Aix system using Xmanager 16. Xmanager graphical remote to aix system 17. Package common jar files The method of becoming an osgi bundle18. Code inspection specification Checkstyle configuration19. Webloigc 11g configuration cluster help document20. Activemq cluster configuration document













21. Apache2.2+tomcat6 cluster configuration
22. Modify the computer name to cause the oracle instance to fail to start the solution
23. Import the configuration required by the virtual machine with the oracle installer
24. Set the title for the tomcat and weblogic startup windows
25. Tomcat configuration Download server
26. Enable virtual machine hyper-v function under win8

27. windows, linux, aix query which program the port number is occupied by

28. Recursively change directory permissions under linux

29. Apache configuration virtual directory

 

For the osgi project, the class is exported or imported through export and import to provide external access or access to the outside world, so it cannot be directly referenced by importing and exporting jar , but only the MANIFest.Mf file can be modified .

 

1.       The method of packaging ordinary jar files into osgi bundles . Summaryoperations: #Open eclipse #Click "new project #Select to build" plug -in from Existing Jar Archives under plug-in Development #Define the name of the plug-in , that is, the project name

 

 

2. Select the jar file to be converted

 

 

 

 

3. Use the rar file to find MANIFEST.MF to view   1 as the version number and   2 as the name of the project

 

 

 

 

 

 

4. Fill in the corresponding project name and version number, click FINSH to complete

 

 

 

 

 

 

5. The osgi project javax.persistence has been generated in Eclipse

 

 

 

 

6. Export the javax.persisetence project to the osgi version of the jar

 

 

7.默认会成到plugin文件夹里面

 

 

 

 

 

 

 

 

 

 

 

 

8.plugin文件中的javax.persistence_1.0.0.jar复制到bridge目录

 

 

9.windows-preferences中查看target目录并编辑

 

 

 

 

10.查看javax.persistenceJar文件已经添加平台并选上

 

 

11.配置osgi启动的bundle 在运行 Run Configurations中配置

 

 

 

 

12配置osgi新增的javax.persistence选中

 

 

13.在项目的MANIFEST.MFàDependencies-add中添加bundle

 

 

 

 

14查看MAINFEST.MF已添加成功

 

 

15.工程中已经可以查看到Plug-in Dependencies的依赖

 

 

16.查看工程中已经能够引用javax.persistence的注解

 

 

 

针对osgi项目是通exportimport来导出或者引入类的提供给外部访问或者访问外部,因此不能直接通过导入导出jar来引用,只能修改MANIFest.Mf文件。

 

1.       将普通jar文件打包成osgi bundle的方法总结操作: # 打开eclipse # 点击》new project # 选择建立》plug-in Development 下的plug-in from Existing Jar Archives # 定义插件名称即project name

 

 

2.选择需要转化的jar文件

 

 

 

 

3.rar文件找到MANIFEST.MF 查看  1为版本号  2为项目的名称

 

 

 

 

 

 

4.填写对应的项目名称和版本号,点FINSH完成

 

 

 

 

 

 

5.Eclipse中已经生成osgi的项目javax.persistence

 

 

 

 

6.javax.persisetence项目exportosgi版本的jar

 

 

7.默认会成到plugin文件夹里面

 

 

 

 

 

 

 

 

 

 

 

 

8.plugin文件中的javax.persistence_1.0.0.jar复制到bridge目录

 

 

9.windows-preferences中查看target目录并编辑

 

 

 

 

10.查看javax.persistenceJar文件已经添加平台并选上

 

 

11.配置osgi启动的bundle 在运行 Run Configurations中配置

 

 

 

 

12配置osgi新增的javax.persistence选中

 

 

13.在项目的MANIFEST.MFàDependencies-add中添加bundle

 

 

 

 

14查看MAINFEST.MF已添加成功

 

 

15.工程中已经可以查看到Plug-in Dependencies的依赖

 

 

16.查看工程中已经能够引用javax.persistence的注解

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326497000&siteId=291194637