summaryrefslogtreecommitdiffstats
path: root/site/trunk/site-publish/tuscany-sca-java-faq.html
blob: b71cdb921fc473147ea33d4450609d710d97b43b (plain)
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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
<!--

    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 : Tuscany SCA Java - FAQ</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%">
					&nbsp;
				</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=35040">
						<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%">
					&nbsp;<A href="home.html" title="Apache Tuscany">Apache Tuscany</A>&nbsp;&gt;&nbsp;<A href="home.html" title="Home">Home</A>&nbsp;&gt;&nbsp;<A href="sca-overview.html" title="SCA Overview">SCA Overview</A>&nbsp;&gt;&nbsp;<A href="sca-java.html" title="SCA Java">SCA Java</A>&nbsp;&gt;&nbsp;<A href="" title="Tuscany SCA Java - FAQ">Tuscany SCA Java - FAQ</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>&nbsp;&nbsp;
				</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">
								<TABLE class="sectionMacroWithBorder" border="0" cellpadding="5" cellspacing="0" width="100%"><TBODY><TR>
<TD class="confluenceTd" valign="top" width="15%">
<DIV class="panel" style="background-color: #ECF4D1;border-color: #C3CDA1;border-style: solid;border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #C3CDA1;background-color: #C3CDA1;"><B>General</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1;">
<P><A href="home.html" title="Home">Home</A><BR>
<A href="http://www.apache.org/licenses/LICENSE-2.0.html" class="external-link" rel="nofollow">License </A><BR>
<A href="sca-java-get-involved.html" title="SCA Java Get Involved">Get Involved</A><BR>
<A href="sca-java-found-a-bug.html" title="SCA Java Found A Bug">Found a Bug?</A></P>
</DIV></DIV>

<DIV class="panel" style="background-color: #ECF4D1;border-color: #b4b4b5;border-style: solid;border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #b4b4b5;background-color: #C3CDA1;"><B>SCA Java</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1;">
<P><A href="sca-java.html" title="SCA Java">SCA Java Home</A><BR>
<A href="tuscany-dashboard.html" title="Tuscany Dashboard">SCA Dashboard</A><BR>
<A href="java-sca-tools.html" title="Java SCA Tools">Tools </A><BR>
<A href="" title="Tuscany SCA Java - FAQ">FAQ</A></P>
</DIV></DIV>

<DIV class="panel" style="background-color: #ECF4D1;border-color: #b4b4b5;border-style: solid;border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #b4b4b5;background-color: #C3CDA1;"><B>SCA Java 1.x</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1;">
<P><A href="sca-java-releases.html" title="SCA Java Releases">Downloads</A><BR>
<A href="java-sca-documentation-menu.html" title="Java SCA Documentation Menu">Documentation</A><BR>
<A href="https://svn.apache.org/repos/asf/tuscany/sca-java-1.x/trunk/" class="external-link" rel="nofollow">1.x Source Code</A><BR>
<A href="http://tinyurl.com/8rlxd3" class="external-link" rel="nofollow">Roadmap</A></P>
</DIV></DIV>

<DIV class="panel" style="background-color: #ECF4D1;border-color: #b4b4b5;border-style: solid;border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #b4b4b5;background-color: #C3CDA1;"><B>SCA Java 2.x</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1;">
<P><A href="sca-java-2x-releases.html" title="SCA Java 2.x Releases">Downloads</A><BR>
<A href="http://tuscany.apache.org/documentation-2x/" class="external-link" rel="nofollow">Documentation</A><BR>
<A href="https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/" class="external-link" rel="nofollow">2.x Source Code</A><BR>
<A href="http://tinyurl.com/8rlxd3" class="external-link" rel="nofollow">Roadmap</A></P>
</DIV></DIV>
</TD>
<TD class="confluenceTd" valign="top" width="85%">
<P>Welcome to the Apache Tuscany Java SCA FAQ page. Please help to keep the information on this page current.</P>

<P><BR class="atl-forced-newline"></P>
<DIV class="panel" style="background-color: #ECF4D1;border-color: #C3CDA1;border-style: solid;border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #C3CDA1;background-color: #C3CDA1;"><B>Apache Tuscany SCA Frequently Asked Questions</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1;">
<UL>
	<LI><A href="#TuscanySCAJava-FAQ-BuildQuestions">Build and Development Questions</A>
	<UL>
		<LI><A href="#TuscanySCAJava-FAQ-BuildA">What version of Java do I need? </A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-BuildB">What version of Maven do I need? </A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-BuildC">Why does the Tuscany code I checked out of Subversion not build? </A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-BuildD">Java Heap Error during compilation</A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-BuildDa">Java PermGen Error during compilation</A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-BuildE">How do I generate Eclipse projects from the source distribution or from Subversion trunk?</A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-BuildF">How do I generate an Eclipse WTP project for the WebApp samples?</A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-BuildG">When running the WSConfidentialityTestCase using IBM JDK I experience java.lang.ExceptionInInitializerError arising from the base java.security.InvalidKeyException: Public key presented not for certificate signature - how do I get over this?</A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-BuildH">How do I run the samples from a release candidate before the maven artifacts have been published?</A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-BuildI">How do I turn on more trace output?</A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-BuildJ">How do I remote debug Tuscany Java SCA applications from Eclipse?</A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-BuildK">Maven locks up during a build. What's going on?</A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-BuildL">When deploying war into Tomcat, I get failure?</A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-BuildM">Build stops because of test failure, what to do?</A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-BuildN">Is there a public build of Apache Tuscany?</A></LI>
	</UL>
	</LI>
	<LI><A href="#TuscanySCAJava-FAQ-ImplementationJavaQuestions">Implementation Java Questions</A>
	<UL>
		<LI><A href="#TuscanySCAJava-FAQ-ImplementationJavaA">What is the format for specifying multiple interfaces with the @Service annotation? </A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-ImplementationJavaB">Why are references not being injected into my component? </A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-ImplementationJavaC">How to deploy EJBs (stateless session bean, EJB2) in Tuscany? </A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-ImplementationJavaD">Is it possible to use the calculator-distributed example to run on multiple hosts? </A></LI>
	</UL>
	</LI>
	<LI><A href="#TuscanySCAJava-FAQ-BindingQuestions">Binding Questions</A>
	<UL>
		<LI><A href="#TuscanySCAJava-FAQ-BindingA">Can I use the EJB binding to publish an SCA services as an SLSB? </A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-BindingB">How to return application exception in RMI binding? </A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-BindingC">Is it possible to configure Tuscany to expose a service (e.g. JSON-RPC) that communicates over https? If yes then how to achieve this?</A></LI>
	</UL>
	</LI>
	<LI><A href="#TuscanySCAJava-FAQ-DataBindingQuestions">DataBinding Questions</A>
	<UL>
		<LI><A href="#TuscanySCAJava-FAQ-DataBindingA">What is the difference between Logical Type and Physical Type?</A></LI>
	</UL>
	</LI>
	<LI><A href="#TuscanySCAJava-FAQ-ContributionQuestions">Contribution Questions</A>
	<UL>
		<LI><A href="#TuscanySCAJava-FAQ-ContributionA">What is META-INF/sca-contribution.xml for?</A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-ContributionB">What is What is META-INF/sca-deployables/ for?</A></LI>
	</UL>
	</LI>
	<LI><A href="#TuscanySCAJava-FAQ-PolicyFrameworkQuestions">Policy Framework Questions</A>
	<UL>
		<LI><A href="#TuscanySCAJava-FAQ-PolicyA">What is the level of policy support in Tuscany Release 1.0 ?</A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-PolicyB">How do I try out the 'confidentiality' policy intent for my webservice binding ?</A></LI>
	</UL>
	</LI>
	<LI><A href="#TuscanySCAJava-FAQ-SpecificationQuestions">Specification Questions</A>
	<UL>
		<LI><A href="#TuscanySCAJava-FAQ-SpecificationA">Where are the specifications that Tuscany implements?</A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-SpecificationB">what does the promote keyword in the composite file mean?</A></LI>
	</UL>
	</LI>
	<LI><A href="#TuscanySCAJava-FAQ-HostingQuestions">Hosting Questions</A>
	<UL>
		<LI><A href="#TuscanySCAJava-FAQ-HostingA">WebSphere - java.lang.ClassNotFoundException: org.apache.tuscany.sca.host.webapp.WebSCADomain?</A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-HostingB">WebSphere - java.lang.IllegalArgumentException: http://www.w3.org/2001/XMLSchema?</A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-HostingC">WebSphere - java.net.ConnectException: Connection refused: connect</A></LI>
	</UL>
	</LI>
	<LI><A href="#TuscanySCAJava-FAQ-GeneralSCAQuestions">General SCA Questions</A>
	<UL>
		<LI><A href="#TuscanySCAJava-FAQ-GetTargetName">Get Target Name From Composite without parsing? </A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-DuplicateComponentInComposite">Deploying composites with similar component names</A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-SCAInterfaceExtension">How is the SCA Interface Extension used in SCA environment?</A></LI>
		<LI><A href="#TuscanySCAJava-FAQ-SCABenefits">What are the benefits of designing applications using SCA?</A></LI>
	</UL>
	</LI>
	<LI><A href="#TuscanySCAJava-FAQ-Didn%2527tFindit">Didn't Find My Answer</A></LI>
