servletbridge and org.osgi.framework.system.packages.extra [message #1222460] |
Fri, 20 December 2013 13:30 |
|
Hi,
I wonder if the property org.osgi.framework.system.packages.extra can be
used in a servletbridge WAR to provide javax.servlet to the OSGi
container without using the servletbridge.extensionbundle. This would
simplify WAR builds because the extensionbundle would not have to be
added to the config.
I've added the last line to WEB-INF/launch.ini:
----
osgi.*=@null
org.osgi.*=@null
eclipse.*=@null
osgi.parentClassloader=app
osgi.contextClassLoaderParent=app
org.osgi.framework.system.packages.extra=javax.servlet
----
but that doesn't work. Am I missing something or is this approach not
going to work at all?
Thanks,
Ralf
|
|
|
|
Re: servletbridge and org.osgi.framework.system.packages.extra [message #1228294 is a reply to message #1222473] |
Mon, 06 January 2014 22:27 |
|
Sorry, I've lost sight of this, but I'd like to follow-up.
On 20.12.2013 15:14, Thomas Watson wrote:
> If you don't have an extension bundle I would have expected the method
> org.eclipse.equinox.servletbridge.FrameworkLauncher.deployExtensionBundle(File)
> to create one automatically for you.
The extensionbundle is created, but unless it's listed in the
config.ini, it won't be installed. My naive idea was that if the
packages I need are specified in the packages.extra property, the
extension bundle would not be needed anymore.
The problem with the extensionbundle is that it is not added to the
config.ini/bundles.info by build tools (because they don't know about
this thing) and it has to be added manually later.
> Would you be able to tell at runtime if the system bundle is exporting
> the packages you are specifying?
I've enabled the equinox console, and indeed the system bundle exports
the extra packages. I found that I have to add explicit version numbers
to the packages.extra property to satisfy my application bundle's
imports, now it's starting. However, the servletbridge bundle doesn't
start whithout the extensionbundle because of:
osgi> start 6
gogo: BundleException: Could not resolve module:
org.eclipse.equinox.http.servletbridge [6]
Unresolved requirement: osgi.wiring.package;
filter:="(&(osgi.wiring.package=org.eclipse.equinox.servletbridge)(version>=1.0.0))"
So I guess my question comes down to: why is the extensionbundle needed
at all, and is there a way to do without?
Thanks,
Ralf
|
|
|
|
Re: servletbridge and org.osgi.framework.system.packages.extra [message #1228642 is a reply to message #1228580] |
Tue, 07 January 2014 17:38 |
|
Right, the org.eclipse.equinox.servletbridge was missing. After adding
that, all bundles are ACTIVE, but the application still doesn't work
(404, BridgeServlet: /equinox%2Dhello%2Dworld/). When I add the
servletbridge.extensionbundle to the config.ini, it works.
I used to think that the purpose of the extensionbundle was to export
servlet packages from the servlet container, but since this can be done
with the extra.packages property, it must be something different.
Could you shed some light on the magical extensionbundle? Is there a way
to use the servletbridge without it?
Thanks,
Ralf
|
|
|
|
Powered by
FUDForum. Page generated in 0.05300 seconds