Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Eqinox HttpService only supports servlet 2.1 specification.
Eqinox HttpService only supports servlet 2.1 specification. [message #889880] Wed, 20 June 2012 03:09 Go to next message
Eric Bovic is currently offline Eric Bovic
Messages: 1
Registered: June 2012
Junior Member
Hello

I'm trying to run a VaadionAddon called "dontpush-ozonelayer" vaadin.com/directory#addon/dontpush-ozonelayer on Equinox.

In the BundleActivator class the Servlet is registered on HttpService; here some code:

Hashtable<String, String> param = new Hashtable<String, String>();
param.put("description", "Vaadin application class to start");
param.put("application", "myapp.DontpushApplication");

ServiceReference sRef = context.getServiceReference(HttpService.class.getName());
if (sRef != null) {
HttpService service = (HttpService) context.getService(sRef);
service.registerServlet("/*", new DontPushOzoneServlet(), param, null);
}

then i get this Exception:

Caused by: java.lang.UnsupportedOperationException:
HttpService only supports servlet 2.1 specification.
at org.eclipse.equinox.http.servlet.ServletContextImpl.getInitParameterNames(ServletContextImpl.java:422)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.init(AbstractApplicationServlet.java:228)
at com.vaadin.terminal.gwt.server.ApplicationServlet.init(ApplicationServlet.java:54)
at org.vaadin.dontpush.server.DontPushOzoneServlet.init(DontPushOzoneServlet.java:55)
at org.eclipse.equinox.http.HttpListener.registerServlet(HttpListener.java:333)
... 17 more


I use this HttpService Implementation:
org.eclipse.equinox.http_1.0.500.v20110413.jar

When i try to start Equinox whithout this lib, and try to use the jetty-http-8.1.4.v20120524.jar
ServiceReference sRef = context.getServiceReference(HttpService.class.getName()); returns null

HttpService is org.osgi.service.http from org.osgi.compendium-4.2.0

Does anyone have an idea for this Problem?
I am grateful for any help.

Thanks

Re: Eqinox HttpService only supports servlet 2.1 specification. [message #890437 is a reply to message #889880] Fri, 22 June 2012 05:47 Go to previous message
Libor Jelinek is currently offline Libor Jelinek
Messages: 143
Registered: January 2012
Location: Prague, Czech Rep.
Senior Member

Unfortunately, OSGi specification itself requires servlet 2.1 only. From
your equinox.http.*.jar version I assume you have Equinox shipped with
Eclipse 3.7 Indigo. This version support only 2.1 or 2.5 if you use
Jetty-backed version (but it uses not supported too old version of Jetty
so I've never used it).

Me personally, I had to just deal with it. And rewrite my servlet app to
use 2.1 API only.

However, there are project trying to overcome this like Pax Web. Again,
I've never use it.

New Equinox 3.8 that is in release-candidate testing will offer servlet
3.0 backed by Jetty 8.

Libor

On 06/20/2012 09:09 AM, Eric Bovic wrote:
> Hello
>
> I'm trying to run a VaadionAddon called "dontpush-ozonelayer"
> vaadin.com/directory#addon/dontpush-ozonelayer on Equinox.
>
> In the BundleActivator class the Servlet is registered on HttpService;
> here some code:
>
> Hashtable<String, String> param = new Hashtable<String, String>();
> param.put("description", "Vaadin application class to start");
> param.put("application", "myapp.DontpushApplication");
>
> ServiceReference sRef =
> context.getServiceReference(HttpService.class.getName());
> if (sRef != null) {
> HttpService service = (HttpService) context.getService(sRef);
> service.registerServlet("/*", new DontPushOzoneServlet(), param, null);
> }
>
> then i get this Exception:
>
> Caused by: java.lang.UnsupportedOperationException: HttpService only
> supports servlet 2.1 specification.
> at
> org.eclipse.equinox.http.servlet.ServletContextImpl.getInitParameterNames(ServletContextImpl.java:422)
>
> at
> com.vaadin.terminal.gwt.server.AbstractApplicationServlet.init(AbstractApplicationServlet.java:228)
>
> at
> com.vaadin.terminal.gwt.server.ApplicationServlet.init(ApplicationServlet.java:54)
>
> at
> org.vaadin.dontpush.server.DontPushOzoneServlet.init(DontPushOzoneServlet.java:55)
>
> at
> org.eclipse.equinox.http.HttpListener.registerServlet(HttpListener.java:333)
>
> ... 17 more
>
>
> I use this HttpService Implementation:
> org.eclipse.equinox.http_1.0.500.v20110413.jar
>
> When i try to start Equinox whithout this lib, and try to use the
> jetty-http-8.1.4.v20120524.jar ServiceReference sRef =
> context.getServiceReference(HttpService.class.getName()); returns null
>
> HttpService is org.osgi.service.http from org.osgi.compendium-4.2.0
>
> Does anyone have an idea for this Problem?
> I am grateful for any help.
>
> Thanks
>
>
Previous Topic:Ant based P2 Metadata generation still supported?
Next Topic:multiple Splash in a single bundle, is it possible ?
Goto Forum:
  


Current Time: Sat Apr 19 00:23:17 EDT 2014

Powered by FUDForum. Page generated in 0.02313 seconds