</UL>


<P>&nbsp;</P>
</DIV></DIV>

<H2><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-BuildQuestions"></A></H2>

<DIV class="" style="background-color: #C3CDA1;">Build Questions</DIV>


<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-BuildA"></A></H3>

<DIV class="" style="background-color: #C3CDA1;">What version of Java do I need?</DIV>

<P>Both IBM and Sun JDK 1.5 are known to work and are used regularly by our development community.</P>

<P>JDK1.4 will not work as the Tuscany SCA code base relies on some of the features of JDK1.5 such as generics and annotations.</P>

<P>JDK1.6 can be problematic depending on what version you are running with. The problems are usually due to bundled versions of either STaX or JAXB  being in conflict with the versions we are using in Tuscany.</P>

<P>If you are getting errors that look like the following stack trace</P>

<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
<PRE>java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI 
       (from jar:file:/home/jim/.m2/repository/com/sun/xml/bind/jaxb-impl/2.1.5/jaxb-impl-2.1.5.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) 
       needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. 
       (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)
       at com.sun.xml.bind.v2.model.impl.ModelBuilder.&lt;clinit&gt;(ModelBuilder.java:172)
       at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:422)
       at com.sun.xml.bind.v2.runtime.JAXBContextImpl.&lt;init&gt;(JAXBContextImpl.java:286)
       at com.sun.tools.xjc.reader.xmlschema.bindinfo.BindInfo.getJAXBContext(BindInfo.java:332)
</PRE>
</DIV></DIV>

<P>Then it's related to JDK 6 shipping with its own version of JAXB impl. Up to JDK 6 Update 3, the JDK ships with JAX-WS 2.0 (which includes JAXB 2.0), but Tuscany requires JAXB 2.1. There are some possible solutions to this problem:</P>

<OL>
	<LI>Upgrade your JDK to 1.6.0_04 or above, which will include JAX-WS (and JAXB) 2.1</LI>
	<LI>Copy the version 2.1 jaxb-api.jar or jaxws-api.jar (you can probably find them in your local maven repo) to &lt;JAVA_HOME&gt;/lib/endorsed to override the API jars that ship with the JDK</LI>
	<LI>Use the -Djava.endorsed.dir=&lt;a folder containing our JAXB jars&gt; to override the JAXB from JDK 6.</LI>
</OL>


<P>If you see an error like the following </P>

<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
<PRE>javax.xml.stream.FactoryConfigurationError: Provider
javax.xml.stream.XMLInputFactory could not be
instantiated: java.lang.InstantiationException
at
javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:158)
</PRE>
</DIV></DIV>

<P>It's the same problem but related to the version of the STaX API in use. TODO - locate the specific jar that causes the problem</P>

<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-BuildB"></A></H3>

<DIV class="" style="background-color: #C3CDA1;">What version of Maven do I need?</DIV>

<P>To build the Apache Tuscany source code that you have checked out of subversion you need to install Maven. The build is know to work relatively reliably with Maven 2.0.5. People have had it working with later versions but it you are encountering unpredicatbility in the build then give 2.0.5 a go.</P>

<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-BuildC"></A></H3>

<DIV class="" style="background-color: #C3CDA1;">Why does the Tuscany code I checked out of Subversion not build?</DIV>

<P>If you are taking code out of the trunk of the Tuscany Subversion repository then you may have been unlucky and picked up a revision of the code where the build is broken. As trunk is where the development takes place this happens now and again although the development community tries to avoid build breaks if at all possible and tries to fix them quickly when they do happen.</P>

<P>There are may and various other things that can cause your build to break. Its worth checking on the mail list that the trunk is building. Assuming that it is we will usually ask you to do the following as a basic level set.</P>

<P>Stop any IDE you may have running<BR>
Check out the latest trunk revision</P>

<P> cd mytuscanydir<BR>
 svn checkout <A href="https://svn.apache.org/repos/asf/incubator/tuscany/java/" class="external-link" rel="nofollow">https://svn.apache.org/repos/asf/incubator/tuscany/java/</A></P>

<P>or (if you already have a version of the code)</P>

<P> svn update <A href="https://svn.apache.org/repos/asf/incubator/tuscany/java/" class="external-link" rel="nofollow">https://svn.apache.org/repos/asf/incubator/tuscany/java/</A></P>

