Java EE Container Context Roots

Occassionally the need to do multiple side-by-side deployments of the same packaged application can arise. In a scenario recently faced, it was useful to have multiple versions of our packaged EAR deployed and configured slightly differently (for example: with and without security in QA environments). As the application is expected to run hot 24/7, the need for a simple side-by-side versioning (e.g. v1, v2) scheme was also important. Allowing us to deploy v1, and later breaking (incompatible) versions v2, v3, given our service consumers the freedom to upgrade when convenient. ...

May 23, 2015 · 2 min

EJB Timing with Interceptors

Java EE is packed tight with useful functionality. The humble Interceptor provides cross cutting functionality external to the targetted code, without modifying the code itself. In other words AOP. The API is rather simple an involves using @AroundInvoke. The following highlights just how simple it is to log all EJB service call execution times, without the need to modify a single bean. META-INF/ejb-jar.xml <?xml version="1.0" encoding="UTF-8"?> <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd" version="3.1"> <display-name>SerivceModuleEJB</display-name> <assembly-descriptor> <interceptor-binding> <ejb-name>*</ejb-name> <interceptor-class> net.bencode.common.ServicePerformanceInterceptor </interceptor-class> </interceptor-binding> </assembly-descriptor> </ejb-jar> ServicePerformanceInterceptor.java ...

May 13, 2015 · 1 min

Microservices

Amped by @yaamehn’s opinionated Microservices A Reference Architecture recent talk at the Microservices Australia Meetup, has got me thinking about the many interesting possibilities Microservices stirs up. Many useful techniques are touched on, regardless of whether actually adopting Microservices. On the surface Microservices doesn’t appear to be anything groundbreakingly new. It does however push tried-and-trued concepts (e.g. abstraction, decoupling, modularisation, continuous delivery) to extreme levels. Fused with innovations in the operations space such as containerising like Docker, can lead to some very powerful outcomes; such efficient continuous delivery (on a micro scale), decoupling of domains allowing for a best of bread technlogies, and so on. ...

April 26, 2015 · 6 min

Nerd Conferences

One of the best ways to evolve in the software industry is to interact with other developers and those technically minded. Resources such as user groups, Twitter and conferences are useful for this. It’s disturbingly easy to develop reality distortion or tunnel vision with the projects and technology stacks you spend a majority of your time with. Conferences on my radar: January linux.conf.au, Geelong Febuary APIdays, Sydney ...

April 11, 2015 · 1 min

soapUI freeze on Mac OS X

Well first time for everything. Messing around with some JAX-WS web services, wanted to spin up my favourite SOAP frontend, soapUI. On my Mac. Annoyingly it would just immediately hang. Completely frozen. soapUI by default will try and render a web page on startup. This doesn’t seem to work out so well when running on OSX. A handy little article I found on Anton Perez’s blog, made my day. Start ‘Activity Monitor’ and Force Kill your dead soapUI process. In Finder, /Applications/SmartBear/soapUI-5.0.0.app > Show Package Contents. Edit /Applications/SmartBear/soapUI-5.0.0.app/Contents/java/app/bin/soapui.sh. Uncomment this line# JAVA_OPTS="$JAVA_OPTS -Dsoapui.browser.disabled=true". Edit /Applications/SmartBear/soapUI-5.0.0.app/Contents/vmoptions.txt. Add -Dsoapui.browser.disabled=true. Start soapUI. Checkout these commented lines in soapui.sh…our fix ready to go: ...

January 25, 2015 · 1 min

Apache Ant

Lately I’ve gleened some “real world” Apache Ant tips and tricks from some really impressive Java EE developers I’ve had the opportunity of working with over the last year. Apache Ant is a Java library and command-line tool whose mission is to drive processes described in build files as targets and extension points dependent upon each other. Ant supplies a number of built-in tasks allowing to compile, assemble, test and run Java applications. ...

January 22, 2015 · 6 min

Asynchronous Workloads with WebSphere Application Server

So I’ve been using WebSphere for a while now, and continue to discover new functionality in this powerhouse of an application server. This post focuses on performing background work in WebSphere Application Server (WAS) 7.0, which is an EE 5 compliant container. Firstly a quick outline of the problem. Across a series of web service calls, there exist a number of intensive processes that need to take place. I wanted a way to perform work this asynchronously somewhere else within the application server, without being bound to the request/response cycle that HTTP web services impose…in essence making the actual service calls appear super snappy. ...

July 26, 2014 · 5 min

Poliquin BCAA Smackdown

BCAA’s (Branched chain amino acids) have always had a place in my gym bag for about the last 2 years. A branched-chain amino acid (BCAA) is an amino acid having aliphatic side-chains with a branch (a carbon atom bound to more than two other carbon atoms). Among the proteinogenic amino acids, there are three BCAAs: leucine, isoleucine and valine. The BCAAs are among the nine essential amino acids for humans, accounting for 35% of the essential amino acids in muscle proteins and 40% of the preformed amino acids required by mammals ...

July 5, 2014 · 3 min

REST APIs with RESTEasy and Tomcat

Java EE application servers at times can feel big and heavy…as in behemoth. I’m “lucky” enough to work with an old version of WebSphere AS on a daily basis at the moment. To keep things fast, I’ve resorted to using lighter weight containers for the job at hand. Tomcat is king when it comes to meeting the servlet specification, and no more. Its hell fast. As a result is very lean on what it offers out of the box. I needed to whip up a quick and dirty REST API using Tomcat and ideally using something based on JAX-RS. RESTEasy is a JBoss project that provides and surfaces various frameworks (e.g. Jackson for JSON serialisation) for building RESTful services, and is a fully certifed and portable implementation of the JAX-RS specification. Perfect. ...

April 17, 2014 · 4 min

Mac Tools List

A cruft free collection of life changing, awesome tools, that will help you squeeze the most out of your Mac and OS X. Essentials HomeBrew - rock solid package management, think apt-get for your mac. Install software with ease example: brew install wget. There are others, but I’ve never needed to look further. tree - a tiny, but super elegant command line (CLI) program that recursively dumps the contents of a given directory, visually as an ASCII art tree. So good! Demo: ...

April 10, 2014 · 5 min