|Re: No classes from WEB-INF/classes returned by Bundle.getEntryPaths [message #698958 is a reply to message #698536]
||Wed, 20 July 2011 14:45
| Kaloyan Raev
Registered: July 2009
Location: Sofia, Bulgaria
Hi Sahoo, |
It's correct that the bundle root of a WAB is the WebContent folder - in your case:
Then you should have a look at the MANIFEST.MF - you should have something like:
This is the bundle classpath relative to the bundle root. So, in your case the effective classpath will be:
Now, the tricky part. The above will work if you export the WAB to JAR and deploy it on your OSGi framework - in your case Glassfish. When exporting the WAB to JAR, PDE will look into build.properties and will export all Java classes to that WEB-INF/classes in the result JAR.
If you install the WAB by reference directly from the Eclipse workspace to Glassfish (as far as I can see this is your use case), avoiding intermediate export to JAR, then you need a small trick. While you WAB is still in the Eclipse workspace the compiled Java classes are not in
So, when you install the bundles from the Eclipse workspace to Glassfish you need to add ../build/classes to the bundle's classpath. Equinox provide such a feature by using the so called dev.properties file.
The only reference I know for how to use dev.properties is here: http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html.
However, it's not a rocket science. The Glassfish Server Adapter needs to generate the dev.properties file, which content in your case should look like:
and then pass it as option (-dev) when launching Equinox.
Please, note that this feature is specific to Equinox. I hope Glassfish uses Equinox as OSGi framework. Of course, this approach also assumes that you can request the change in the Glassfish Server Adapter - the one that launches Glassfish from the Eclipse IDE.
Give it a try. If you need further help, let us know.
[Updated on: Wed, 20 July 2011 14:46]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01625 seconds