Support‎ > ‎

Trouble Shooting Guide

This is provided to assist you in resolving issues quickly.

Installation and Verification

Unzip Issues

On some platforms, you may encounter issues unzipping due to file name length.  These are almost certainly just issues in the documentation (newer versions on the web), and can be ignored.

Groovy Missing

If BusLogicIntro shows compile errors (e.g., unable to find class BusLogicIntro) after installation, you need to install Groovy.  Groovy is used in this demonstration project - it is not required for your projects.

Basic Guidelines

Stack Trace

Read all the way down - often nested

Get Hibernate running before Business Logic

Getting Hibernate to run can often be tricky.  We recommend you get Hibernate running for basic retrieval / update before introducing business logic.

IDE Considerations

Consult your IDE documentation and the web for most problems.  The sub-sections below describe a number of issues we have encountered.

Eclipse and Maven

We use Eclipse Indigo (earlier Helios), and SpringSource STS.  The latter provides increased debug support for Groovy.  Presuming you are building Web Projects, be sure to get the EE version.

You may wish to install Maven.  It is required for the BusLogicTutorial (JSP version), and of course you may wish to use it as well.  We offer the following checklist:
  1. Get Maven using Windows > Install Software > Indigo - (it is not installed by default in the EE version).

  2. This project also requires the WTP integration.  Ensure you have this (it can be obtained here).  You can verify it using Window > Install Software > What's Installed (click thumbnail at right to expand)

  3. In extreme cases, you may encounter unusual issues.  We have often resolved these by deleting the Maven cache.  You can find it under Windows at a location such as C:\Users\val\.m2, or /Users/val/.m2/ on the Mac (you will need a tool to view hidden files, such as Tinker Tool)

  4. If you encounter extremely (hours) slow maven time, check your Virus protection.  There are many fine programs, on Windows we use ClamWin after experiencing some truly dreadful problems with another product.

  5. Check your machine's JDK version relative to the maven pom's <java.version>.  In these days of virtual machines, it is easy to get a mismatch here (look for "no targeted runtime").


The following issues may occur under Grails.

Error SLF4J: Class path contains multiple SLF4J bindings

In some versions of Grails, updating BuildConfig to include Business Logic may encounter slf4j version errors when you attempt to Grails Tools > Refresh Dependencies.  These can occur in the Console Log, in which case you can ignore them.  If they occur as dialogs, this can interfere with proper class path construction, resulting in compile errors.

We have circumvented this by restarting STS.  You can also try deleting the Grails .ivy cache (on Mac, find it at a location like /Users/val/.grails/ivy-cache/ as described in the section above).


Issues regarding Groovy.

Groovy Annotation Syntax

Groovy annotation syntax differs slightly from Java:
  • Multi-line: use triple single quotes for multi-line annotation string parameters
  • Nested annotations: use {}, not []
Here is an example:

// ==> "[" means group, "{" = Tab Sheet, "," = same line, ";" = newline
@View(members='''Customer [name, picture] Financials [balance;creditLimit];
// "header" used by Purchaseorder - define just a few attributes
@Views([  @View (name="header", members="name, balance") ]) 
@Table //(name="customer")
class Customer  implements {

STS (Springsource Tool Suite)

Here is how we install STS.  As of STS 2.9.1 (4/2012), STS contains Roo but not Grails.  The link for this paragraph explains how to obtain both, for Windows and Mac.

See also the notes above regarding Maven.


Ensure you have a current JDK (1.6 or higher).  Older JDKs have exhibited issues in Grails projects.


See this page for more information.

Common Issues

Improper Data Types (e.g., Identity attributes are Long, not long)

If an int attribute can be null, it needs to be declared as Integer (which can be null) and not int (which cannot be null).

A particularly common case of this is Identity fields - ensure they are Long, not long.

Hibernate batch update fails

If Hibernate gives you an exception that looks like the following:

org.hibernate.SQL - update MYTABLE set etc...

org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: null

org.hibernate.util.JDBCExceptionReporter - failed batch

org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session

org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update

at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(

at org.hibernate.exception.SQLStateConverter.convert(

it can be difficult to figure out exactly what the problem is. It can be very helpful (for debugging purposes) to put the following in your Hibernate configuration:

<property name="hibernate.jdbc.batch_size">0</property>

This should give you a better error message specifying why the update fails.

Using Beans not in transactions

It is very easy to read a parent in transaction 1, then assign it to a child in transaction 2.  This will fail unless you reattach the bean.

Annotations on domain object properties fail - annotate getters

If you are defining persistence using annotations, be sure to annotate the getter, not the property.  This will fail in subtle and difficult to detect ways:

private BigDecimal balance;
public BigDecimal getBalance() { return balance; }
public void setBalance(BigDecimal balance) { this.balance = balance; }

Instead, do this:

public BigDecimal getBalance() { return balance; }
public void setBalance(BigDecimal balance) { this.balance = balance; }
private BigDecimal balance;

Managing Hibernate Collections

Be aware that inserting/deleting an object (e.g., an order) does not add/remove it from it's parents' collections (e.g., customers' orderList).  You are expected to that yourself.

Consider the approach shown below as illustrated in BusLogicIntro, where we provide parent helper classes to that manage collections and set the child parent reference:

You must also remove objects from parent collections when you delete them.  However, do not null out the child's parent reference, since this is required for aggregate adjustment processing.