Showing posts with label classpath. Show all posts
Showing posts with label classpath. Show all posts

Tuesday, August 7, 2007

GRAILS and Groovy tip

If you try out groovy Grails on Windows as an open-source web application framework, I suggest you install it as a sub-directory of your Groovy directory.
You will want to knwo that your groovy is running fine: in my case I added
set CLASSPATH=I:\groovy-1.0\groovy-1.0.jar;%CLASSPATH%
to my groovy-1.0\bin\groovyConsole.bat I also have three ENV variables defined: GROOVY_HOME, GROOVY_JAR and GRAILS_HOME and both HOME var's are in my path with \bin appended to them.

With that done, you can go into the Grails bin and edit the
grails.bat
I think that there is no point avoiding at least this much:
set CLASSPATH=
because even with my own classpath tool it is just too much grief. Grails does not need your classpath but having one is a problem. The top of my grails.bat now reads
REM set groovy_home=I:\groovy-1.0
REM set GRAILS_HOME=%GROOVY_HOME%\grails-0.5.6
REM set path=%groovy_home%\bin;%grails_home%\bin;%PATH%
REM set GROOVY_JAR=groovy-1.0.jar
set classpath=
To test that things are running start in the grails\bin with
grails help
which should run error-free and list the grails commands. From there you should be OK following the Grails Quick Start steps. Until help comes up error-free, you have an issue.

One last tip: Grails will create your web app root directory in the directory you are in at the time you execute
grails create-app
which in my case is running
I:\groovy-1.0\grails-0.5.6\scripts\CreateApp.groovy
so you do not want to be in .\grails\bin on your command line. If you have not installed the Microsoft Power Toy Open Command Window which launches CMD.exe from any folder in the file explorer, you will want to do so ... whether you are using Grails or Rails without an IDE.

RIFE-Jumpstart

RIFE is such a terrific example of using continuations in a web application framework that it is too bad if giving it a try has glitches from the get-go.
The RIFE-Jumpstart will use Jetty so you will want to go into the Jetty subfolder and edit the jetty.xml such that the port value is something other than 8080. After that you will reach RIFE as something like
http://localhost:28282
You simply must confirm that your OS has the JAVA_HOME env variable set to a JDK. I am using RIFE for Java5 so mine set to
i:\java5\jdk
I tried using my own ClassPath tool from LogiqueWerks to get around this by being sure to hit the right tools.jar and javac.exe but I could not escape
class file has wrong version 49.0, should be 48.0
when launching from the RIFE-JUMPSTART directory with
ant run
This also means that you must have ant in your path.
It is annoying that most HTTP frameworks install without politely asking for an alternative to port 8080. OracleXE and SUN Application Server are the latest to do this to me.
There are some good video podcasts on RIFE - one at Google is about an hour long.
If I add some RIFE pages they will be over at eclectic-pencil.com Useful links include rifers.org and a Confluence link on DWR.