Creating a deployable WAR file

When running ‘grails’ from the command line, the list of available targets does not list the target for creating a deployable WAR file.

‘grails war’ creates a packaged WAR file that can be deployed to a servlet container.

NoSuchMethodErrror StringUtils.isBlank() when deploying Grails WAR to JBoss 4.0.1

Deploying a Grails 0.1 WAR to JBoss 4.0.1 I get this exception:

<code>
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsApplication' defined
in ServletContext resource [/WEB-INF/applicationContext.xml]: 
Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: 
org.apache.commons.lang.StringUtils.isBlank(Ljava/lang/String;)Z
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:370)
	org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
	org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
	org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:269)
	org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:320)
	org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
	org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
	org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
	org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:83)
	javax.servlet.GenericServlet.init(GenericServlet.java:211)
</code>

This seems to be a Commons Lang jar issue, and does not occur if deploying Grails web apps to JBoss 4.0.4+

Update: This is an issue with the JBoss Unified ClassLoader when deploying to a JBoss server with other webapps including other possibly different versions of the same jars. The solution is to disable the Unified ClassLoader.

Disabling the use of the JBoss Unified Class Loader in this file:

/jboss/server/default/deploy/jbossweb-tomcat50.sar/jboss-service.xml

changing this line:

<code>
&lt;attribute name="UseJBossWebLoader"&gt;true&lt;/attribute&gt;
</code>

to

<code>
&lt;attribute name="UseJBossWebLoader"&gt;false&lt;/attribute&gt;
</code>

New Hibernate book on the way from the Hibernate team

Christian Bauer has an update on the Hibernate blog about the status on the second edition of the Hibernate in Action book. Apparently there has been so much additional material added to the book that they’re changing the name to ‘Java Persistence with Hibernate’.

The new book will cover Hibernate 3.0 features in addition to Java Persistence API features (EJB3.0 Entities).

Can;t wait to get a copy of this one, as HiA in my opinion was and still is the best Hibernate book published.

OnJava.com: Telling Stories at JavaOne

Daniel Steinberg has an interesing account of the Key Notes from JavaOne this year – he mentions in his article that they were lacking the ‘rally the troups’ enthusiasm from prior years. Was it that they were missing the McNealy-style jokes with his always anticipated Microsoft bashing?

I ony got to attend one day this year on Wednesday, and I admit the keynotes were a little bland. The BEA afternoon session was more of a corporate invester conference call than typical conference Key Note material. I had to leave early to get a train, but from what I saw, there wasn’t anything that got me that excited.

I can see Stenberg’s point. The last JavaOne I attented was 2001, and after every Key Note you left feeling so pumped up about Java that you wanted to race out of the hall and start coding! There was definitely less of that enthusiasm this year.

However, the emphasis seemed to have shifted out to the sessions themselves – the sessions I attended did make me feel ‘wow – that was awesome!’ each time they completed, and I am definitely fired up about new technologies such as EJB3.0 and Groovy, even though I had already been working with both prior to the conference. There still is definitely something very refreshing and invigorating about attending tech conferences – you leave feeling energized and empowered with new technologies and skills – and then get back to the real project world and realise – ‘oh, we’re still using J2EE 1.3’ … 🙂