Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » servletbridge and org.osgi.framework.system.packages.extra
servletbridge and org.osgi.framework.system.packages.extra [message #1222460] Fri, 20 December 2013 13:30 Go to next message
Ralf Sternberg is currently offline Ralf Sternberg
Messages: 1291
Registered: July 2009
Senior Member

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 #1222473 is a reply to message #1222460] Fri, 20 December 2013 14:14 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas Watson
Messages: 436
Registered: July 2009
Senior Member
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. I'm not sure why the org.osgi.framework.system.packages.extra property is not working for you. I assume you are specifying all the necessary javax.servlet packages (e.g. javax.servlet.http etc).

Would you be able to tell at runtime if the system bundle is exporting the packages you are specifying?
Re: servletbridge and org.osgi.framework.system.packages.extra [message #1228294 is a reply to message #1222473] Mon, 06 January 2014 22:27 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf Sternberg
Messages: 1291
Registered: July 2009
Senior Member

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 #1228580 is a reply to message #1228294] Tue, 07 January 2014 14:33 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas Watson
Messages: 436
Registered: July 2009
Senior Member
Ralf Sternberg wrote on Mon, 06 January 2014 16:27

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


The org.eclipse.equinox.http.servletbridge bundle imports the org.eclipse.equinox.servletbridge package which is exported by the org.eclipse.equinox.servletbridge bundle not the extensionbundle. So is the org.eclipse.equinox.servletbridge bundle not included in your config.ini and not installed?
Re: servletbridge and org.osgi.framework.system.packages.extra [message #1228642 is a reply to message #1228580] Tue, 07 January 2014 17:38 Go to previous message
Ralf Sternberg is currently offline Ralf Sternberg
Messages: 1291
Registered: July 2009
Senior Member

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
Previous Topic:Bundle-Classpath "external" Directive
Next Topic:Equinox support on Java7 and Solaris 10??
Goto Forum:
  


Current Time: Sun Oct 26 04:46:23 GMT 2014

Powered by FUDForum. Page generated in 0.01730 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software