Tag Archives: java

Java programming language.

Self cleaning Properties

The java.util.properties provides a useful way of managing the .properties files. However, if use the store() method the order does not get preserved and they add a time stamp resulting in a file that would be harder to put in version control after cleanup.

What I do is use the following code to do my cleanup so the properties are sorted and the time stamp which appears on the first line is removed…
Continue reading Self cleaning Properties

Arbitrary SQL during unit tests

When writing unit tests using Curam, it could be useful to inject some SQL to perform read and writes to the database, especially since the unit test would roll back database changes after the test. The actual JDBC java.sql.Connection connection object used during the test, can be retrieved using curam.util.transaction.TransactionInfo .getInfo().getInfoConnection() and operations against the database during the transaction can be performed on it.
Continue reading Arbitrary SQL during unit tests

WebSphere Liberty NoopUserRegistry Add-On

WebSphere Liberty 8.5.5.6 has a bug in the implementation of JASPIC that prevents developers from making their own modules that do not have a user realm that is managed by WebSphere’s UserRegistry.  To work around it I took some hints on Arjan Tijms’ work testing with JASPIC on WebSphere Liberty and combined it with my knowledge of Maven and OSGi.
Continue reading WebSphere Liberty NoopUserRegistry Add-On

JAX-WS vs JAX-RS

The TL;DR version: JAX-WS is meant for XML based web services such as SOAP. JAX-RS does not have the same restriction.

JAX-WS is generally geared towards server to server interactions with well defined contracts (WSDLs) and usually when the service and client side are from separate groups. It is very resource intensive so it isn’t feasible for client-to-server interactions where the network or client device capability is less than optimal.

JAX-RS is geared towards client to server interactions, although server-to-server is okay. As it has little service obligations, it can be tuned to whatever the client needs are.
Continue reading JAX-WS vs JAX-RS