Posted by Jason Rudolph on 1st May 2007
If you’re heading to JavaOne next week, what better way to get the festivities started than to spend an evening checking out the one-two punch that is Groovy and Grails?! The No Fluff Just Stuff Java Symposium Series is hosting the Groovy/Grails One Meet-up from 6:30 - 10:30 on Monday night at the W Hotel, just across the street from the Moscone Center.
Come on out and hear the latest news on the just-released Groovy 1.1 beta. Groovy Project Lead, Guillaume LaForge, will be on hand with all the details. And, you won’t want to miss Graeme Rocher, Grails Project Lead, as he brings you up to speed on the slam-packed Grails 0.5 release due out any moment. We’ll follow up those presentations with giveaways, demos, and a panel discussion including
Dierk Koenig, lead author of Groovy in Action; Andrew Glover, co-author of Groovy in Action; Neal Ford, DSL Guru; and yours truly.
And in a genuine show of class, the NFJS folks have added a charitable angle to the event. Registration is free, but they’ve asked that attendees make a small donation to the charity of their choice. In exchange, you get to check out two of the most promising technologies in the Java world today, meet some of the people behind the scenes, and you even stand a chance to win some cool gear. Well done!
Attendance is limited, so register early!
Tags: Grails, Groovy, Java, Speaking | No Comments »
Posted by Jason Rudolph on 3rd March 2007
What would it take to assemble a group of speakers like Spring creator Rod Johnson, Grails project lead Graeme Rocher, Groovy in Action author Dierk König, renowned agility expert Dr. Venkat Subramaniam, real-world Grails users from as far as away as Japan, Australia, and the UK, thought leaders from Hibernate, JBoss, Dojo, Google, Oracle, and Sun, and a whole host of others that each deserve individual mentions as well?

