What to do when JAX-RS cannot find it’s Providers aka My message body writer is not used

One of the reasons why I wrote this article is my, rather unusual, encounter with a missing message body writer in a Jersey 1 test application. This problem of mine occurred during collecting of data to get a Jersey 1 performance baseline in order to see where Jersey 2 stands when compared to its predecessor. The problem is described at the end of this article because I think it’s pretty rare, but still not impossible :-), and not many of you will (hopefully) face it. But first I’d like to take a look at more common issues regarding missing providers and what you can do to solve them.

[Read More]
jax-rs 

JAX-RS Providers on Client and on Server

In this article I’d like to explain two things. First, what to do when you want to restrict JAX-RS providers to be used on, for example, client-side only. And second, what are the issues (and how to solve them) with injecting providers when you create and register instances of them directly.

[Read More]
jax-rs  jersey  hk2 

Jersey CDI Integration – Few Notes and EAR Support

During our last sprint I was porting support for CDI injections for EARs that contain multiple JAX-RS web applications (WARs). This worked fine in Jersey 1 and it works on WebLogic but we didn’t have support for these kind of deployments directly in Jersey (which means that Glassfish was affected as well) until this very moment. I’d like to share some findings I’ve made while working on this task.

[Read More]

Checkstyle matters to Jersey too …

Last week Pavel wrote and published an interesting blog post about Why Checkstyle matters … I remember how he was describing his encounter with JeroMQ to me. Especially the part where he wasn’t able to build the project for a few times because of the Checkstyle issues that pop-up right after he executed the build. I found the whole idea behind running code style checks during build appealing as well and decided to do something similar for Jersey.

[Read More]

Micro-Benchmarking JAX-RS Applications

Sometimes you want to examine what impact would a new JAX-RS filter have on performance of your application. Whether your custom message body provider is as fast as you though or you simply want to find out the throughput of your JAX-RS resources or client instances. Recently we were looking into this area and we’ve created few utilities that may make your life easier if you want to write micro-benchmarks for JAX-RS applications.

[Read More]

Performance Improvements of Sub-Resource Locators in Jersey

There were many performance improvements since Jersey 2 first came out almost 2 years ago. Jakub and I decided to present some of the latest ones in our recent articles. Jakub took a look at general performance gains in Jersey in his Jersey 2 Performance. I’ll try to cover the change we introduced in Jersey 2.16 and that affected processing and performance of sub-resource locators in Jersey applications.

[Read More]

Jersey’s Entity Filtering meets Jackson

Support for Entity Filtering in Jersey introduces a convenient facility for reducing the amount of data exchanged over the wire between client and server without a need to create specialized data view components. The main idea behind this feature is to give you means that will let you selectively filter out any non-relevant data from the model before sending the data to the other party.

Entity Data Filtering is not a new feature but so far the support was limited to MOXy JSON provider. Since Jersey 2.16, we support also Jackson (2.x) JSON processor and in this article we’re going to take a look into it in more detail.

[Read More]

Intercepting Jersey resource method calls

Sometimes it would be nice to have a possibility to wrap a resource method call. Imagine a use-case in which you need to process business code, placed in your resource method, in a transaction (open transaction before resource method, commit or rollback transaction at the end) or apply some advanced security constraints. If you’re using JAX-RS together with CDI in your application it’s not a problem to do such things. Fortunately, with Jersey it’s also possible to do those things outside of CDI.

[Read More]
jersey  hk2