RESTEasy 6.1.0.Final Release

By James R. Perkins | August 2, 2022

We are happy to announce the final version of RESTEasy 6.1.0.Final. This is our first final release implementing the Jakarta RESTful Web Services 3.1 specification.

What has changed in Jakarta RESTful Web Services 3.1

There have not been a lot of major changes in Jakarta REST 3.1. However, below are a some highlights.

Java SE Bootstrap API

This introduces a way to bootstrap a REST server. This can be very helpful for unit tests or just running in Java SE. With RESTEasy you need to add one of the following dependencies to get the SeBootstrap to work.

  • org.jboss.resteasy:resteasy-undertow-cdi (preferred)
  • org.jboss.resteasy:resteasy-undertow (preferred)
  • org.jboss.resteasy:resteasy-netty4
  • org.jboss.resteasy:resteasy-vertx (SSL not implemented)

Note that a custom implementation of the org.jboss.resteasy.plugins.server.embedded.EmbeddedServer can also be used. This is the replacement for the deprecated org.jboss.resteasy.plugins.server.embedded.EmbeddedJaxrsServer. However, if you already have a custom implementation of EmbeddedJaxrsServer that can be used as well.

The Undertow implementations are the preferred implementations. This is what RESTEasy uses for the Jakarta REST 3.1 TCK.

CDI Support

In Jakarta REST 3.1 the @Context is deprecated. While @Context is still currently supported, future versions may remove support.

With this, RESTEasy has added some support for injecting the known types which @Context also injects. One note is this currently does not work with method parameter injection. The following types can be injected as global fields in CDI managed beans.

  • jakarta.ws.rs.core.Application
  • jakarta.ws.rs.client.Client
  • jakarta.ws.rs.core.Configuration
  • jakarta.ws.rs.core.HttpHeaders
  • org.jboss.restesy.spi.HttpRequest
  • jakarta.ws.rs.ext.Providers
  • jakarta.ws.rs.core.Request
  • jakarta.ws.rs.container.ResourceContext
  • jakarta.ws.rs.core.SecurityContext
  • jakarta.ws.rs.sse.Sse
  • jakarta.ws.rs.core.UriInfo

Services

Section 4.1.2 of the spec defines a ServiceLoader must be used to locate jakarta.ws.rs.core.Feature and jakarta.ws.rs.container.DynamicFeature. This can be enabled if your Application.getProperties() contains a key of jakarta.ws.rs.loadServices with a value of Boolean.FALSE.

Default Exception Mapper

A default jakarta.ws.rs.ext.ExceptionMapper<Throwable> is now required for an implementation. This can easily be overridden by defining your own ExceptionMapper<Throwable> as a @Provider.

Deprecations

The Link.JaxbLink and Link.JaxbAdapter inner classes have been deprecated. The Cookie constructor as been deprecated in favor of the Cookie.Builder as has the NewCookie in favor of NewCookie.Builder.

RESTEasy Quickstarts

As mentioned previously there is a new quickstarts project. While there is currently not a tag for 6.1.0.Final, in the future there will be. This is currently a work in progress.

New Features

While there have not been many new features in RESTEasy itself, there has been one new client utility introduced. Currently, this contains some client authentication filters.

         

YourKit
YourKit supports open source projects with innovative and intelligent tools for monitoring and profiling Java and .NET applications. YourKit is the creator of YourKit Java Profiler, YourKit .NET Profiler, and YourKit YouMonitor