<P>Clean all the maven projects</P>

<P> cd mytuscanydir/sca<BR>
 mvn clean</P>

<P>Remove all the sca artifacts from the local maven repository by removing (or renaming) all of the directories under</P>

<P> .m2\repository\org\apache\tuscany\sca</P>

<P>Rebuild sca</P>

<P> cd mytuscanydir/sca<BR>
 mvn</P>

<P>If it still doesn't work then get back on the mail list</P>

<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-BuildD"></A></H3>

<DIV class="" style="background-color: #C3CDA1;">Java Heap error during compilation</DIV>

<P>I always get a &quot;Java heap space&quot; error during the build while the itests are running these days. Runs fine if I build from within the itests folder but building from the top sca folder always fails.</P>

<P>try MAVEN_OPTS=&quot;-Xmx1024m &#45;Xms512m&quot; or You can also increase the memory options in the sca pom <A href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=TUSCANY&title=1&linkCreation=true&fromPageId=35040" class="createlink">1</A>, in the surefire plugin configuration section.</P>

<P><A href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=TUSCANY&title=1&linkCreation=true&fromPageId=35040" class="createlink">1</A> <A href="https://svn.apache.org/repos/asf/incubator/tuscany/java/sca/pom.xml" class="external-link" rel="nofollow">https://svn.apache.org/repos/asf/incubator/tuscany/java/sca/pom.xml</A></P>

<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-BuildDa"></A></H3>

<DIV class="" style="background-color: #C3CDA1;">Java PermGen error during compilation</DIV>

<P>I always get a similar to the following when compiling Tuscany SCA</P>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
java.lang.OutOfMemoryError: PermGen space
       at java.lang.<SPAN class="code-object">ClassLoader</SPAN>.defineClass1(Native Method)
       at java.lang.<SPAN class="code-object">ClassLoader</SPAN>.defineClass(Unknown Source)
</PRE>
</DIV></DIV>

<P>try MAVEN_OPTS=&quot;-XX:MaxPermSize=256m&quot;. This works on the Sun JDK6. Check the JDK document for other JDKs</P>

<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-BuildE"></A></H3>

<DIV class="" style="background-color: #C3CDA1;">How do I generate Eclipse projects from the source distribution or from Subversion trunk?</DIV>

<P>If you have unpacked the source distribution or have checked out all of the code under the tuscany/java/sca directory in subversion then you should end up with a source directory containing something like:</P>
<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
<PRE>demos
distribution
itest
modules
samples
tools
pom.xml
</PRE>
</DIV></DIV>
<P>You can build the source from using maven with the command</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
mvn
</PRE>
</DIV></DIV>
<P>If you are going to use Eclipse with the Tuscany code, first ensure that Eclipse is aware of your Maven setup, which you can do using the command</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
mvn -Declipse.workspace=&lt;path-to-eclipse-workspace&gt; eclipse:add-maven-repo
</PRE>
</DIV></DIV>
<P>For more details on using Eclipse with Maven, look at this page: <A href="http://maven.apache.org/guides/mini/guide-ide-eclipse.html" class="external-link" rel="nofollow">http://maven.apache.org/guides/mini/guide-ide-eclipse.html</A><BR>
You can then build Eclipse projects for all the modules in the project using the command</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
mvn -Peclipse eclipse:eclipse
</PRE>
</DIV></DIV>
<P>This builds &quot;.classpath&quot; and &quot;.project&quot; files for each modules. The easiest thing to do is import all of these generated projects. In Eclipse choose &quot;File/Import/Existing Projects Into Workspace&quot;. From the wizard select your source directory and Eclipse should now find all of the Eclipse projects that have been generated.</P>

<P>If you imported all modules into Eclipse you should find that project dependencies are satisfied by reference to other Tuscany SCA projects in your workspace. This is convenient for debugging as all Tuscany SCA source it now available in your workspace.</P>

<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-BuildF"></A></H3>

<DIV class="" style="background-color: #C3CDA1;">How do I generate an Eclipse WTP project for the WebApp samples?</DIV>

<P>If you're using Eclipse WTP and want to get WTP Web Projects generated for our Webapp samples you can simply pass a &#45;Dwtpversion=1.5 option tothe usual mvn eclipse:eclipse command, like this:</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
mvn -Dwtpversion=1.5 -Peclipse eclipse:eclipse
</PRE>
</DIV></DIV>
<P>The magic &#45;Dwtpversion=1.5 option will add the WTP Web project nature to all the Eclipse projects with &lt;packaging&gt;war&lt;/packaging&gt; in their Maven pom.xml. You'll then be able to add these projects to a WTP Tomcat or Geronimo Server configuration, to publish and run them straight from your Eclipse workspace.</P>

<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-BuildG"></A></H3>

<DIV class="" style="background-color: #C3CDA1;">When running the WSConfidentialityTestCase using IBM JDK I experience java.lang.ExceptionInInitializerError arising from the base java.security.InvalidKeyException: Public key presented not for certificate signature - how do I get over this?</DIV>

<P>To get over this exception please go over to the jre\lib\security\java.security of the IBM JDK installation and set up the security providers as follows.</P>
<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
<PRE>#
# List of providers and their preference orders:
#
security.provider.1=org.bouncycastle.jce.provider.BouncyCastleProvider
security.provider.3=com.ibm.jsse2.IBMJSSEProvider2
security.provider.2=com.ibm.crypto.provider.IBMJCE
security.provider.4=com.ibm.security.jgss.IBMJGSSProvider
security.provider.5=com.ibm.security.cert.IBMCertPath
security.provider.6=com.ibm.security.sasl.IBMSASL
</PRE>
</DIV></DIV>

<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-BuildH"></A></H3>
<DIV class="" style="background-color: #C3CDA1;">How do I run the samples from a release candidate before the maven artifacts have been published?</DIV>


<P>The samples in the binary distribution won't build with mvn till we actually release and the artifacts get published to the live maven repository. To test things you can bypass this by setting up a mirror pointing to the release candidate maven repository. You do that by adding the following to your maven settings.xml file:</P>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
   &lt;mirrors&gt;
    &lt;mirror&gt;
      &lt;id&gt;ant.staging&lt;/id&gt;
      &lt;url&gt;http:<SPAN class="code-comment">//people.apache.org/~antelder/tuscany/1.0-RC1a/maven&lt;/url&gt;
</SPAN>      &lt;mirrorOf&gt;apache.incubator&lt;/mirrorOf&gt;


    &lt;/mirror&gt;
</PRE>
</DIV></DIV>

<P>The settings.xml is in a .m2 folder in your home directory, eg mines at: &quot;C:\Documents and Settings\Administrator\.m2&quot;. If you don't have one then we've an example at: <A href="https://svn.apache.org/repos/asf/incubator/tuscany/java/etc/settings.xml" class="external-link" rel="nofollow">settings.xml</A></P>

