java - Running a jar included in an OSGi bundle -


The situation is that I need to package an runable jar, X.jar in the OSGI bundle. Jars themselves can not be modified and OSGi is mandatory because X.jar is distributed and run through a software program, which requires OSGI bundles. The application contained in X.jar is to communicate over the network with another application.

My plan was to create an OSGI bundle with Eclipse and after that it was included X.jar. But the problem is that X.jar does not know if I try to use a copy of X.jar on my file system instead, it works. My bundle file structure:

  - \ MyBundle - \ META-INF - MANIFEST.MF - \ src - \ mybundle - \ Activator.class - \ X.jar  

Activate:

  Public Zero Start (Bundle Content Reference) {Thread XThread = New Thread () {public void run () {tryout.getRuntime () Exec ("Java-George X."); } Grip (IOException E) {// TODO Auto-Generated Catch Block e.printStackTrace (); }}}; }  

manifest.mf

  manifest-version: 1.0 bundle-manifestwarson: 2 bundle-name: bundle bundle-icon: myBundle-bundle-Version : 1.0 .0.qualifier bundle-actuator: com.ericsson.mas.Activator bundle-classpath:., X.jar bundle-vendor: BundleWonder Bundle-Required Execution Environment: Java-7.7 Import-Package: org.osgi. Framework; Version = "1.30"  

I suspect there is a problem with my bundle-classpath, but when I search around it sounds right.

Note: I know that it goes completely against OSG's philosophy.

If you want to run it as an external Java process, The jar must be pointed out and removed from the jar. Your storage is a great place to remove the bundle. By adding a jar on the square path only helps when you want to load the classes directly into your activator.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -