Category: General

  • Roadmap for Jetty-6, Jetty-7 and Jetty-8

    This blog updates the roadmap for jetty-6, jetty-7 and jetty-8 with the
    latest plans resulting from the move to the Eclipse Foundation and the
    delay in the servlet-3.0 specification. Previously it was intended that jetty-7 was going to be servlet-3.0, but with the move to eclipse and with the delay of JSR-315, it was decided to delay servlet 3.0 to Jetty-8 later in this year.  Thus the current active branches of jetty are:

    Jetty-6 @ codehaus & mortbay

    The current stable branch is jetty-6 for servlet-2.5 and java-1.4 (some modules are 1.5).  It is in the org.mortbay.* package space and is licensed under the apache 2.0 license.   However, it is now mostly in maintenance mode and new features will not be added to jetty-6 unless there is compelling reasons to do so.  It includes support for both HTTP server and client and comes bundled with a cometd server.
    Jetty-6 is the release for established, production-ready projects.

    Jetty-7 @ eclipse

    The current development branch is jetty-7 for servlet-2.5 and java-1.5.  It is in the org.eclipse.jetty.* package space and is licensed under both the apache 2.0 and eclipse 1.0 licenses and may be distributed under the terms of either license.  Jetty-7 represents a moderate refactor of the jetty code base:

    • Moved to the org.eclipse.jetty packages
    • Remodularized so that dependencies for client, server and servlet container are more separable
    • Updated architecture to anticipate the needs of servlet-3.0
    • Support for some servlet-3.0 features, including
      • asynchronous servlets (updated continuations)
      • web-fragment.xml
      • META-INF/resource static content in jars
    • Improved OSGi integration and availability of OSGi bundles as well as maven artefacts

    The intent of jetty-7 is to allow users to transition to the updated architecture and to access some servlet-3.0 features, within a servlet 2.5 container and without the need to update java 1.6 or to wait for the final specification later this year.  There are milestone builds of jetty-7 available already and we hope to have an official eclipse release in the next month or two.
    The cometd client and server are now in the cometd.org project and are built against jetty-7. Some jetty integrations (eg jetty-maven-plugin, terracotta,
    wadi, etc) and distributions (eg. deb, rpm, hightide) will remain at
    codehaus and are now built from codehaus trunk.
    Jetty-7 is the release for projects starting development now.

    Jetty-8 @ eclipse

    The current experimental branch is jetty-8 for servlet-3.0 and java-1.6. It is in the org.eclipse.jetty.* package space and is licensed under both the apache 2.0 and eclipse 1.0 licenses and may be distributed under the terms of either license. Jetty-8 is being kept in lock-step with jetty-7 as much as possible, so that it represents essentially the same server, but rebuilt with java-1.6 and using the standard servlet-3.0 to access the features already available in jetty-7.
    Jetty-8 is the branch for people who wish to experiment with the emerging APIs now.

    Webtide @ JavaOne

    If you want more information about what exactly are these jetty and servlet-3.0 features, why not come to JavaOne 2009?! Webtide will be have a small booth in the expo (where you will mostly find me) and Sun have invited me to participate in their technical
    session on Servlet 3.0 at JavaOne, together with Rajiv Mordani and Jan
    Leuhe.  I’ll be presenting a section on the Asynchronous Servlets API
    and giving a demonstration that uses some ease-of-deployment features
    to deploy a webapp on glassfish using the Jetty asynchronous HTTP
    client  in a 3.0 asynchronous servlet. The session is TS-3790Java

  • Bidirectional Web Transfer Protocol – BWTP

    I really like the idea behind the HTML5 Websocket API – namely that a datagram model should be used for web application communication rather than a request/response paradigm (this is also the idea behind cometd).  But unfortunately, the proposed protocol to carry websocket traffic is neither a good protocol nor is it well specified.
    After failing in an attempt to get the WebSocket protocol improved, I decided to try to define a better solution.  I had intended to work privately on this for a while, but the twittersphere has pointed out an early draft, so I’ve put the work-in-progress on http://bwtp.wikidot.com and I invite review, feedback and collaborators.
    So what’s so bad about the Websocket protocol proposal? The main things I dislike are that the document is impenetrable, the protocol inflexible and it is entirely different from other IETF application protocols for no good reason. But rather than throw (more)mud, I’d rather sing the praises of the approach that I have taken:

    • The BTWP protocol is very much an IETF style application protocol.  In fact it is just RFC2616 with anything non bidirectional ripped out. It is not trying to be a revolution in web protocols, but simply to solve the problems at hand, without discarding decades of protocol experience. 
    • The protocol document is written very much in IETF style. In fact it is just RFC2616 with anything non bidirectional ripped out.   BNF is used to specify the protocol and unlike the WebSocket proposal there are no binary blobs or algorithmic specifications.
    • The principal of “be strict in what you generate and forgiving in what your parse” is adhered to.
    • Because of it’s similarity to HTTP, it is intended that existing HTTP clients, servers and intermediaries will be able to be minimally updated to support this protocol. This will not require entirely new protocol libraries to be developed.
    • Existing development and analysis tools will also be able to be easily updated, plus the protocol is mostly human readable.
    • It supports full mime encapsulated payloads, so non text payload and/or compressed payloads can be sent without the need for clent and server to make assumptions with regards to content.
    • It has a default meta data mechanism, so that it can have detail per message meta data, but not at the expense of the redundent inforamation sent in normal HTTP.
    • The minimal overhead per message is 11 bytes, which is a little more than the websocket proposal, but is hardly significant.
    • There is no formal channel mechanism like BEEP has, but each message may be to/from a different URI if need be.  This makes multiplexing easy to support.
    • There is no formal segmentation mechanism, but Content-Ranges are supported so that large content can be sent in smaller bits if desired.
    • The protocol recognizes that intermediaries (proxies) may wish to be an active party on a bi direction connection. For example, this proposal allows an intermediary to initiate and orderly lossless close of the connection. I’m sure innovative proxy applications will be developed over time, just as they have been for HTTP.
    • BWTP well supports the current HTML WebSocket API but is also flexible and extensible so that non browser clients may use it and future APIs will not need protocol changes.

    If you are interested, I encourage you to join the IETF Hybi mailing list and to join the discussion ragarding the bidirectional web.
     
     
     
     

  • Google Wave – A new paradigm?

    The announcement of Google Wave is a bold declaration of where Google sees the future of the web. Google, unsurprisingly enough, sees the future of the web as a server side paradigm, with dynamic updates being used to drive the thin client model to capture even more of tasks that where once done client side.  Google are extending the server side model of webmail to apply to applications that have been fundamentally client side, such as document authoring, IM and chat.

    Some have said that Wave’s use of XMPP represents the death of HTTP, but I think they’ve got the wrong end of the banana! Wave is using XMPP to federate servers together, not clients.  When it comes to client/server communications, Wave is using GWT over good old HTTP, with some push extensions so that a client can get a dynamic view onto a Wave document, which is a fundamentally server side entity.  If anything, Wave has declared that HTTP is king and a near immortal one at that.

    Google’s use of XMPP is roughly equivalent to the existing use of SMTP between mail servers. Instead of passing mail documents between servers using a store and forward model, Wave has the servers dynamically collaborating to maintain a live Wave document that contains content, style, history, permissions and private content. The protocols that Wave might put on the endangered species list are SMTP, POP and IMAP (but have any protocols gone extinct? Has a gopher been sighted in the wild recently or only in captivity?).

    If Wave is successful (and it certainly looks pretty compelling), then more traditionally client side state is going to be captured on the server side.  This is a great model for google, as it lets them use their massive serverside databases to power their serverside robots like spelly and rosey, which access the vast databases of Google to do contextual spell checking and translation. You will never get such robots running client side and it is services like these that makes Google confident that they can offer better wave servers than anybody else – hence they do not fear opening up their Wave servers to competition.   So Googles’ webmail competitors had better start thinking of compelling reasons that people will want to host their waves on non-Google servers.

    Of course for Jetty, Google Wave is just a brilliant story.  To implement a Wave server, you will need a flexible, performant web server that can well support dynamic push content and will affordably scale into your wave clouds (should they be called oceans rather than clouds now?)  Jetty is the ideal Wave server!  In fact because Wave uses GWT, Google AppEngine and links to shindig, it is already based on and/or using the Google services that are based on or use Jetty. 

    For our other key project, cometd.org, the picture is a little less clear.  Google Wave does it’s own comet implementation based on long polling using GWT RPC. But Wave reinforces that comet is now a core web paradigm. Any alternative implementations of Wave that do not use the google GWT code base, would do well to look to cometd.org as a core technology.

     

  • Webtide/Jetty gathering at JavaOne

    For SnoracleZero (aka Java One) this year, we are planning a social get together of Jetty users and Webtide clients  8pm Tuesday (June 2).

    If you’d like to come along, email javaone@webtide.com and we’ll pick a venue depending on the estimated numbers.  See you there!

     

  • Servlet 3.0 Proposed "Final" Draft

    In my December 2008 blog, I strongly criticised the Servlet 3.0 JSR-315 process and the resulting Public Review Draft, describing it as a: “poor document and the product of a discordant expert group (EG) working within a flawed process” and of producing a “Frankenstein monster, cobbled together from eviscerated good ideas and misguided best intentions.
    Perhaps because of these harsh words (or more probably in spite of them), JSR-315 has become
    significantly less discordant and some good technical progress has been
    made.  While I remain somewhat concerned about the  process (Eg we have a Proposed Final Draft while some significant issues have yet to
    be resolved and/or prototyped), I’d like to focus on the improved
    spirit of the group and highlight some of the technical achievements that have
    resulted.

    Asychronous Servlets

    JSR-315 has made significant progress on asynchronous servlets. The proposal, identified in my update on the Public Review Draft,
    to define a specific dispatch type for async requests has been adopted
    and that has resulted in a very workable asynchronous servlet proposal.
    Once asynchronous dispatches were separated from normal dispatches,
    this made irelevent most of the differing opinions about how filters
    should apply and if forward semantics should apply. As a result the
    methods previously named AsyncContext.forward(…) have now been renamed to AsyncContext.dispatch(…) and there is general agreement and support of the different asynchronous style of  usage possible with this API.
    While
    I think the final async proposal is far from perfect and perhaps over
    complex, I don’t think any of the proposals (including my own) could
    perfectly retrofit asynchronous behaviour to the servlet spec. The
    benefit of the complexity is that the proposal well supports multiple
    asynchronous paradigms and usage styles.  Most of my prior complaints
    were more about specific usage styles and are thus not so important if
    multiple styles are well supported.
    Without a single imposed asynchronous model and
    there will be significant
    opportunity for frameworks to inovate in providing various asynchronous
    models to the developer community. To this end, the Jetty continuation
    style of jetty-6 has been updated in jetty-7 with ideas from
    servlet-3.0 and should now be seen as a framework that builds upon the
    servlet 3.0 capabilities.

    Annotations and pluggability

    Some of the key new features of servlet 3.0 is the increased support for ease of deployment with new ways to discovery, configure and deploy Filters and Servlets:

    • Annotated filters and servlets may be deployed without the need for a web.xml entry.
    • Jars may contain /META-INF/web-fragment.xml
      files with a subset of web.xml configuration.
    • Programmatic
      configuration of Filters and Servlets from ServletContextListeners, which are potentially discovered in /META-INF/*.tld files within jars.

    Since the Public Review Draft, an additional feature has been added for automatic discovery of webapplication configuration:

    • ServletContainerInitializers are discovered via the jar services API and can specify a list of types that they handle. Any classes of those types discovered in any jar contained in WEB-INF/lib are passed to the ServletCotnainerInitializer and it is able to use the same programmatic configuration APIs as ServletContextListeners.

    I believe these mechanisms are good improvements in the specification and I support their inclusion. I previously expressed concerns about the flexibility and optionality of their usage. Specifically that:

    Accidental Deployment: Web applications can
    contain many third party jars and that deployers may not be willing to trust all of them to the same degree to be able to deploy and configure arbitrary filters and servlets.
    Slow Deployment: Web applications can contain many many jars and that scanning of the classes of all the jars could slow deployments.
    Ordering:
    There was no mechanism to specify ordering, thus limiting the usefulness of the features for modularization.
    Parameterization: The configuration baked into a JAR cannot be parameterized, thus unpacking is needed to discover/change default configuration.

    The Proposed Final Draft (8.2.2 & 8.2.3) has addressed all but the last of these concerns with the ability to specify in web.xml an absolute ordering of jars within WEB-INF/lib/ that allows jars to be excluded from the ordering. Each jar in WEB-INF/lib may be given a name by having a <name> element within a META-INF/web-fragment.xml file. The webapps WEB-INF/web.xml file can then have an <absolute-ordering> element that lists the fragment names in the order they will be applied, together with the optional <others/> element to specify if and when unnamed jars are included.
    As well as my ordering concern, this feature addresses accidental deployment, as a deployer can list only known well trusted jars; and slow deployment, as an ordering can exclude jars that need not be scanned (other than to discover any web-fragment.xml file).
    However, my lingering concern is that the PFD as written does not well express that Filters and Servlets cannot be configured by annotations or TLD listeners from jars excluded from the ordering, nor is it clear that ServletContainerInitializers can be excluded in this fashion.   For the purposes of avoiding accidental and/or slow deployment, it does not matter which of the mechanisms a jar uses for ease-of-deployment, exclusion should mean exclusion.  The responses from the servlet expert group have generally been in agreement with this, but I think the specification needs to be clearer. I have proposed that the following text be added to section 8.2.3:

    If the web.xml contains an <absolute-ordering> that does not include the <others/> element, then only the jars containing the fragments listed in the ordering will be able to instantiate Filters, Listeners and Servlets using the Annotations and Pluggability features. Specifically:

    • The web-fragment.xml of excluded jars is not processed.
    • Excluded jars are not scanned for annotated servlets, filters or listeners. However, if a servlet, filter or listener from an excluded jar is listed in web.xml or a non-excluded web-fragment.xml, then it’s annotations will apply unless otherwise excluded by metadata-complete.
    • ServletContextListeners discovered in TLD files of excluded jars are not able to configure filters and servlets using the programmatic APIs. Any attempt to do so will result in an IllegalStateException.
    • If a discovered ServletContainerInitializer is loaded from an excluded jar, it will be ignored.
    • Excluded jars are not scanned for classes to be handled by ServletContainerInitializers.
    If the exclusion of jars from the configuration discovery mechanism is made explicit, then my main concerns will have been addressed. Parametrization will not be addressed, but I think that is something for consideration in 3.1.

    Conclusion

    Despite being in Proposed Final Draft, I think we are not quite at the conclusion stage. However excellent progress has been made and work is continuing. I hope that P in the current PFD is significant and that there will be at least one more draft before we are final. There is still a little time to send your own thoughts to to jsr-315-comments@jcp.org.
    Sun Microsystems has invited me to participate in their technical session on Servlet 3.0 at Javaone, together with Rajiv Mordani and Jan Leuhe.  I’ll be presenting a section on the Asynchronous Servlets API and giving a demonstration that uses some ease-of-deployment features to deploy a webapp on glassfish using the Jetty asynchronous HTTP client  in a 3.0 asynchronous servlet. The session is TS-3790Java

  • Jetty: eclipse update site

    For the last couple of jetty @ eclipse releases I have been working with getting a bit more used to the eclipse way of doing things. One of those ‘eclipse way’ deals is the p2 update site and I am announcing here the availability of a certain subset of jetty features that are available for download from within eclipse. What does this actually mean?
    Well, I am also working on an eclipse plugin or two that ultimately would make use of these features so I went through the process of figuring out this deployment mechanism. I also worked on a updating the osgi HttpService for use with the jetty7 artifacts as well so that was another use I had for it. But ultimately, part of joining eclipse was to bring the jetty components to a larger audience and these update sites seem to be one of the major deployment mechanisms for software within eclipse. Pulling from this update site will not given the average user a new deployment mechanism for their webapp development, that is one of the plugins I have knocking around on the machine which I’ll try to get out pretty soon. What this will give you is either the jetty server, the asynchronous jetty-client, or the jetty servlet components built on top of the jetty server feature. These are functionally repackaged artifacts from the maven repository where we have traditionally deployed our artifacts, renamed into the more eclipse conventional naming and masked into ‘features’. I am very interested in getting feedback on this and I would like to engage directly with developers that make use of these artifacts to both make sure that the update site itself is of the right format (and working against the correct target platform, ouch what a pain that was) and then also to make sure that the feature breakdown makes sense. If this preliminary setup works then I’ll run with it and get the rest of the jetty artifacts we ship (JMX, JNDI, etc etc) into separate features and get them deployed up to the update site.
    Anyway, the update site for the last 7.0.0.M2 release is located at:

    http://download.eclipse.org/jetty/stable-7/update/

    Anyway, feel free to email me feedback directly to ‘jesse DOT mcconnell AT gmail.com’ or you can leave feedback as a comment on this blog, your choice. Your feedback is welcome and will help us get this right for the eclipse developer community.

  • Zimbra Desktop

    JJ Zhuang of Yahoo!’s Zimbra division has posted up the architecture of their offline user client. It makes innovative use, or should I say re-use of their server code to present a seamless experience for desktop users regardless of connection state.

    He says they did this, with Jetty underpinning, for 3 reasons… reuse, reuse, and reuse.

    Read his post here and let us know if we can help your innovative uses of Jetty as well.

  • Webtide podcast with JavaWorld

    Greg Wilkins and Jan Bartel join me for a nice interview with JavaWorld’s Andrew Glover, particularly about Comet support and i-Jetty. Listen in! Podcast Link

  • Jetty at Eclipse Webcast Available

    Greg’s excellent presentation is now posted in recorded form. Check it out, find out about Jetty’s relation with Eclipse, with OSGi, its continued availability under Apache license, asynchronous servlets and much, much more. Link to Eclipse

  • Jetty Webinar – 27 April

    I’ll be giving a webinar on Jetty @ eclipse  April 27 – 1:00 pm PDT / 4:00 pm EDT / 8:00 pm GMT.

    The presentation will be a mixed bag of some project overview/status, some drill downs into some key features and some hopefully cool demonstrations.

    For details visit http://live.eclipse.org/.

    cheers