<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-BuildI"></A></H3>
<DIV class="" style="background-color: #C3CDA1;">How do I turn on more trace output?</DIV>

<P>Tuscany uses the JDK logger for writing out info, warning etc. How much gets written out is controlled by a logging.properties file. We don't ship a file with Tuscany as we rely in the default INFO logging level that Java assumes. If you wan't to change the defaults then you can create (or edit) a logging.properties file in you jre/lib directory. Foe example, if you're using the IBM JDK you should end up with the file</P>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
C:\thedirwhereiinstalledjava\jre\lib\logging properties
</PRE>
</DIV></DIV>

<P>You might want to go and change the logging level by setting it to FINE to get more information generally</P>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
.level= FINE
</PRE>
</DIV></DIV>

<P>or for getting more information printed on the console</P>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
java.util.logging.ConsoleHandler.level = INFO
</PRE>
</DIV></DIV>

<P>See <A href="http://java.sun.com/j2se/1.4.2/docs/guide/util/logging/overview.html" class="external-link" rel="nofollow">here</A> for some overview information about JDK logging.</P>

<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-BuildJ"></A></H3>
<DIV class="" style="background-color: #C3CDA1;">How do I remote debug Tuscany Java SCA applications from Eclipse?</DIV>


<P>There are many good articles about how to turn on java remote debugging, for exampe, <A href="http://www.eclipsezone.com/eclipse/forums/t53459.html" class="external-link" rel="nofollow">here's one</A></P>

<P>The long and short of it is that you need to tell the JVM to list on a port for debug connections. For example, here the Calculator sample is being debugged.</P>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-calculator.jar;.calculator.CalculatorClient
Listening <SPAN class="code-keyword">for</SPAN> transport dt_socket at address: 8000
3 + 2=5.0
3 - 2=1.0
3 * 2=6.0
3 / 2=1.5
</PRE>
</DIV></DIV>

<P>The important bits are the arguments starting -X. Note the address is set to port 8000. In Eclipse you can then simply open the debug dialog and create a new &quot;Remote Java Application&quot; profile specifying the port of 8000 to match the above command line. </P>

<P>Assuming that you have the Tuscany SCA source available to Eclipse you can then debug through the calculator sample and the Tuscany SCA code. </P>

<P>If you want to remote debug some tests running in the maven build then you can either do. </P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
set MAVEN_OPTS=<SPAN class="code-quote">&quot;-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000&quot;</SPAN>
</PRE>
</DIV></DIV>
<P>or use the following surefire option</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
-Dmaven.surefire.debug . 
</PRE>
</DIV></DIV>

<P>This opens the debugger on port 5005 with suspend=y. You then run mvn as you normally would and connect Eclipse to the running test as described above.</P>

<P>If you want to debug through a webapp running in tomcat you can set up tomcat as follows:</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
set JPDA_TRANSPORT=dt_socket
set JPDA_ADDRESS=5005
set JPDA_SUSPEND=y
tomcat-install\bin&gt;catalina jpda run
</PRE>
</DIV></DIV>
<P>Again from eclipse choose to remote debug. </P>

<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-BuildK"></A></H3>
<DIV class="" style="background-color: #C3CDA1;">Maven locks up during a build. What's going on?</DIV>

<P>The short answer is that we don't know. However we have seen this occasionally on Windows and is some cases it can be tracked back to some kind of interaction between Maven and other applications running on the machine. So the first thing to try is to stop all other applications that you are running and retry the Maven build and see if that helps.</P>

<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-BuildL"></A></H3>
<DIV class="" style="background-color: #C3CDA1;">When I deploy my war in tomcat,while thereare no previous errors in the <BR>
stack trace!</DIV>


<P>When the StandardContext catches errors like this there will be additional<BR>
messages about the problem written to the logs in the Tomcat log directory,<BR>
please check to see what the errors are.</P>

<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-BuildM"></A></H3>
<DIV class="" style="background-color: #C3CDA1;"> My build fails when I get any test failure. Is there a way to make progress?</DIV>

<P>You can use the following mvn command to ignore test failures.  </P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java"> 
mvn clean install -fn 
</PRE>
</DIV></DIV>
<P> </P>

<P>This depends on what you want to do! With -fn the tests still run with -<BR>
Dmaven.test.skip=true they don't. Not running the tests makes the build much<BR>
faster but without running the tests you don't know what problems there<BR>
might be with the jars that get built. A key thing is that with -fn a test<BR>
failure in one module does not stop the build of other modules, but, the jar<BR>
for the module with the test failure does not get built so if you want to<BR>
ignore a test failure but still rebuild a module then you need to use -<BR>
Dmaven.test.skip=true. On the other hand for things like the itest modules<BR>
you just want to see the tests results so it doesn't make much sense to use<BR>
-Dmaven.test.skip=true but -fn can be useful to see how good or bad the<BR>
state of the code is.</P>

<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-BuildN"></A></H3>
<DIV class="" style="background-color: #C3CDA1;">Is there a public build of Tuscany so I can check progress or build integrity?</DIV>


<P>There is a Continuum build at:<BR>
<A href="http://vmbuild.apache.org/continuum/buildResults.action?projectGroupId=19&projectId=277" class="external-link" rel="nofollow">http://vmbuild.apache.org/continuum/buildResults.action?projectGroupId=19&amp;projectId=277</A></P>

<P>You can also use the Tuscany Continuum build to check for which commits are incorportated into the build.</P>

<H2><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-MavenQuestions"></A></H2>

<DIV class="" style="background-color: #C3CDA1;">Maven Questions</DIV>


<H2><A name="TuscanySCAJava-FAQ-ImplementationJavaQuestions"></A><A name="TuscanySCAJava-FAQ-ImplementationJavaQuestions"></A> Implementation Java Questions</H2>

<H3><A name="TuscanySCAJava-FAQ-Whatistheformatforspecifyingmultipleinterfaceswiththe@Serviceannotation%3F"></A><A name="TuscanySCAJava-FAQ-ImplementationJavaA"></A> What is the format for specifying multiple interfaces with the @Service annotation?</H3>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
@Service(interfaces={Interface1.class, Interface2.class, Interface3.class} )
<SPAN class="code-keyword">public</SPAN> class ServiceImpl <SPAN class="code-keyword">implements</SPAN> Interface1, Interface2, Interface3{
 ...
}
</PRE>
</DIV></DIV>

