Getting Started with JEE 6 – Creating a New Project

This short series of articles covers some of the basics of working with Java EE 6 (JEE6) and in particular JSF 2.0 and CDI (JSR 299 Context and Dependency Injection). JSF 2.0 and CDI bring some fantastic new functionality to the table but at the same time they also replicate a lot of existing ideas and bring them all under one roof. Unfortunately because all of the existing ideas are still used and available in containers we have ended up with a confusing mish-mash of annotations and configurations that mostly work together but have some gotchas to watch out for.Continue reading

International Routing Department Scam

There is a scam doing the rounds that tries to infect your computer or get you to phone a premium rate number for computer support. It goes something like this:

  • You get a phone call from an Indian sounding guy called Edward / Steve / John or something equally improbably.
  • They claim that your computer is sending out messages to indicating that it is infected with viruses / malware / trojans / etc.
  • They get you to turn your computer on and will then guide you to the “dangerous” files which are actually just normal system files.
  • Once they have shown you the dangerous files they either get you to visit a website or ask you to phone a technical support number.

Continue reading

Local transaction already has 1 non-XA Resource

While developing a bit of functionality that transferred data from one database to another in my current JEE 6 web application I came upon the exception below. Surprisingly for exceptions from deep within system this one is actually quite informative if you understand what it’s saying: the key is knowing that XA means distributed transaction. Transactions can be one of two types either local or non-distributed or distributed. A local transaction is what you are normally doing, the transaction involves a single resource (a database connection for example) which is doing all the transactional work itself.Continue reading

Creating a Connection Pool in GlassFish 3.1

Database connection pools are by far the simplest and quickest way to get a database connection from a JEE application. This article describes how to set up a new connection pool in GlassFish 3.1. Version 3.0.x of GlassFish used configuration screens that were very similar but in a slightly different place in the menu.Continue reading

Swing Look and Feel Choices

Java on the desktop has, for the most part, been a bit of a joke. For years it has suffered from clunky badly supported development and a small range of absolutely awful look and feel options. That seems to be changing slowly but I do wonder if it’s not too little too late. Either way it doesn’t actually affect me that much as I mainly work server side but when I do have to delve into the client side I like to produce something that looks good. As such he is a list of some of the alternative look and feel options available.Continue reading

ReadyNAS Ultra 4 – Rsync over SSH

You might wonder why an article about the ReadyNAS Ultra 4 is filed under the Linux category but there is a very good reason for this. Under the hood the ReadyNAS Ultra range (and the Pro range) are basically just little Debian based machines running Intel Atom x86 processors. This, from my point of view, is a really good thing because it means I can make up for some of it’s short comings.Continue reading

JEE 6 and Dates

I’ve been having some problems with dates recently in the application I’m currently working on. I need to be able to specify a date that indicates when a particular piece of information becomes valid. Sounds simple enough, yes? I thought so until I actually came to try and implement it. The problem I faced stemmed from the fact that JSF and JEE in general make some assumptions about time that can make your head spin.Continue reading

Checkstyle Rule Suppression

I recently started using Sonar to automatically check the quality of the code I write – turns out it’s mostly ok with a few systematically bad points that I will work on improving. One of the problems I faced though was what to do about a barrage of false positives from a small number of the default rules that ship with Sonar. Here’s how I fixed the problem.Continue reading