Starting and Stopping Services from Java

Most of the applications I develop are web based and therefore, when deployed on Windows, are running as a service. This is great most of the time but when I want to programmatically control the application it can present some problems because starting and stopping services requires elevated permissions. This article discusses a solution that I’ve come up with that I’m happy to deploy.Continue reading

JavaFX 2 Generic Editable Table Cells

A few days ago I wrote an article which gave a more complete example of editable table cells in JavaFX 2.0. In that article I promised another article discussing how to make generic editable tables cells since the first article just expected everything to be a string. I’m fairly happy with this solution to the problem of making formatted input cells but if anyone can suggest improvements I’d love to hear them.Continue reading

JavaFX 2.0 and Maven – Part 4

The final part of the Maven JavaFX build is getting NetBeans to correctly run the application. This, it turns out, is more difficult than I expected. This discussion covers a the problems quite well and is worth a read. I will admit up front that the solution I give here is not pretty, in fact it’s a down right hack, but it works for me. If you have a better solution I’d love to hear it, please leave a comment below.Continue reading

JavaFX 2.0 and Maven – Part 3

This (hopefully) final instalment of this series of articles on building JavaFX applications with Maven will refine what was done in the previous article. The previous article got us to the point where we were able to build a stand alone JavaFX application this article aims to do that with flare and produce roughly the same output as a regular NetBeans Ant JavaFX project.Continue reading

JavaFX 2.0 and Maven

I decided to have a bit of a play with JavaFX 2.0 the other day as we have a project coming up that may be a good candidate for using it. My first impression of JavaFX 2.0 is generally very positive, it’s a lot like Swing with the sharp edges knocked off. I’d like to see more emphasis on regular controls rather than animations and 3D (as that’s what I want) but we can’t have everything. The big disappointment though is the total lack of support for Maven.Continue reading

Installing Maven on Ubuntu 11.10

For some reason I can’t possibly fathom Linux seems to have a downer on all things Java. Packages are available for most things but they are invariably not the latest version which means performing a manual install – not the end of the world but irritating when you can just install a package for most things. This page gives a quick overview of how to install Maven 3 on Ubuntu 11.10 but the same (or a very similar) process will work on most distributions.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