<H3><A name="TuscanySCAJava-FAQ-Whyarereferencesnotbeinginjectedintomycomponent%3F"></A><A name="TuscanySCAJava-FAQ-ImplementationJavaB"></A> Why are references not being injected into my component?</H3>
<P>If you have a component implementation that looks something like...</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
<SPAN class="code-keyword">public</SPAN> class ServiceImpl <SPAN class="code-keyword">implements</SPAN> ServiceInterface1{
 @Reference
 ServiceInterface2 serviceReference1;

 @Reference
 <SPAN class="code-keyword">private</SPAN> ServiceInterface2 serviceReference2;

 @Reference
 <SPAN class="code-keyword">protected</SPAN> ServiceInterface2 serviceReference3;

 @Reference
 <SPAN class="code-keyword">public</SPAN> ServiceInterface2 serviceReference4;

 ...
}
</PRE>
</DIV></DIV>
<P>Then in you operation you will find that serviceReference1 and serviceReference2 are null because SCA will only inject references into fields marked protected or public. This is true for the other injecting annotations, for example, @Callback, @ConversationId and @Context.</P>

<H3><A name="TuscanySCAJava-FAQ-HowtodeployEJBs%28statelesssessionbean%2CEJB2%29inTuscany%3F"></A><A name="TuscanySCAJava-FAQ-ImplementationJavaC"></A> How to deploy EJBs (stateless session bean, EJB2) in Tuscany?</H3>

<P>There are different options for this:   </P>
<UL>
	<LI>Use binding.ejb to expose an SCA service as a stateless session bean. You can find some experimental implementation using OpenEJB.</LI>
	<LI>Develop EJBs using JEE programming model and use them as SCA component implementations (implementation.ejb).</LI>
</UL>


<H3><A name="TuscanySCAJava-FAQ-Isitpossibletousethecalculatordistributedexampletorunonmultiplehosts%3F"></A><A name="TuscanySCAJava-FAQ-ImplementationJavaD"></A> Is it possible to use the calculator-distributed example to run on multiple hosts?</H3>

<P>The calculator-distributed is configured to run in multiple VMs. The node launchers are hard coded to talk to the domain at &quot;http://localhost:9990&quot;.   </P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
   (In each of the node launcher classes, the 'NodeLauncher.main(<SPAN class="code-keyword">new</SPAN> <SPAN class="code-object">String</SPAN>[] {<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//localhost:9990/node-config/NodeC&quot;</SPAN>});' statement does <SPAN class="code-keyword">this</SPAN>) </SPAN>
</PRE>
</DIV></DIV>
<P>In order to run the domain in a remote location, change the localhost to the host where domain is running in above mentioned statement .</P>

<H2><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-BindingQuestions"></A></H2>

<DIV class="" style="background-color: #C3CDA1;">Binding Questions</DIV>


<H3><A name="TuscanySCAJava-FAQ-CanIusetheEJBbindingtopublishanSCAservicesasanSLSB%3F"></A><A name="TuscanySCAJava-FAQ-BindingA"></A> Can I use the EJB binding to publish an SCA services as an SLSB? </H3>
<P>Unfortunately, we only have the reference binding support for SLSB (call<BR>
SLSB from SCA) in Tuscany at this moment. Any contribution to support SLSB<BR>
service binding is welcome. <IMG class="emoticon" src="https://cwiki.apache.org/confluence/images/icons/emoticons/smile.gif" height="20" width="20" align="absmiddle" alt="" border="0"></P>

<H3><A name="TuscanySCAJava-FAQ-HowtoreturnapplicationexceptioninRMIbinding%3F"></A><A name="TuscanySCAJava-FAQ-BindingB"></A> How to return application exception in RMI binding?</H3>
<P>RemoteException and its subclasses are usually used to represent communication issues and not treated as      business exceptions by Tuscany (Ref.: JAXWS Specification v2.1 section 3.7). In order to return application pecific exception, you can add the RemoteException on the &quot;throws&quot; clause instead of having the user exception extend the RemoteException.</P>

<H3><A name="TuscanySCAJava-FAQ-IsitpossibletoconfigureTuscanytoexposeaservice%28e.g.JSONRPC%29thatcommunicatesoverhttps%3FIfyesthenhowtoachievethis%3F"></A><A name="TuscanySCAJava-FAQ-BindingC"></A> Is it possible to configure Tuscany to expose a service (e.g. JSON-RPC) that communicates over https? If yes then how to achieve this?</H3>
<P>Yes, it is possible by enhancing the Tuscany code where the embedded Tomcat Server is created.<BR>
We need to create few properties on the HHTP connector as follows:</P>

<P>    if (isSSLEnabled) </P>
<DIV class="error"><SPAN class="error">Unknown macro: {
        IntrospectionUtils.setProperty(httpConnector, &quot;sslProtocol&quot;, &quot;TLS&quot;);
        IntrospectionUtils.setProperty(httpConnector, &quot;keystoreFile&quot;,getPath()+&quot;/conf/tomcat.keystore&quot;);
        IntrospectionUtils.setProperty(httpConnector, &quot;keystoreType&quot;, &quot;JKS&quot;);
        IntrospectionUtils.setProperty(httpConnector, &quot;clientAuth&quot;, &quot;false&quot;);
        httpConnector.setProtocol( &quot;SSL&quot;);
    }</SPAN> </DIV>
<P> </P>

<H2><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-DataBindingQuestions"></A></H2>

<DIV class="" style="background-color: #C3CDA1;">DataBinding Questions</DIV>


<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-DataBindingA"></A></H3>

<DIV class="" style="background-color: #C3CDA1;">What is he difference between Logical Type and Physical Type?</DIV>

<P> The logical type represents the data type the user thinks is flowing across a wire. This could be a Java type, a XML type, a CORBA type, whatever depending on the /logical/ service contract defined in the assembly.<BR>
 The physical type is the actual representation of that type that is flowed by the runtime. In the Java runtime this will always be a Java type (i.e. some subclass of Object). In some cases it will be the same as the logical type - e.g. when a Java component calls another Java component over a local wire using a Java interface then both logical and physical types will be the same. In many cases though they will be different - for example, if the service contract was WSDL then the logical type would be the XML type used by the WSDL.<BR>
 Within the runtime the same logical type may have different physical forms. For example, the same XML document could be represented physically as a DOM, a StAX stream, an SDO, a JAXB object, or an AXIOM stream. The framework supports conversion between these different physical forms.</P>
