Pinyin causing Glassfish and Jetty to Fail

For as long as I can remember I’ve been hitting a bug when I start one of my web applications under GlassFish. The error message is about an ArrayIndexOutOfBounds exception and is related to Pinyin. I’ve looked for a solution a few times but never found an answer that worked. It seems to be one of those issues that a lot of people think they have found a solution for but none of them work. As far as I could tell the problem was not fatal to the application so I gave up looking but it has always worried me a little.

Continue reading

Using a Java Web Service Hosted Behind Apache

I recently set up a new system running most of the software my business produces. Unlike our other sites right from the beginning all of Java servers (a mixture of Tomcat and GlassFish) will be access via Apache using Apache Tomcat Connector mod_jk. Typically we start of will one server and add Apache in later but this is a service move so it makes sense to start with Apache in place.Continue reading

Simple CRUD Example – Part 1

If you have ever developed a web application you’ll know that most of the code you write is not clever business logic that’s doing complicated calculations but actually fairly simple CRUD (Create, Reuse/Retrieve, Update, Delete) code. Since this is the type of code that gets written all the time it makes sense to know it inside and out and make sure it’s correct and optimized. This series of articles takes you through the creation of a simple CRUD application using the following technologies:Continue reading

Glassfish 3.1 Exception While Loading

I recently switched over to using GlassFish 3.1 and then 3.1.1 from 3.0 and I so wish I hadn’t. The 3.1 release doesn’t seem to have bought any new toys but it’s brought a whole host of bugs and weird behaviour. The latest piece of oddness described here has just wasted a couple of hours of my life so in the hope that you won’t also have to waste your life here’s the problem.Continue reading

Getting Started with JEE 6 – First Code

Now that we have created the project it’s time to throw caution to the wind and just start writing some code! Right click on the example.simpleproject node under Source Packages and select new… then Java Class. Call the class QuoteBean or some such – it has been common to call classes such as this SomethingBean but that practice seems to be falling by the wayside as so many classed now follow bean patterns.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

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