It’s the First International Grails eXchange 2007, of course! Mark your calendars for May 30th to June 1st, and head on over to grails-exchange.com to register for what’s sure to be a rock-solid event. From the official site…
Packed with presentations on Grails, Groovy, Ajax & Web 2.0 and JEE and the core technologies that support the Grails technology stack such as JEE, Spring, Hibernate, SiteMesh, Dojo and Quartz. … The Grails eXchange features the following tracks:
- The Groovy Language
- The Grails Framework
- Ajax and Web 2.0
- Java Enterprise Edition - JEE
I hope to see you there!
Tags: Grails, Groovy, Java, Speaking | No Comments »
Posted by Jason Rudolph on 14th February 2007
I recently had the chance to sit down with Scott Davis, Editor in Chief of aboutGroovy.com, for an interview about Grails, how I got involved with it, and what lies ahead. It runs about 23 minutes in length, but we manage to cover quite a bit in that time frame. We agree that we don't need one programming language/technology "to rule them all." We discuss the origin of (and the potential future for) Getting Started with Grails, and we set the record straight on whether EJB3 is a legacy technology. (Spoiler alert: It's not.)
Proper RSS support is coming soon for aboutGroovy.com podcasts. In the meantime, feel free to download the MP3 directly.
Many thanks to Scott and aboutGroovy.com for the interview.
Tags: Grails, Groovy, GSwG, Interview, Java, Podcasts | No Comments »
Posted by Jason Rudolph on 18th December 2006
There's something to be said for things that just work right out of the box, and JEE integration with Grails falls nicely into that category. When people first hear about Grails and they see demonstrations of its rapid application development (RAD) capabilities, it’s not long before an air of skepticism seems to set in. Surely a framework offering this level of productivity can’t possibly play nicely with a corporation’s highly-configurable and often complex application servers. Of course, this isn’t a new topic, as we've certainly explored some of these areas before. Nevertheless, questions remain, and any new technology has to prove its worth.
One rather common question concerns the ability to hook into an app server’s data sources using JNDI. If you've invested in a JEE container, there's a good chance you want to make use of its database connection pooling. (For that matter, it's probably a company policy to do so.) And, needless to say, beyond just connection pooling, using data sources also offers the added security and maintenance benefits of not packaging your database user ID, password, and URL inside your application.
So, what does it take to get a Grails app to obtain its database connections from a container-managed data source? Assuming you have your data source configured in your app server, it’s as simple as telling Grails how to look it up. Let’s first take a look at the data source definition in the app server. For this example, we’ll look at a MySQL data source configured in JBoss Application Server.
projects> cat /Applications/jboss-4.0.5.GA/server/default/deploy/mysql-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>jdbc/racetrack</jndi-name>
<connection-url>jdbc:mysql://localhost/racetrackprod</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>prod</user-name>
<password>wahoowa</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
Once we know the JNDI name for the data source – in this case, we see from the output above that it’s
jdbc/racetrack – we simply
define a Spring bean for that data source in
$PROJECTHOME/spring/resources.xml (where
$PROJECT_HOME is the root directory of your Grails application).
projects> cat racetrack/spring/resources.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="dataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:jdbc/racetrack"/>
</bean>
</beans>
Then, just run grails war to create the WAR, and that’s it. Now, when you deploy the WAR to your app server, your Grails application will use your container-managed data source for all of its database access.
So, what other types of JEE integration would you look for in your Grails apps? (Sound off in the comments, and perhaps we’ll have additional posts on this topic.) If you found this particular example to be a bit trivial, great! That’s exactly the point. JEE integration doesn’t have to be painful, at least not with Grails.
Resources
- JBoss configuration file for MySQL data source - mysql-ds.xml
- Spring configuration file - resources.xml
- The rest of this mysterious racetrack sample application - Coming soon!
Tags: Grails, GSwG, Java | 2 Comments »
Posted by Jason Rudolph on 10th September 2006
The latest episode of the Java Posse, the premier podcast for all things Java, mentions the recent Grails + EJB3 article on InfoQ. It's Episode 80, and you can hear what they have to say in the Quick News items at about the 43:25 mark.
InfoQ has a detailed article on using the Grails framework,which is a Groovy-based alternative to Ruby on Rails, to access EJB3 domain components (or domain objects). All the way from entity objects over to back-end database tables through to a fully-working web user interface. It's a long article, but if you're interested in seeing what Grails is all about, it's, I think, the most complete Grails tutorial I've seen yet, and nicely covers the domain of integrating Grails with an enterprise system.
Thanks to the Java Posse for continuing to spread the word about Grails and Groovy.
If you're not familiar with the Java Posse, I highly recommend that you check out the podcast. The newscasts provide a great way to stay up-to-date, and the interviews offer insightful access to the industry experts behind the news.
Tags: Grails, Java, Podcasts | No Comments »
Posted by Jason Rudolph on 22nd August 2006
InfoQ has just published my new article - Grails + EJB Domain Models Step-by-Step. The article discusses how you can use your EJB3 entity beans in Grails, generate scaffolding for them, and quickly have a fully-functional web app for those beans in a matter of minutes! All that, and you get to interact with those beans with all the dynamic Groovy goodness you can handle. JEE, meet RAD!
Many thanks to Grails project lead Graeme Rocher for his invaluable input and to InfoQ's Floyd Marinescu for his sincere interest in the Grails framework.
Tags: Grails, Java | No Comments »
Posted by Jason Rudolph on 20th June 2006
[Update 2007-07-21] - To try out a working sample application using a legacy schema with a more recent version of Grails, check out this post from the "Grokking GORM" series.
–
So you've heard about Grails and its promise to bring the power of Ruby on Rails to the Java platform. If you're like me, you stand in pure awe of the innovation and power illustrated by Rails, but know that your organization just isn't going to stray from the safety of Java. So if we can achieve similar productivity with a more Java-centric solution, what's not to like? And the more conservative businesses should find additional comfort knowing that Grails applications play nicely with their existing Java code, because Grails applications are written in Groovy (a dynamically-typed scripting language that also happens to be a Java standard).
Grails is still in its infancy (with version 0.1 being the current stable release), but it's slam-packed with many more features than you might expect given its youth, and I expect it to mature rapidly over the next few months. The development team has established an aggressive road map to continue to progress Grails as a solid and rich web development framework.
That all sounds good, but will it work with your legacy databases? If you're familiar with Rails, you know that its convention over configuration approach (which Grails shares) is best suited to greenfield applications where the database schema can be defined to follow the preferred conventions. Shoehorning a legacy database into such a framework, while it can be done, takes away some of that feeling of elegance you get from working with a purely-conforming schema. That said, I was surprised by how little tweaking is required to wrap Grails around a non-conforming legacy schema. Care to see for yourself? Let's get started… Read the rest of this entry »
Tags: Grails, Groovy, Java | 22 Comments »