<BLOCKQUOTE>
</BLOCKQUOTE>
<OL>
	<LI><B>What is the role of a data mediator interceptor? Can you cite an example of how mediation works say for a component A with reference R that references a service S in component B.?</B><BR>
 The interceptor gets added by the connector. A's outbound wire and B's inbound wire describe the datatypes their implementations can support. When the wire ends are connected the connector adds the interceptor if mediation is needed.<BR>
 One job of a transport binding is to convert an in-memory physical representation to a suitable set of bits on the network (aka serialization and deserialization). Rather than reinvent the different transports we reuse existing implementations such as Axis2 or RMI. As such we need to convert the physical representation on our internal wire with that used by the transport. So, for example, Axis2 only understands AXIOM so in a reference we need to convert the user's physical representation to AXIOM and in a service we need to convert the AXIOM generated by the transport into the form the user's implementation requires. The steps could be described as follows:
	<OL>
		<LI>A calls reference R with physical Java object X(java)</LI>
		<LI>X is placed on R's outbound wire</LI>
		<LI>data mediation converts X(java) to AXIOM object X(axiom)</LI>
		<LI>X(axiom) is placed on inbound wire for the Axis2 binding</LI>
		<LI>Axis2 binding serializes X(axiom) onto the network as XML</LI>
		<LI>Axis2 binding on the target deserializes the XML from the network to X(axiom)</LI>
		<LI>X(axiom) is placed on the outbound wire from the Axis2 binding</LI>
		<LI>data mediation converts X(axiom) to X(java) as needed by the target component</LI>
		<LI>X(java) is placed on B's inbound wire</LI>
		<LI>the target instance for B is invoked passing in X(java)<BR>
. An important thing to note here is that from the fabric's perspective we are dealing with two physical wires: the wire on the client connecting the source component A to the outbound Axis2 transport and the wire on the server connecting the inbound Axis2 transport to the target component B.<BR>
From a global perspective there is one logical wire from A to B but because A and B are located on two different runtimes that logical wire gets split into two physical wires A-&gt;net and net-&gt;B.</LI>
	</OL>
	</LI>
</OL>


<H2><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-ContributionQuestions"></A></H2>

<DIV class="" style="background-color: #C3CDA1;">Contribution Questions</DIV>


<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-ContributionA"></A></H3>

<DIV class="" style="background-color: #C3CDA1;">What is META-INF/sca-contribution.xml for?</DIV>

<P>The <A href="http://www.osoa.org/display/Main/Service%20Component%20Architecture%20Specifications" class="external-link" rel="nofollow">SCA Assembly Model Specification V1.00</A> describes this file in section 1.10.2.3.  Any composites that are named in the sca-contribution.xml file will be automatically be included in the deployable list maintained by the contribution.</P>

<P>If you have a contribution in a directory say.</P>

<P>/my/contribution/dir</P>

<P>Then all composites, along with any other resources, under this directory will be located by the contribution service. For example, assume we have</P>

<P>/my/contribution/dir/META-INF/sca-contribution.xml<BR>
/my/contribution/dir/mycomposite.composite</P>

<P>Where sca-contribution.xml is</P>

<P>&lt;contribution xmlns=&quot;http://www.osoa.org/xmlns/sca/1.0&quot;<BR>
targetNamespace=&quot;http://mycomposite&quot;<BR>
 xmlns:management=&quot;http://mycomposite&quot;&gt;<BR>
 &lt;deployable composite=&quot;mycomposite:MyComposite&quot;/&gt;<BR>
&lt;/contribution&gt;</P>

<P>So in this case the contribution service will locate the file mycomposite.composite and, assuming it contains a composite called mycomposite:MyComposite, will present it as being deployable based on the information in sca-contribution.xml.</P>

<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-ContributionB"></A></H3>

<DIV class="" style="background-color: #C3CDA1;">What is META-INF/sca-deployables/ for?</DIV>

<P>This is a Tuscany specific shorthand for defining deployable components, i.e. you won't find it in the SCA specifications.</P>

<P>If you have a contribution in a directory say.</P>

<P>/my/contribution/dir</P>

<P>Then all components in composites under this directory will be located by the contribution service and any components in composites under the directory /META-INF/sca-deployables/ will automatically be included in the deployable list maintained by the contribution, for example</P>

<P>/my/contribution/dir/META-INF/sca-deployables/mycomposite.composite</P>

<H2><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-PolicyFrameworkQuestions"></A></H2>

<DIV class="" style="background-color: #C3CDA1;">Policy Framework Questions</DIV>


<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-PolicyA"></A></H3>

<DIV class="" style="background-color: #C3CDA1;">What is the level of policy support in Tuscany Release 1.0 ?</DIV>

<P>In Java SCA Release 1.0, policy intents and policysets can be defined for an SCA Domain in the definitions.xml file and specified for various SCA Artifacts in assembly composites (composite, component, services, references, bindings, implementation).  With respect to processing, computing aplicable policies and applying them is concerned here is what the Release 1.0 supports:</P>
<UL class="alternate" type="square">
	<LI>appplicable policysets are computed only for 'binding' elements only i.e. only Interaction Policies are supported.  The next release will have support for 'implementation' elements also</LI>
	<LI>definition of policy attachments to represent axis2 config params.  As sample representations of this, there are itests in the binding-ws-axis2 module and there is a sample (helloworld-ws-service-secure) that defines policies to enable ws-security in Axis2.  The intents that are supported in the itests and sample are athentication, integrity and confidentiality</LI>
	<LI>the itest and sample does not exercise confidentiality intent due to legal issues that Tuscany has with respect to distributing bouncycastle encryption provider jars.</LI>
	<LI>support for WS-Policy attachments, annotated intents and policyset are not yet supported</LI>
	<LI>in identifying policysets applicable to sca elements, the xpath expression in the 'appliesTo' attribute of policy sets is not yet processed as xpath since we are sorting out some specs and implementation details with this - <A href="http://www.mail-archive.com/tuscany-dev@ws.apache.org/msg21699.html" class="external-link" rel="nofollow">http://www.mail-archive.com/tuscany-dev%40ws.apache.org/msg21699.html</A></LI>
</UL>


<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-PolicyB"></A></H3>
<DIV class="" style="background-color: #C3CDA1;">How do I try out/exercise the 'confidentiality' policy intent for the Axis2 WS binding ?</DIV>

<UL class="alternate" type="square">
	<LI>First you must ensure that you are not encumbered by the legal and licensing requirements of bouncycastle.  There are algorithms in the bouncycastle distributions (such as IDEA) that have patent obligations and you are responsible for sorting this out for yourself.</LI>
	<LI>Next you must be familiar with setting up Axis2 for confidentiality.  Here are some useful links for this <A href="http://wso2.org/library/234" class="external-link" rel="nofollow">http://wso2.org/library/234</A>, <A href="http://wso2.org/library/174" class="external-link" rel="nofollow">http://wso2.org/library/174</A>, <A href="http://wso2.org/library/255" class="external-link" rel="nofollow">http://wso2.org/library/255</A>.</LI>
	<LI>The itest in the ws-binding-axis2 module and the helloworld-ws-service-secure have definitions.xml file that define the intents and policyset for confidentiality.  Change the values that have been provided in the Axis2ConfigParam policy attachment, to suit what you have defined for your application - such as the keystore, the userid and password to the keystore, the password callback handler class etc.</LI>
	<LI>Now, specify the confidentiality intent on any of the binding.ws elements in your application composite and ensure that the bcprov-jdk15-132.jar is in the classpath.</LI>
	<LI>Some JREs might require a bit of tweaking with the security.policy settings that deal with encryption providers.  We have tried and tested this successfuly on Sun and IBM JREs.</LI>
	<LI>For the binding-ws-axis2 tests that use keys from the keystore called tuscanyKeys.jks the following command was used to generate the very basic keystore used here
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
keytool -genkey -alias TuscanyWsUser -keyalg RSA -keystore tuscanyKeys.jks -validity 9999
</PRE>
</DIV></DIV></LI>
	<LI>The following command can be used to list the contents of the keystore
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
keytool -list -v -keystore tuscanyKeys.jks -storepass TuscanyWsUserPasswd
</PRE>
</DIV></DIV></LI>
</UL>



