I recently added a custom error page to my application, so that the users don't see the stacktrace and are shown a friendly message in case of a runtime error.
Showing posts with label Grails. Show all posts
Showing posts with label Grails. Show all posts
Friday, 4 March 2011
Friday, 25 February 2011
Integrating Grails and Hudson
The best way to ensure consistent code quality and system stability is to integrate your application with a Continuous Integration system. Hudson is one such CI system.
In this tutorial, i will give a small demo on how to integrate Grails with Hudson. I will assume you are familiar with the grails technology and have some basic idea of what continuous integration systems are.
Note: This is not a tutorial on Hudson!
In this tutorial, i will give a small demo on how to integrate Grails with Hudson. I will assume you are familiar with the grails technology and have some basic idea of what continuous integration systems are.
Note: This is not a tutorial on Hudson!
Thursday, 24 February 2011
Exploring BootStrap.groovy
You may come across a scenario where you want to carry out a task every time your application starts or stops.
You just need to peep inside your grails-app/conf folder to find a groovy file called BootStrap.groovy.
BootStrap.groovy is a simple plain groovy script with two important closures : 'init' and 'destroy'. These closures are called upon when the application starts up and shuts down respectively.
You just need to peep inside your grails-app/conf folder to find a groovy file called BootStrap.groovy.
BootStrap.groovy is a simple plain groovy script with two important closures : 'init' and 'destroy'. These closures are called upon when the application starts up and shuts down respectively.
Thursday, 10 February 2011
JDBCException due to stale connections in Grails
Issue
If your grails application remains idle for too long or the database connections remain idle for too long or the database is restarted you may see the following exceptions:
This issue occurs because the application tries to use a database connection that has become stale and should have been evicted.
If your grails application remains idle for too long or the database connections remain idle for too long or the database is restarted you may see the following exceptions:
ERROR org.hibernate.util.JDBCExceptionReporter - No more data to read from socketThese issues are intermittent, that is, they may disappear when you try hitting again.
ERROR org.hibernate.util.JDBCExceptionReporter - OALL8 is in an inconsistent state
ERROR org.hibernate.util.JDBCExceptionReporter - Io exception: Broken pipe
ERROR org.hibernate.util.JDBCExceptionReporter - Already closed.
This issue occurs because the application tries to use a database connection that has become stale and should have been evicted.
java.lang.NoClassDefFoundError when sending async emails in Grails
Issue
Exception while sending emails in production environment.
If you are trying to send emails from your application asynchronously, using the Mail plugin, in the production environment you may see an exception like:
Exception while sending emails in production environment.
If you are trying to send emails from your application asynchronously, using the Mail plugin, in the production environment you may see an exception like:
java.lang.NoClassDefFoundError: org/springframework/mock/web/MockHttpServletRequestThis is because of a bug in the Mail plugin. This plugin uses the MockHttpServletRequest class from the spring framework test jar which is not bundled when you run the 'grails prod war' command.
Monday, 7 February 2011
Add search to your grails application using the searchable plugin
If you're building a web application, you're most certainly going to need some 'search' capabilities in your application. The searchable plugin is an amazing plugin that is built using Compass search engine and lucene. This plugin enables you to make your domain classes without writing almost any code. In this article we will be discussing how you can install and use this plugin, and also discuss some issues around it.
We will be creating a simple grails application, a couple of domain classes, and then we will explore the 'searchable' plugin. (find the source code of the sample application at the end of the article)
Let's get started!
We will be creating a simple grails application, a couple of domain classes, and then we will explore the 'searchable' plugin. (find the source code of the sample application at the end of the article)
Let's get started!
Monday, 24 January 2011
Build your first grails application
Grails is an open source web application framework, that has been built with the aim to enable rapid application development (RAD). Grails uses groovy as it's primary programming language. It uses Convention over Configuration to speed up the process of web application development. Grails takes its inspiration from Ruby on Rails but for the java world. Grails runs on the JVM and brings the power of the scripting world since it uses groovy which is a dynamic language built on top of java. Read more about grails and it's features here.
In this article we will quickly build an application using Grails. You will be surprised to see that you have your web-app running within 15 minutes, save data to the database, even deploy you application on your favourite application server! Enough talking, let's get into action.
( find a download link for the source code of the sample plugin at the bottom of the page)
In this article we will quickly build an application using Grails. You will be surprised to see that you have your web-app running within 15 minutes, save data to the database, even deploy you application on your favourite application server! Enough talking, let's get into action.
( find a download link for the source code of the sample plugin at the bottom of the page)
Thursday, 20 January 2011
Welcome Grails to your life!
We all know how painful web development in java can be! Maintaing endless configuration xml files, writing hibernate layers & complex build scripts for compiling & packaging can make your experience of developing a web app in java nightmarish. But we would not want to sacrifice the capabilities and power of the Java platform for the sake of ease and agility.
And this is where web frameworks like Grails fit in. These framework take care of the overhead tasks such as configuration, builds, integration, and enable us to concentrate on our business requirement.
If you are looking for a framework that supports agile development and enables RAD (Rapid application Development), Grails could be your first choice!
And this is where web frameworks like Grails fit in. These framework take care of the overhead tasks such as configuration, builds, integration, and enable us to concentrate on our business requirement.
If you are looking for a framework that supports agile development and enables RAD (Rapid application Development), Grails could be your first choice!
Monday, 17 January 2011
Create your first grails plugin
Crucial to the success of grails, is its support for plugins. Grails was designed keeping pluggability in mind right from the start. Ease in development, testing, building and distribution of plugins has led to a larger community interest in the framework, with loads of plugins available for developers to choose from.
If you’ve worked with grails, chances are you’ve used at least one grails plugin such as hibernate, logging, acegi, grails UI, mail, searchable etc. Grails maintains a plugin repository that you can search to find a plugin most suitable for your requirements. But have you ever found yourself in a situation where you’re rewriting the same code in multiple views, or duplicating code between controllers and services and even between multiple grails applications? If yes, this could be your chance of trying your hand at a plugin!
I’m presenting a very basic tutorial to create a very simple grails plugin, with a service and a taglib that can be reused across grails applications.( find a download link for the source code of the sample plugin at the bottom of the page)
Subscribe to:
Posts (Atom)