Thursday, January 15, 2009

FLOSS Support in Sri Lanka

  • The Linux Center - http://thelinuxcenter.lk/
  • Ceylon Linux - http://www.ceylonlinux.com/
  • Fossmart - http://www.fossmart.net/

Monday, December 29, 2008

Ultra Lightweight IDE to edit Groovy/GSP

This is what it looks like.


Tired of bulky IDE's draining out your computer.

Gedit can turn out to be a lovely IDE with the bare essentials we need.
(Basically syntax highlighting and the file browser pane)

Here's what I configured.

  • Groovy/GSP syntax highlighting for Gedit.
An excellent tutorial explains this at http://noor.ojuba.org/2008/06/gedit-with-groovy/


  • Enable the File Browser Plugin in Gedit in Preferences>Plugins

Heres a screen shot of what it all looks like.


This plus the usual grails commands
as per

http://grails.org/Quick+Start

make developing grails apps a breeze even on lower end PC's.

Sunday, December 28, 2008

Tomcat Out Of Memory

Tomcat keeps running out of memory with jasperserver and a grails app.

Increasing the memory as per http://grails.org/FAQ#Application%20Servers
increasing the memory seems to help.

Added the following line to the top of my catalina.sh

export JAVA_OPTS="-Xms512M -Xmx512M -XX:MaxPermSize=1024m"



Apparently MaxPermSize is seperate from the -xMx heap setting.


http://wiki.caucho.com/-XX:MaxPermSize

Thursday, December 11, 2008

Grails - Acegi - Set a custom after Logout page

Crate a new action with the following code and set it as the action for your logout button.

(in this example the after logout paage is itemPrice/listDOA)

Code:

import javax.servlet.http.HttpSession

class LogoutController {

...

action {
HttpSession s = request.getSession()
s.invalidate()
redirect(controller:"itemPrice", action:"listDOA") // this is the new after
}
}

Charts in Jasper Reports with the Grails Jasper Plugin

Including jasper reports in your grails application is trivial with the jasper grails plugin.

However, if you need to include a 'chart' in your jasper report, grails complains about a missing jfreechart lbrary ...

I get the error,
----------------------------
Grails Runtime Exception
Error Details
Message: org/jfree/chart/plot/
PlotOrientation
Caused by: java.lang.NoClassDefFoundError: org/jfree/chart/plot/PlotOrientation
Class: JasperService
At Line: [92]


This is because it can't find the jfreechart library required by jasper reports to create the chart.

The following solution worked for me.

Obtain jfreecharts from

http://www.jfree.org/

and the copy the following lib files found in the doanloaded jfreecharts archive'slib dir to the grails lib dir.

jcommon-1.0.14.jar jfreechart-1.0.11.jar

(i got the latest versions and it works with grails 1.0.3 )