<H2><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-SpecificationQuestions"></A></H2>

<DIV class="" style="background-color: #C3CDA1;">Specification Questions</DIV>


<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-SpecificationA"></A></H3>
<DIV class="" style="background-color: #C3CDA1;">Where are the specifications that Tuscany implements?</DIV>

<P>You can find the 6 SCA technical committees here:</P>

<P><A href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-assembly" class="external-link" rel="nofollow">http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-assembly</A><BR>
<A href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-policy" class="external-link" rel="nofollow">http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-policy</A><BR>
<A href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-bindings" class="external-link" rel="nofollow">http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-bindings</A><BR>
<A href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-j" class="external-link" rel="nofollow">http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-j</A><BR>
<A href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-c-cpp" class="external-link" rel="nofollow">http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-c-cpp</A><BR>
<A href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-bpel" class="external-link" rel="nofollow">http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-bpel</A></P>

<P>Meeting minutes, documents, issues and so on are linked from the main page.</P>

<P>Mailing list archives can be found here:</P>

<P><A href="http://www.oasis-open.org/archives/sca-assembly/" class="external-link" rel="nofollow">http://www.oasis-open.org/archives/sca-assembly/</A></P>

<P><A href="http://www.oasis-open.org/archives/sca-policy/" class="external-link" rel="nofollow">http://www.oasis-open.org/archives/sca-policy/</A><BR>
<A href="http://www.oasis-open.org/archives/sca-bindings/" class="external-link" rel="nofollow">http://www.oasis-open.org/archives/sca-bindings/</A><BR>
<A href="http://www.oasis-open.org/archives/sca-j/" class="external-link" rel="nofollow">http://www.oasis-open.org/archives/sca-j/</A><BR>
<A href="http://www.oasis-open.org/archives/sca-c-cpp/" class="external-link" rel="nofollow">http://www.oasis-open.org/archives/sca-c-cpp/</A><BR>
<A href="http://www.oasis-open.org/archives/sca-bpel/" class="external-link" rel="nofollow">http://www.oasis-open.org/archives/sca-bpel/</A></P>

<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-SpecificationB"></A></H3>
<DIV class="" style="background-color: #C3CDA1;">What does the promote keyword in the composite file mean?</DIV>


<P>An SCA composite can be used as an implementation (implementation.composite) for a component. This is so-called recursive composition. It allows pre-assembled composites to be reused.</P>

<P>&quot;promote&quot; can be used to make services or references declared on a component inside the composite visible for wiring at the composite level. The composite services and references can be then further configured when it's used as a component implementation at outer level.</P>

<P>Hope the following samples help.</P>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
&lt;composite name=<SPAN class="code-quote">&quot;Composite1&quot;</SPAN> xmlns:ns=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//dummy&quot;</SPAN>&gt;
</SPAN>   &lt;component name=<SPAN class="code-quote">&quot;C1&quot;</SPAN>&gt;
           &lt;implementation.composite name=<SPAN class="code-quote">&quot;ns:Composite2&quot;</SPAN>&gt;
           &lt;!-- wire ref1 to component C3's service1 --&gt;
           &lt;reference name=<SPAN class="code-quote">&quot;ref1&quot;</SPAN> target=<SPAN class="code-quote">&quot;C3/service1&quot;</SPAN>/&gt;
           &lt;!-- configure the service with ws binding --&gt;
           &lt;service name=<SPAN class="code-quote">&quot;svc1&quot;</SPAN>&gt;
               &lt;binding.ws .../&gt;
           &lt;/service&gt;
   &lt;/component&gt;
&lt;/composite&gt;
</PRE>
</DIV></DIV>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
&lt;composite name=<SPAN class="code-quote">&quot;Composite2&quot;</SPAN> targetNamespace=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//dummy&quot;</SPAN>
</SPAN>xmlns:ns=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//dummy&quot;</SPAN>&gt;
</SPAN>   &lt;component name=<SPAN class="code-quote">&quot;C2&quot;</SPAN>&gt;
           &lt;implementation.java class=<SPAN class="code-quote">&quot;my.C2Impl&quot;</SPAN>&gt;
   &lt;/component&gt;

   &lt;!-- innerService of component C2 is promoted as svc1 --&gt;
   &lt;service name=<SPAN class="code-quote">&quot;svc1&quot;</SPAN> promote=<SPAN class="code-quote">&quot;C2/innerService&quot;</SPAN>/&gt;
   &lt;!-- innerReference of component C2 is promoted as ref1 --&gt;
   &lt;reference name=<SPAN class="code-quote">&quot;ref1&quot;</SPAN> promote=<SPAN class="code-quote">&quot;C2/innerReference&quot;</SPAN>/&gt;
&lt;/composite&gt;
</PRE>
</DIV></DIV>



<H2><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-HostingQuestions"></A></H2>

<DIV class="" style="background-color: #C3CDA1;">Hosting Questions</DIV>


<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-HostingA"></A></H3>
<DIV class="" style="background-color: #C3CDA1;">WebSphere - java.lang.ClassNotFoundException: org.apache.tuscany.sca.host.webapp.WebSCADomain ?</DIV>


<P>f you are trying to run some of the Tuscany sample and demo web applications on WebSphere, you may see the following exception:</P>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
Caused by: java.lang.ClassNotFoundException: org.apache.tuscany.sca.host.webapp.WebSCADomain
       at java.lang.<SPAN class="code-object">Class</SPAN>.forNameImpl(Native Method)
       at java.lang.<SPAN class="code-object">Class</SPAN>.forName(<SPAN class="code-object">Class</SPAN>.java:169)
</PRE>
</DIV></DIV>

<P>The solution to this problem is that you must set application properties to use the application class loader before the parent container class loader. Then Tuscany class dependencies packaged in your web app will be successfully loaded and resolved.</P>

<P>A step by step explanation and walk through is given my Jean-Sebastien at <A href="http://jsdelfino.blogspot.com/2007/10/how-to-use-apache-tuscany-with.html" class="external-link" rel="nofollow">http://jsdelfino.blogspot.com/2007/10/how-to-use-apache-tuscany-with.html</A>.</P>

