In my previous article, Achieving Nirvana on Mac OS X, I set up a Nirvana server on port 8887 and imported a realm for the TradeSpace demo. The TradeSpace demo instructions had impudently asked me to run two .BAT scripts,
startall.bat, and when we left off, I performed manually the equivalent operations for the former. Today I will tackle the latter which, according to the instructions, will create and populate the demonstration news and rates channels in our Nirvana realm.
The script contains only two simple lines to run two other scripts,
startrates.bat, and thankfully these secondary scripts are short and sweet. Inspecting them, .BAT-style
rem comments redacted:
java -cp "%CLASSPATH%;..\classes" -DRNAME=nhps://showcase.my-channels.com:443 -DRNAME2=nsp://localhost:9000 -DCHANNAME=/showcase/consolidatedrss com.pcbsys.demos.feedsimulators.NewsFeeder
java -cp "%CLASSPATH%;..\classes" -DRNAME=nsp://localhost:9000 -DRNAME2=nsp://localhost:9000 -DCHANNAME=/showcase/stockindices com.pcbsys.demos.feedsimulators.Stockindices
It is clear I must run two Java programs. Unfortunately, my herculean efforts to run them from the terminal end as assorted failures, from Java classpath issues to brutal Mac OS X crashes (see Figure 1).
Instead, I launch Eclipse, create a Java project, and add the Java source from the TradeSpace demo package (in my case,
~/Sites/nirvana/demo/src/java/tradespace). I also add three entries to the build path:
- External Class Folder –
- External JAR –
- External JAR –
Now I create two launch configurations:
I launch both configurations in debug mode. Inspecting the Nirvana Enterprise Manager, I can see activity in the Event History chart and the Event Status table. I navigate to
http://localhost:8887/ in a browser once again and click on the Flex link under the Web Client Demos section. The Flex client starts up and loads the news and rates data (see Figure 2). Voilà.