1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
|
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE- 2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<!-- generateKeywords macro -->
<META name="description" content="Apache Tuscany">
<META name="keywords" content="apache, apache tuscany, tuscany, service, services, fabric, soa, service oriented architecture, sca, service component architecture, das, sdo, csa, ruby, opensource">
<!-- generateKeywords macro end -->
<LINK type="text/css" rel="stylesheet" href="http://tuscany.apache.org/stylesheets/default.css">
<LINK rel="SHORTCUT ICON" href="https://cwiki.apache.org/confluence/display/TUSCANY/$images/favicon.ico">
<TITLE>Apache Tuscany : Federation Notes</TITLE>
<META http-equiv="Content-Type" content="text/html;charset=UTF-8"></HEAD>
<BODY onload="init()">
<!-- topNav macro -->
<TABLE valign="top" border="0" cellspacing="0" cellpadding="0" width="100%" background="http://tuscany.apache.org/images/TuscanyLogoNEW_Text_120px_bg.jpg">
<TR>
<TD valing="top" align="left">
<A href="https://cwiki.apache.org/confluence/pages/viewpage.action?spaceKey=TUSCANY&title=$siteroot"><IMG src="http://tuscany.apache.org/images/TuscanyLogoNEW_Text_120px_bg.jpg" height="91" width="25" border="0"></A>
</TD>
<TD>
<A href="http://tuscany.apache.org/"><IMG src="http://tuscany.apache.org/images/TuscanyLogo.jpg" border="0"></A>
</TD>
<TD width="100%">
</TD>
<!-- Adds the edit page link to the top banner-->
<TD valign="bottom">
<DIV style="padding: 2px 10px; margin: 0px;">
<A href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=49982">
<IMG src="http://tuscany.apache.org/images/notep_16.gif" height="16" width="16" border="0" align="absmiddle" title="Edit Page"></A>
</DIV>
</TD>
</TR>
</TABLE>
<!-- topNav macro end -->
<!-- breadCrumbs macro -->
<TABLE border="0" cellpadding="2" cellspacing="0" width="100%">
<TR class="topBar">
<TD align="left" valign="middle" class="topBarDiv" nowrap="true" width="100%">
<A href="home.html" title="Apache Tuscany">Apache Tuscany</A> > <A href="home.html" title="Home">Home</A> > <A href="sca-overview.html" title="SCA Overview">SCA Overview</A> > <A href="sca-java.html" title="SCA Java">SCA Java</A> > <A href="sca-java-work-in-progress.html" title="SCA Java Work-In-Progress">SCA Java Work-In-Progress</A> > <A href="" title="Federation Notes">Federation Notes</A>
</TD>
<TD align="right" valign="middle" class="topBarDiv" align="left" nowrap="true">
<A href="http://mail-archives.apache.org/mod_mbox/tuscany-user">User List</A> | <A href="http://mail-archives.apache.org/mod_mbox/tuscany-dev">Dev List</A> | <A href="http://issues.apache.org/jira/browse/Tuscany">Issue Tracker</A>
</TD>
</TR>
</TABLE>
<!-- breadCrumbs macro end -->
<TABLE border="0" cellpadding="0" width="100%" bgcolor="#FFFFFF">
<TR>
<TD align="left" valign="top">
<!-- pageContent macro -->
<DIV id="PageContent">
<DIV class="pagecontent">
<DIV class="wiki-content">
<P>Pulling together notes on what has been build to support federation in the tunk as it stands (just after TSS demo - March 07)</P>
<H2><A name="FederationNotes-References"></A>References</H2>
<P>Raymond's architecture guide <A href="http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany%20Architecture%20Guide" class="external-link" rel="nofollow">http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+Architecture+Guide</A><BR>
Some discussions from the dev list about contributio, discovery, federation and the TSS demo:</P>
<UL>
<LI>First talk of contribution and assembly service <A href="http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200701.mbox/%3CE38CFB43-CEB5-456F-BDDD-C25BFFC3C238@apache.org%3E" class="external-link" rel="nofollow">http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200701.mbox/%3cE38CFB43-CEB5-456F-BDDD-C25BFFC3C238@apache.org%3e</A></LI>
<LI>Mangament service intro <A href="http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200701.mbox/%3CBAY105-F38054BAB691DCF4F15BA77DDB80@phx.gbl%3E" class="external-link" rel="nofollow">http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200701.mbox/%3cBAY105-F38054BAB691DCF4F15BA77DDB80@phx.gbl%3e</A></LI>
<LI>First talk of distributed/federated assemblies <A href="http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200701.mbox/%3C90B6915C-ED14-484A-873F-F26894C63DB2@apache.org%3E" class="external-link" rel="nofollow">http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200701.mbox/%3c90B6915C-ED14-484A-873F-F26894C63DB2@apache.org%3e</A></LI>
<LI>Resolve and verify phases of deployment <A href="http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200701.mbox/%3C2F2C595B-CCDA-4AB0-8BF9-A20CB4012F88@apache.org%3E" class="external-link" rel="nofollow">http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200701.mbox/%3c2F2C595B-CCDA-4AB0-8BF9-A20CB4012F88@apache.org%3e</A></LI>
<LI>JMX and standalone runtime <A href="http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200701.mbox/raw/%3C53EC6802E2BF4643BBD5BC34D2C3A38301B6C3F2@SPR3V4.office.local%3E/" class="external-link" rel="nofollow">http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200701.mbox/raw/%3c53EC6802E2BF4643BBD5BC34D2C3A38301B6C3F2@SPR3V4.office.local%3e/</A><BR>
<A href="http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200701.mbox/raw/%3CBAY105-F20D5A6A881D4A9A3ED3D45DDBD0@phx.gbl%3E/" class="external-link" rel="nofollow">http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200701.mbox/raw/%3cBAY105-F20D5A6A881D4A9A3ED3D45DDBD0@phx.gbl%3e/</A></LI>
<LI>Federated deployment<BR>
<A href="http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200701.mbox/%3CE6925252-9922-4A65-8867-2B0E2B2BFA67@apache.org%3E" class="external-link" rel="nofollow">http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200701.mbox/%3cE6925252-9922-4A65-8867-2B0E2B2BFA67@apache.org%3e</A><BR>
<A href="http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200701.mbox/%3CBAY105-F33CE29B9024EDBB20FCA09DDA70@phx.gbl%3E" class="external-link" rel="nofollow">http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200701.mbox/%3cBAY105-F33CE29B9024EDBB20FCA09DDA70@phx.gbl%3e</A><BR>
<A href="http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200702.mbox/%3C53EC6802E2BF4643BBD5BC34D2C3A38301E41C94@SPR3V4.office.local%3E" class="external-link" rel="nofollow">http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200702.mbox/%3c53EC6802E2BF4643BBD5BC34D2C3A38301E41C94@SPR3V4.office.local%3e</A></LI>
<LI>Federation demo startup<BR>
<A href="http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200703.mbox/%3CBAY105-F14D60CFBA31DA296B772EADD770@phx.gbl%3E" class="external-link" rel="nofollow">http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200703.mbox/%3cBAY105-F14D60CFBA31DA296B772EADD770@phx.gbl%3e</A></LI>
<LI>Meeraj code description<BR>
<A href="http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200703.mbox/%3CBAY105-F7123B0C05FE260B65B8D3DD750@phx.gbl%3E" class="external-link" rel="nofollow">http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200703.mbox/%3cBAY105-F7123B0C05FE260B65B8D3DD750@phx.gbl%3e</A></LI>
<LI>Meeraj note on running the demo<BR>
<A href="http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200703.mbox/%3C53EC6802E2BF4643BBD5BC34D2C3A3830279C142@SPR3V4.office.local%3E" class="external-link" rel="nofollow">http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200703.mbox/%3c53EC6802E2BF4643BBD5BC34D2C3A3830279C142@SPR3V4.office.local%3e</A></LI>
</UL>
<H2><A name="FederationNotes-BuildingTheDemo"></A>Building The Demo</H2>
<H3><A name="FederationNotes-FromTheTSSTag"></A>From The TSS Tag</H3>
<P>Follow instructions in README.txt here <A href="http://svn.apache.org/repos/asf/incubator/tuscany/java/distribution/sca/tsss-demo/" class="external-link" rel="nofollow">http://svn.apache.org/repos/asf/incubator/tuscany/java/distribution/sca/tsss-demo/</A><BR>
Unzip the resulting demo zip file<BR>
Meeraj's discussion of switching from JXTA to JSM <A href="http://www.mail-archive.com/tuscany-dev@ws.apache.org/msg15731.html" class="external-link" rel="nofollow">http://www.mail-archive.com/tuscany-dev@ws.apache.org/msg15731.html</A><BR>
I had problems in that some of the required dependency JARs were missing. I copied:</P>
<UL>
<LI>tuscany-jms-discovery-0.1-incubating-SNAPSHOT.jar</LI>
<LI>apache-activemq-4.1.0-incubator.jar</LI>
<LI>tuscany-http-jetty-0.1-incubating-SNAPSHOT.jar</LI>
<LI>jetty-6.1.0.jar</LI>
<LI>jetty-util-6.1.0.jar</LI>
<LI>tuscany-sca-console-0.1-incubating-SNAPSHOT.jar</LI>
<LI>geronimo-j2ee-connector_1.5_spec-1.0.jar</LI>
</UL>
<P>into each of the profiles boot directories</P>
<H3><A name="FederationNotes-ManuallyFromHead"></A>Manually From Head</H3>
<P>I couldn't get this to work as the core tests now fail</P>
<H2><A name="FederationNotes-DebuggingTheDemo"></A>Debugging The Demo</H2>
<P>When run originally the demo complained about missing dependencies. In particular when reading the system components (root.system) I got the error:</P>
<P>org.apache.tuscany.host.runtime.InitializationException: org.apache.tuscany.spi.<BR>
component.GroupInitializationException: sca://root.system/main<BR>
at org.apache.tuscany.core.runtime.AbstractRuntime.initialize(AbstractRu<BR>
ntime.java)<BR>
at org.apache.tuscany.standalone.server.TuscanyServer.startRuntime(Tusca<BR>
nyServer.java:134)</P>
<P>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. </P>
<P>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:</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
<SPAN class="code-object">System</SPAN>.out.println(<SPAN class="code-quote">"press a key"</SPAN>);
java.io.BufferedReader stdin = <SPAN class="code-keyword">new</SPAN> java.io.BufferedReader(<SPAN class="code-keyword">new</SPAN> java.io.InputStreamReader(<SPAN class="code-object">System</SPAN>.in));
<SPAN class="code-object">String</SPAN> line = stdin.readLine();
</PRE>
</DIV></DIV>
<P>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.</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
java -Xrunjdwp:server=y,transport=dt_socket,address=4142,suspend=n -Dtuscany.adminPort=2000 -jar server.start.jar ma
ster
</PRE>
</DIV></DIV>
<P>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. </P>
<H2><A name="FederationNotes-TurningLoggingOn"></A>Turning Logging On</H2>
<P>Its 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.</P>
<H2><A name="FederationNotes-RunningTheDemo"></A>Running The Demo</H2>
<P>(From Meeraj's post on the subject)<BR>
This is how you start the servers (Please make sure you start ActiveMQ<BR>
before you start the servers) .</P>
<P>Master: java -Dtuscany.adminPort=2000 -jar server.start.jar master<BR>
Slave1: java -Dtuscany.adminPort=3000 -jar server.start.jar slave1<BR>
Slave2: java -Dtuscany.adminPort=4000 -jar server.start.jar slave2</P>
<P>You can access the admin console from <A href="http://localhost:7000/scdlForm" class="external-link" rel="nofollow">http://localhost:7000/scdlForm</A> and<BR>
if you target the deployed SCDL to slave1, access the demo appilcation<BR>
from <A href="http://localhsot:8000/calculatorForm" class="external-link" rel="nofollow">http://localhsot:8000/calculatorForm</A>. The test scdl is as follows<BR>
(this is what you submit from the admin console to target a deployment<BR>
to a slave),</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-xml">
<composite xmlns=<SPAN class="code-quote">"http://www.osoa.org/xmlns/sca/1.0"</SPAN>
<SPAN class="code-keyword">xmlns:tuscany</SPAN>=<SPAN class="code-quote">"http://tuscany.apache.org/xmlns/sca/2.0-alpha"</SPAN>
name=<SPAN class="code-quote">"CalculatorComposite"</SPAN>>
<SPAN class="code-tag"><component runtimeId=<SPAN class="code-quote">"slave1"</SPAN> name=<SPAN class="code-quote">"CalculatorServiceComponent"</SPAN>></SPAN>
<SPAN class="code-tag"><implementation.java class=<SPAN class="code-quote">"calculator.CalculatorServiceImpl"</SPAN>/></SPAN>
<SPAN class="code-tag"><reference name=<SPAN class="code-quote">"addService"</SPAN> target=<SPAN class="code-quote">"AddServiceComponent"</SPAN>/></SPAN>
<reference name=<SPAN class="code-quote">"subtractService"</SPAN>
target=<SPAN class="code-quote">"SubtractServiceComponent"</SPAN>/>
<reference name=<SPAN class="code-quote">"multiplyService"</SPAN>
target=<SPAN class="code-quote">"MultiplyServiceComponent"</SPAN>/>
<reference name=<SPAN class="code-quote">"divideService"</SPAN>
target=<SPAN class="code-quote">"DivideServiceComponent"</SPAN>/>
<SPAN class="code-tag"></component></SPAN>
<SPAN class="code-tag"><component runtimeId=<SPAN class="code-quote">"slave1"</SPAN> name=<SPAN class="code-quote">"AddServiceComponent"</SPAN>></SPAN>
<SPAN class="code-tag"><implementation.java class=<SPAN class="code-quote">"calculator.AddServiceImpl"</SPAN>/></SPAN>
<SPAN class="code-tag"></component></SPAN>
<SPAN class="code-tag"><component runtimeId=<SPAN class="code-quote">"slave1"</SPAN> name=<SPAN class="code-quote">"SubtractServiceComponent"</SPAN>></SPAN>
<SPAN class="code-tag"><implementation.java class=<SPAN class="code-quote">"calculator.SubtractServiceImpl"</SPAN>/></SPAN>
<SPAN class="code-tag"></component></SPAN>
<SPAN class="code-tag"><component runtimeId=<SPAN class="code-quote">"slave1"</SPAN> name=<SPAN class="code-quote">"MultiplyServiceComponent"</SPAN>></SPAN>
<SPAN class="code-tag"><implementation.java class=<SPAN class="code-quote">"calculator.MultiplyServiceImpl"</SPAN>/></SPAN>
<SPAN class="code-tag"></component></SPAN>
<SPAN class="code-tag"><component runtimeId=<SPAN class="code-quote">"slave1"</SPAN> name=<SPAN class="code-quote">"DivideServiceComponent"</SPAN>></SPAN>
<SPAN class="code-tag"><implementation.java class=<SPAN class="code-quote">"calculator.DivideServiceImpl"</SPAN>/></SPAN>
<SPAN class="code-tag"></component></SPAN>
<SPAN class="code-tag"></composite></SPAN>
</PRE>
</DIV></DIV>
<P>Here is the actual sequence of events:</P>
<P>Start ActiveMQ</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
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
</PRE>
</DIV></DIV>
<P>Each of these just reports "Started" on the command line</P>
<P>Go to <A href="http://localhost:7000/scdlForm" class="external-link" rel="nofollow">http://localhost:7000/scdlForm</A> in a browser and paste in the SCDL from above to configure slave1 to create and wire the calculator components.</P>
<P>Go to <A href="http://localhsot:8000/calculatorForm" class="external-link" rel="nofollow">http://localhsot:8000/calculatorForm</A> in a browser and see the form that drives the calculator sample. Type in a couple of numbers and press Add.</P>
</DIV>
</DIV>
</DIV>
<!-- pageContent macro end -->
</TD>
</TR>
</TABLE>
<!-- footer macro -->
<SCRIPT src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</SCRIPT>
<SCRIPT type="text/javascript">
_uacct = "UA-1174707-5";
urchinTracker();
</SCRIPT>
<A href="http://www.statcounter.com/" target="_blank"><IMG src="http://c26.statcounter.com/counter.php?sc_project=2619156&java=0&security=94bd7e7d&invisible=0" alt="website stats" border="0"></A>
<DIV class="footer">
Copyright � 2003-2012, The Apache Software Foundation </BR>
Apache Tuscany and the Apache Tuscany project logo are trademarks of The Apache Software Foundation.
</DIV>
<!-- footer macro end -->
</BODY>
</HTML>
|