Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EclipseLink/Development/DBWS/OSGi/AdvCustIJetty

< EclipseLink‎ | Development‎ | DBWS‎ | OSGi
Revision as of 10:26, 7 October 2010 by Michael.norman.oracle.com (Talk | contribs) (New page: <css> .source-java5 {padding:1em;border:1px solid black; background-color: white;} .source-xml {padding:1em;border:1px solid black; background-color: white;} .source-text {padding:1e...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Advanced Customization - Part I: Jetty

The above example relies on the built-in JavaSE HTTP server (com.sun.net.httpserver.HttpServer) which has some known issues (6675392, 6946825). A user may wish to 'swap-in' a different HTTP Server, such as Jetty, which can be added to the PDE Target Platform from the Helios P2 Update Repository:

EclipseLink DBWS with OSGi in PDE.png

Open the Manifest Editor and add the following to the Required Plug-ins list of dependencies:

org.eclipse.jetty.continuation
org.eclipse.jetty.http
org.eclipse.jetty.io
org.eclipse.jetty.server
org.eclipse.jetty.util

There is a system property to override the built-in JavaSE HTTP server class:

-Dcom.sun.net.httpserver.HttpServerProvider=org.eclipse.jetty.jaxws2spi.JettyHttpServerProvider

{NB - the SPI used to load the new HttpServerProvider class is not OSGi-friendly; a revised version of com.sun.net.httpserver.spi.HttpServerProvider can be found here}

The new HttpServerProvider can be found in maven .../org/mortbay/jetty/jetty-jaxws2spi/7.0.1.v20091125 in the package org.eclipse.jetty.jaxws2spi

prompt> ls
JAXWS2ContextHandler.java  JettyHttpServer.java
JettyHttpContext.java      JettyHttpServerProvider.java
JettyHttpExchange.java     ThreadPoolExecutorAdapter.java

Once the above classes are added to the project and the required configuration changes are done, the existing code in simpletable.Activator will run - using Jetty - without modification.
EclipseLink DBWS with OSGi SimpleTable with Jetty running.png

Back to the top