I did this on my ubuntu 11.10 system. Open JDK and Sun Java were already installed.
- Java Enrivonment
- Sun Java is installed by default at /usr/lib/jvm/java-6-sun-1.6.0.26/
- I moved the /usr/bin/java , which was pointing to the other java installation ( open JDK ), to /usr/bin/javaopen
- renewed /usr/bin/java by:
> sudo ln -s /usr/lib/jvm/java-6-sun-1.6.0.26/bin/java /usr/bin/java
> sudo export JAVA_HOME= /usr/lib/jvm/java-6-sun-1.6.0.26
- Install Maven2
> sudo apt-get install maven2
- Install Spring Roo ( Version 1.2.0 )
- Download spring-roo.zip from springsource site and unzip it somewhere. (let's call it $ROO_HOME)
> sudo ln -s $ROO_HOME/roo.sh /usr/bin/roo
- Setup Roo Project> mkdir myrooproject
> cd myrooproject
> roo
roo> project --topLevelPackage org.klarblick
roo> hint
roo> jpa setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
roo> hint
roo> entity jpa --class ~.domain.Note
roo> hint
roo> field string note
roo> json all
roo> web mvc setup
roo> controller all --package ~.controller
roo> web mvc json all
roo> quit
- Start Roo Project
> mvn tomcat:run
- Test Roo Project
- browse to http://localhost:8080/klarblick and create a new Note
- get a REST Client for your browser
- JSON GET Request on: http://localhost:8080/klarblick/note/1
Don't forget the request header: Accept: application/json
Hi!
AntwortenLöschenOn step 4
#web mvn json all
should it say:
#web mvc json all
First one doesn't work, second one at least get's accepted and processed by roo shell
thats right at step 4, thanks
LöschenIf you want the service alone without interface spring roo doo a nice job too
AntwortenLöschenroo> project --topLevelPackage org.klarblick
roo> hint
roo> jpa setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
roo> hint
roo> entity jpa --class ~.domain.Note
roo> hint
roo> field string note
roo> json add
roo> web mvc json setup
roo> web mvc json all