This should be really simple. HelpGUI is a really simple library: HelpGUI
In a test application that uses none of the OSGI framework, I can load up the demo that is included in this tiny library with no trouble. When I try to do it in my OSGI bundle I cannot get the InputStream to open. It must be because I am not including resources to my bundle correctly, I am not sure how though. I am able to construct a URL object and get the correct path to files. I have the /docs/help/ folder in the same level as the src folder in my bundle, shouldn’t I be able to just call:
MainFrame mainFrame = new MainFrame("/docs/help/", "plastic");
and have it work? Why is OSGI making this so difficult? Can someone try downloading the library and getting the demo to pop up the help window in an OSGI bundle?
I’ve tried it, and did not run into any complications, I’ve made a git repo with both an OSGi version and a non-OSGi version, and both run fine:
https://github.com/flyaruu/demo-helpgui
They both have an eclipse launch file, and you can run them from the run menu.
The only tricky thing I needed to do was having to add this switch: –launcher.secondThread but that is an Eclipse SWT/Swing issue on MacOS only, I don’t know what platform you use.
Also, maybe tricky, Eclipse doesn’t force you to add dependencies to javax.* packages, which you really should do, otherwise standalone OSGi frameworks won’t load the bundle, even though Eclipse itself does.
You can export the bundle using PDE export (Export -> Bundles and Fragments), I’ve also included it (helpgui-osgi_1.0.0.201207310536.jar) in the git repo. The included bundle you can just drop into the ‘bundle’ folder of Felix, for example.
Can’t make it any easier 😉