Tuesday, February 9, 2010

Maven 2.0.9 or higher

I wonder if Roo works with 2.2.1 which is the latest release of Maven.

If the latest version was 2.0.12 and you said 2.0.9 or higher I would not even blink.


Also has anyone tested Roo against Maven 3.0 branch?

in reference to: http://static.springsource.org/spring-roo/reference/html/intro.html#intro-installation (view on Google Sidewiki)

Read the Roo manual now trying the tutorial (stay tuned)

I read the Roo manual (cover to cover). Now I want to try out the tutorial. I am still evaluating Roo. I am looking for a set of modern best practices for using the Spring Framework(for a client).

I watched a talk by Ben Alex on InfoQ wrt Roo. He stated that Roo uses the state-of-the-art best practice.

Not sure where to get started on this... I am thinking about installing on either my Debian instance (VMWare), Unbuntu instance (VMWare), or Windows XP (host OS).

I need to install Eclipse, Spring STS Eclipse plugins, Maven, etc. I'd like to do this on a relatively clean environment.

I think I will use Windows XP since it is the host OS and I will get the most RAM and CPU out of it (on this box).

Looks like on my windows box, I have JDK 1.6 and Netbeans but no Eclipse and no Maven.
I need something more than Maven 2.0.9 to run Roo. Time to download, download, download.

It seems you can download
with Eclipse from Spring source.

The Roo docs say to use Maven 2.0.9 or later. The latest released version of Maven is 2.2.1.
I wonder if this is ok. I am about to find out.

I downloaded maven 2.2.1

Next I downloaded Spring Roo...
Then I setup my .bashrc file as follows (cygwin):

export JAVA_HOME="/cygdrive/C/Program Files/Java/jdk1.6.0_18"
export MAVEN_HOME=/home/rhightower/tools/maven/apache-maven-2.2.1
export ROO_HOME=/home/rhightower/tools/roo/spring-roo-1.0.1.RELEASE

I am using cygwin since I have to switch back and forth between Linux, MacOS and Windows. It is easier on my brain.

Maven ran fine. The JDK javac command ran fine, but Roo did not run.

rhightower@cmsjdl23 ~
$ mkdir sample

rhightower@cmsjdl23 ~
$ cd sample/

rhightower@cmsjdl23 ~/sample
$ ls

rhightower@cmsjdl23 ~/sample
$ roo.sh
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/r
Caused by: java.lang.ClassNotFoundException: org.springframework.roo.bootstrap.B
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)

Seems like it is time to reread the Roo install docs.

Ok reread. It seems like I am doing everything right. (I did go ahead and add the symbolic link to /usr/bin/roo so I can just type roo).

Seems someone else has ran into my cygwin pain.

Ben Alex says the magic cygwin light is here...

He also suggests that if you come up with a cygwin fix for run.sh that it will be included in the distribution... (I know run.sh for Jboss and mvn.sh for maven both support cygwin... so perhaps... I will reverse that they do and include it....)

For now... I will take 10 minutes and try to hack the roo.sh to run on cygwin.

I followed Ben's link. I noticed that both JBoss and mvn support cygwin so I looked how they did it and then hacked roo.sh into submission.

Here is what I came up with.... (this roo.sh should work under Unix, Linux, MacOS and cygwin)...

roo.sh that is cygwin friendly...



while [ -h "$PRG" ]; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG=`dirname "$PRG"`/"$link"
ROO_HOME=`dirname "$PRG"`

# Absolute path
ROO_HOME=`cd "$ROO_HOME/.." ; pwd`

# echo Resolved ROO_HOME: $ROO_HOME

case "`uname`" in

if [ "$cygwin" = "true" ]; then
export ROO_HOME="`cygpath -wp $ROO_HOME`"
export JAVA_HOME="`cygpath -wp "$JAVA_HOME"`"
export EXT_DIR=""$ROO_HOME\\dist";"$ROO_HOME\\lib";"$ROO_HOME\\work";"$JAVA_HOME\\jre\\lib\\ext""
export EXT_DIR="$ROO_HOME/dist:$ROO_HOME/lib:$ROO_HOME/work:$JAVA_HOME/jre/lib/ext"

while true; do
java -Djava.ext.dirs="$EXT_DIR" $ROO_OPTS -Droo.home="$ROO_HOME" org.springframework.roo.bootstrap.Bootstrap "classpath:roo-bootstrap.xml" $@
# echo Exited with $EXITED
if [ $EXITED -ne 100 -a $EXITED -ne 200 ]; then