<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-HostingB"></A></H3>
<DIV class="" style="background-color: #C3CDA1;">WebSphere - java.lang.IllegalArgumentException: <A href="http://www.w3.org/2001/XMLSchema" class="external-link" rel="nofollow">http://www.w3.org/2001/XMLSchema?</A></DIV>

<P>This means that, for some reason, you don't have the correct XML parser packages in your webapp. Usually including Xerces and Xalan implementations in your webapp will solve this problem. Arrange for the files xercesImpl.2.8.1.jar and xalan-2.7.0.jar to be copied to the webapp lib folder</P>

<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-HostingC"></A></H3>
<DIV class="" style="background-color: #C3CDA1;">WebSphere - java.net.ConnectException: Connection refused: connect?</DIV>


<P>There are a couple of likely reasons why this can happen. </P>

<P>Firstly, by default, WebSphere is set up to use port 9080 while all of the Tuscany samples are set up to use port 8080 so if, for example, you are trying to deploy samples/calculator-ws-webapp to a default WebSphere configuration you will need to go in and change the client component reference description to read:</P>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
    &lt;component name=<SPAN class="code-quote">&quot;CalculatorServiceComponent&quot;</SPAN>&gt;
        &lt;implementation.java class=<SPAN class="code-quote">&quot;calculator.CalculatorServiceImpl&quot;</SPAN>/&gt;
        &lt;reference name=<SPAN class="code-quote">&quot;addService&quot;</SPAN> &gt;
           &lt;<SPAN class="code-keyword">interface</SPAN>.java <SPAN class="code-keyword">interface</SPAN>=<SPAN class="code-quote">&quot;calculator.AddService&quot;</SPAN> /&gt;        
            &lt;binding.ws uri=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//localhost:9080/sample-calculator-ws-webapp/AddServiceComponent&quot;</SPAN>/&gt;        
</SPAN>        &lt;/reference&gt;  
</PRE>
</DIV></DIV>

<P>Another thing to watch out for is a WebSphere configuration that tells the web container to pass requests on to the filter chain when URLs remain unsatisfied. </P>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
com.ibm.ws.webcontainer.invokeFiltersCompatibility = <SPAN class="code-keyword">true</SPAN>
</PRE>
</DIV></DIV>

<P>See the details here <A href="http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg1PK31377" class="external-link" rel="nofollow">http://www-1.ibm.com/support/docview.wss?rs=180&amp;uid=swg1PK31377</A></P>

<DIV class="" style="background-color: #C3CDA1;">General SCA Questions</DIV>


<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-GetTargetName"></A></H3>
<DIV class="" style="background-color: #C3CDA1;">How to get Target Name from Composite without parsing? </DIV>

<P>You can use the StAX to get the QName as follows:</P>

<P>Assuming url points to the composite file:</P>

<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
<PRE> 
URLConnection connection = url.openConnection();
connection.setUseCaches(false);
XMLStreamReader reader = factory.createXMLStreamReader(connection.getInputStream());
reader.nextTag();

assert Constants.COMPOSITE_QNAME.equals(reader.getName());
String ns = reader.getAttributeValue(null, &quot;targetNamespace&quot;);
if (ns == null) {
ns = XMLConstants.NULL_NS_URI;
}
String name = reader.getAttributeValue(null, &quot;name&quot;);
reader.close();
</PRE>
</DIV></DIV> 
<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-DuplicateComponentInComposite"></A></H3>
<DIV class="" style="background-color: #C3CDA1;">Different composites can contain components with the same name. How can I reference the components if the composites are contributed to one SCA Domain? </DIV>


<P>You should consider that in order to enable 2 separate composites they need to be contributed to the domain in some way. For example, </P>

<P>1 - composites contributed as deployable<BR>
2 - included in other composites that are included as deployable composites<BR>
3 - named as component implementations using implementation.composite</P>

<P>In cases 1 and 2 the composite is flattened out and become part of another composite. In case 1 this other composite is the virtual domain composite. The component name must be unique in this context. </P>

<H3><A name="TuscanySCAJava-FAQ-HowistheSCAInterfaceExtensionusedinSCAenvironment%3F"></A><A name="TuscanySCAJava-FAQ-SCAInterfaceExtension"></A> How is the SCA Interface Extension used in SCA environment?</H3>
<P>SCA allows you to define interfaces for SCA references and services using different languages such as Java, WSDL 1.1, WSDL 2.0 or CORBA<BR>
IDL. <BR>
For example, consider following two components:  <BR>
OrderProcessingClient (java component): It takes the order from the web front and calls the OrderProcessing process to fulfill the    order    <BR>
OrderProcessing (BPEL component): A business process that handles the order and it defines a service using WSDL 1.1 <BR>
OrderProcessingClient defines a reference using java interface. <BR>
When OrderProcessingClient is wired to OrderProcessing,  the java code for OrderProcessingClient can call the OrderProcessing component <BR>
using the java interface if it's compatible with the WSDL portType for the OrderProcessing component. The SCA interface extension makes<BR>
it possible for components to choose the suitable interface definition languages. </P>

<H3><A name="TuscanySCAJava-FAQ-WhatarethebenefitsofdesigningapplicationsusingSCA%3F"></A><A name="TuscanySCAJava-FAQ-SCABenefits"></A> What are the benefits of designing applications using SCA?</H3>
<P>Please refer to the following email thread for answer:<BR>
  <A href="http://www.mail-archive.com/tuscany-user@ws.apache.org/msg01114.html" class="external-link" rel="nofollow">http://www.mail-archive.com/tuscany-user@ws.apache.org/msg01114.html</A></P>

<H3><A name="TuscanySCAJava-FAQ-"></A><A name="TuscanySCAJava-FAQ-Didn%27tFindit"></A></H3>
<DIV class="" style="background-color: #C3CDA1;">Didn't Find my answer</DIV>

<P>If you still have not found your answer, please take a look at the email archive. You can do a search on your topic. </P>

<P><A href="http://www.mail-archive.com/user@tuscany.apache.org/" class="external-link" rel="nofollow">User Discussion Archives</A><BR>
<A href="http://www.mail-archive.com/tuscany-user@ws.apache.org/" class="external-link" rel="nofollow">User Discussion Archives (when under incubation)</A><BR>
<A href="http://www.mail-archive.com/dev@tuscany.apache.org/" class="external-link" rel="nofollow">Dev Discussion Archives</A><BR>
<A href="http://www.mail-archive.com/tuscany-dev@ws.apache.org/" class="external-link" rel="nofollow">Dev Discussion Archives (when under incubation)</A></P></TD></TR></TBODY></TABLE>
							</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&nbsp;&nbsp;</BR>
                        Apache Tuscany and the Apache Tuscany project logo are trademarks of The Apache Software Foundation.
		</DIV>
		<!-- footer macro end -->

    </BODY>
</HTML>