Apache Tuscany > Home > SCA Overview > SCA Java > SCA Java Work-In-Progress > Federation Notes | User List | Dev List | Issue Tracker |
Pulling together notes on what has been build to support federation in the tunk as it stands (just after TSS demo - March 07) ReferencesRaymond's architecture guide http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+Architecture+Guide
Building The DemoFrom The TSS TagFollow instructions in README.txt here http://svn.apache.org/repos/asf/incubator/tuscany/java/distribution/sca/tsss-demo/
into each of the profiles boot directories Manually From HeadI couldn't get this to work as the core tests now fail Debugging The DemoWhen run originally the demo complained about missing dependencies. In particular when reading the system components (root.system) I got the error: org.apache.tuscany.host.runtime.InitializationException: org.apache.tuscany.spi. What this actually means is that Tuscany failed to load one of the system components successfully but, by default, doesn't tell what the issue is. I wanted to use Eclipse to debug it so I played about a bit but couldn't get the java -jar command line to come up in the Eclipse debugger. As a fall back I started a remote debugging session. There were three steps to this. Add a trap to the code to give me a chance to attach the debugger. I added the following lines to the mainline of the: System.out.println("press a key"); java.io.BufferedReader stdin = new java.io.BufferedReader(new java.io.InputStreamReader(System.in)); String line = stdin.readLine(); Start java app with remote debugging enabled. There are plenty of references on the web on how to do this. Here is the comman line I used to start the master profile. java -Xrunjdwp:server=y,transport=dt_socket,address=4142,suspend=n -Dtuscany.adminPort=2000 -jar server.start.jar ma ster When the app comes up and stops at the trap connect the Eclipse debugger by selecting the remote debugging profile and specifying localhost:4142 as the connection details. The port number (4142) just comes from that specified on the application command line. Turning Logging OnIts not clear how to do this just yet. Meeraj suggests that the missing nested exception detail can be printed out by specifying a log formatter. TODO. Running The Demo(From Meeraj's post on the subject) Master: java -Dtuscany.adminPort=2000 -jar server.start.jar master You can access the admin console from http://localhost:7000/scdlForm and <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/2.0-alpha" name="CalculatorComposite"> <component runtimeId="slave1" name="CalculatorServiceComponent"> <implementation.java class="calculator.CalculatorServiceImpl"/> <reference name="addService" target="AddServiceComponent"/> <reference name="subtractService" target="SubtractServiceComponent"/> <reference name="multiplyService" target="MultiplyServiceComponent"/> <reference name="divideService" target="DivideServiceComponent"/> </component> <component runtimeId="slave1" name="AddServiceComponent"> <implementation.java class="calculator.AddServiceImpl"/> </component> <component runtimeId="slave1" name="SubtractServiceComponent"> <implementation.java class="calculator.SubtractServiceImpl"/> </component> <component runtimeId="slave1" name="MultiplyServiceComponent"> <implementation.java class="calculator.MultiplyServiceImpl"/> </component> <component runtimeId="slave1" name="DivideServiceComponent"> <implementation.java class="calculator.DivideServiceImpl"/> </component> </composite> Here is the actual sequence of events: Start ActiveMQ java -Dtuscany.adminPort=2000 -jar server.start.jar master java -Dtuscany.adminPort=3000 -jar server.start.jar slave1 java -Dtuscany.adminPort=4000 -jar server.start.jar slave2 Each of these just reports "Started" on the command line Go to http://localhost:7000/scdlForm in a browser and paste in the SCDL from above to configure slave1 to create and wire the calculator components. Go to http://localhsot:8000/calculatorForm in a browser and see the form that drives the calculator sample. Type in a couple of numbers and press Add. |