So to recap,,, I downloaded and installed SpringSource STS (with Eclipse), maven 2.2.1 and Roo 1.0.1. I had to hack roo.sh to get it to work with cygwin. I posted my hack on the Spring forum and on my twitter... Hopefully future version of roo will support cygwin.

Now I can actually go through the tutorial...

Ok.. I am up to the part where I running the selenium tests. It is taking a while. It seems maven is downloading dependencies.

Still downloading...

Still downloading...

Ahhh... I miss maven.. I think I drink a lot more coffee whenever I use maven.

[INFO] -----------------------------------------
[INFO] -----------------------------------------
[INFO] Total time: 5 minutes 45 seconds
[INFO] Finished at: Tue Feb 09 16:11:54 PST 2010
[INFO] Final Memory: 16M/38M

Ok.. I am up to mvn selenium:selenese


This runs for a while...

Ok.. Firefox has decided to update itself (I don't use firefox.. I usually use Chrome.. I am a big google fan.)

I had to restart firefox a few times. Then I gave up and updated firefox to the latest... Now things really don't work.

$ mvn selenium:selenese
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building tenminutes
[INFO] task-segment: [selenium:selenese]
[INFO] ------------------------------------------------------------------------
[INFO] [selenium:selenese {execution: default-cli}]
log4j:WARN No appenders could be found for logger (org.openqa.selenium.server.Se
log4j:WARN Please initialize the log4j system properly.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Unable to delete file C:\Documents and Settings\rhightower\customProfileD
[INFO] ------------------------------------------------------------------------
[INFO] Trace
Unable to delete file C:\Documents and Settings\rhightower\customProfileDir50254
at org.apache.tools.ant.taskdefs.Delete.handle(Delete.java:624)
at org.apache.tools.ant.taskdefs.Delete.removeDir(Delete.java:683)
at org.apache.tools.ant.taskdefs.Delete.execute(Delete.java:543)
at org.openqa.selenium.server.browserlaunchers.LauncherUtils.recursively
at org.openqa.selenium.server.browserlaunchers.LauncherUtils.deleteTryTr
at org.openqa.selenium.server.browserlaunchers.LauncherUtils.deleteTryTr
at org.openqa.selenium.server.browserlaunchers.LauncherUtils.deleteTryTr
at org.openqa.selenium.server.browserlaunchers.LauncherUtils.deleteTryTr
at org.openqa.selenium.server.browserlaunchers.LauncherUtils.deleteTryTr
at org.openqa.selenium.server.browserlaunchers.LauncherUtils.deleteTryTr
at org.openqa.selenium.server.browserlaunchers.LauncherUtils.deleteTryTr
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.rem
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.clo

I tried manually deleting the lock file. (I had to kill Firefox first.). Then I reran the selinium tests. It still does not work. I think I will skip this step for now.

Going through #roo docs. ten-minutes example worked (took longer than 10 minutes).. clinic sample did not work (circular ref). Going on to tutorial.

stay tuned... more to come...

Monday, February 8, 2010

completion not completio


the first time you press TAB you'd see the inline help and the completio options

should read

the first time you press TAB you'd see the inline help and the completion options

Side note:

Inbuilt? I have heard of builtin, but inbuilt seems an odd word.

in reference to: http://static.springsource.org/spring-roo/reference/html/usage.html#usage-shell (view on Google Sidewiki)

Roo itself do not require Maven

"Roo itself do not require Maven."

should read

"Roo itself does not require Maven."

Unless Roo is like sheep and can also be plural.

in reference to: http://static.springsource.org/spring-roo/reference/html/intro.html#intro-installation (view on Google Sidewiki)

Facebook versus Twitter

Facebook is for your friends. Twitter is for people you may never be friends with or know personally, but you still share a common interests.

Twitter is for making friends.
Facebook is for friends that you have made.

in reference to: Twitter / Home (view on Google Sidewiki)

Wednesday, February 3, 2010

Got some help and this is what worked for me

I got some help running this for NetBeans 6.8 profiler with JBoss 4.0.5 on CentOS 4.5.

Here is what worked for me.

in reference to: http://profiler.netbeans.org/docs/help/5.5/j2ee_server_integration.html (view on Google Sidewiki)

Using JIP with JBoss on Linux

I downloaded and unzip to the following directory:


Go to where you have JBoss installed
Copied run.sh to profile.sh
Add another JAVA_OPTS environment variable to profile.sh

JAVA_OPTS=" -javaagent:/home/corventis/tools/jip/profile/profile.jar -Dprofile.properties=/home/corventis/tools/jip/profile/jboss.profile.properties $JAVA_OPTS"

Use profile.sh to start JBoss instead of run.sh.

In the JIP directory run the following:

bash-3.00$ ./file.sh localhost 15599 /home/corventis/profile.xml

To start profiling use the following:

bash-3.00$ ./start.sh localhost 15599

When you are done testing:

bash-3.00$ ./finish.sh localhost 15599

Then run the JIP viewer to view the output:

bash-3.00$ java -jar ~/tools/jip/client/jipViewer.jar ~/profile.xml

in reference to: http://jiprof.sourceforge.net/ (view on Google Sidewiki)

Using NetBean's profiler with JBoss

I am trying to configure NetBeans 6.8 with JBoss 4.0.5 running on JDK 1.5.

These instructions are only valid for NetBean's 5.5... (http://profiler.netbeans.org/docs/help/5.5/j2ee_server_integration.html(view on Google Sidewiki)) Where are the instructions for NetBean's 6.8?

The instructions state the following:

For JDK 5/6, add the following single line

The profiler lib is no longer under modules/profiler1... you can find it as follows:

I found it well enough.


JAVA_OPTS="-Dprogram.name=$PROGNAME -Dcom.sun.management.jmxremote $JAVA_OPTS"

JAVA_OPTS="-agentpath:$PROFILER_LIBS/deployed/jdk15/linux/libprofilerinterface.so=$PROFILER_LIBS,$AGENT_PORT $JAVA_OPTS"

Ok.. that did not work...

I changed JAVA_OPTS as follows:

JAVA_OPTS="-agentpath:/home/corventis/netbeans-6.8/profiler3/lib/deployed/jdk15/linux/libprofilerinterface.so=$PROFILER_LIBS,7676 $JAVA_OPTS"

Now I get... Exception Profiler Agent Warning: Native bind failed to lookup org.netbeans.lib.profiler.server.ProfilerRuntimeMemory class!!!

I guess this is progress. It now says it can't find the jar files.

So looking up the above error message gives me this...


This seems to have the answer.

Where did you get this commandline? It is incorrect. It should be:

/usr/lib/jvm/java-1.5.0-sun/bin/java -agentpath:/usr/local/netbeans/
profiler3/lib/deployed/jdk15/linux/libprofilerinterface.so -
org.netbeans.lib.profiler.server.ProfilerServer /usr/local/netbeans/
profiler3/lib/deployed/jdk15/linux 5141 10 ____Profiler+Calibration

So now I try this....

JAVA_OPTS="-Dprogram.name=$PROGNAME -Dcom.sun.management.jmxremote $JAVA_OPTS"
JAVA_OPTS="-agentpath:/home/corventis/netbeans-6.8/profiler3/lib/deployed/jdk15/linux/libprofilerinterface.so=$PROFILER_LIBS,7676 -Xbootclasspath/a:/home/corventis/netbeans-6.8/profiler3/lib/jfluid-server-15.jar:/home/corventis/netbeans-6.8/profiler3/lib/jfluid-server.jar $JAVA_OPTS"

And I get this...

java.lang.UnsatisfiedLinkError: Can't load library: /deployed/jdk15/linux/libprofilerinterface.so
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1650)
at java.lang.Runtime.load0(Runtime.java:769)
at java.lang.System.load(System.java:968)
at org.netbeans.lib.profiler.server.ProfilerServer.loadNativeLibrary(ProfilerServer.java:818)
at org.netbeans.lib.profiler.server.ProfilerServer.doActivate(ProfilerServer.java:873)
at org.netbeans.lib.profiler.server.ProfilerServer.activate(ProfilerServer.java:511)
profile.sh: unused non-option argument: default
14:45:02,768 INFO [Server] Starting JBoss (MX MicroKernel)...

Not sure why iin reference to: http://profiler.netbeans.org/docs/help/5.5/j2ee_server_integration.html (view on Google Sidewiki)

Kafka and Cassandra support, training for AWS EC2 Cassandra 3.0 Training