JAX-RS 2: ensure your server providers are not used on client side!

Since JAX-RS 1 and moreover with JAX-RS 2 developpers create JAX-RS providers.

The most common ones are to (de)serialize the request/response payloads but you can do much more now like switching the input stream, updating the output stream, filtering the request/response etc…

Going further in this API you’ll realize you can filter input/output on server side and client side (for instance you can write a ClientRequestFilter and a ContainerRequestFilter). Generally client and server API are close but adapted to the “side” where the provider is working.

However can we ensure we didn’t mess things configuring a client provider on a server?

Continue reading

TomEE Maven Plugin: finally server.xml in your pom!

Until 1.x releases to configure the server.xml related to tomee maven plugin (embedded or not) you needed to configure either its direct location through “serverXml” parameter or a “conf” folder containing a server.xml. This is working fine but it was often forcing you to create a folder containing the server.xml only.

Note: if you are not used to tomee maven plugins, you can configure almost all the container through properties in the pom.

To avoid it both plugins now got a new variable to let you provide your server.xml inline!

Continue reading

JSON and WebSocket: Johnzon to the rescue

When writing a WebSocket endpoint the first thing you do is to create the endpoint (connection point) then you have to define the protocol to use. Because of what is modern IT world it is quite common to use JSon as payload format for WebSocket messages. Of course you can use any JSon mapper you want or JSON-P directly but you can actually go a bit further and that is what does Johnzon in its coming 0.8-incubating release.

Continue reading

Apache JCS: LorraineJUG slides

On friday I did with Jean-Louis Monteiro the Lorraine JUG. I presented Apache JCS which is a nice Java Caching solution implementing now JCache specification.

Slides are available here: http://rmannibucau.github.io/2015/LorraineJUG/#/.

And few code samples/examples can be found here (this is a maven project you can open in your IDE): https://github.com/rmannibucau/rmannibucau.github.com/tree/master/2015/LorraineJUG/demo.

Don’t hesitate to get in touch the Apache JCS community if you want more information (use Apache Commons mailing list – user@commons.apache.org – and just specify [JCS] in the subject), we’ll be very happy to help you!