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
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
.getInfo().getInfoConnection() and operations against the database during the transaction can be performed on it.
Continue reading Arbitrary SQL during unit tests
WebSphere Liberty 184.108.40.206 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
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
grep is great for scanning through patterns, dealing with XML files like the UIM/VIM files in Curam would require more smarts than simple text strings. For those smarts, you need XPath which Java does provide. This provides a simple example for traversing through files and listing the ones that match an XPath pattern using only the JDK.
Continue reading xpath find grep