Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Section
bordertrue
Column
width15%
Include Page
TUSCANYWIKI: SCA Java Subproject Menu in ChineseTUSCANYWIKI:
SCA Java Subproject Menu in Chinese
unmigrated-wiki-markup
Column
width85%

????

Apache

Tuscany

Java

SCA

FAQ

???????????????


\\ {panel:title=Apache Tuscany |
Panel
borderColor#C3CDA1
bgColor#ECF4D1
titleBGColor#C3CDA1
titleApache Tuscany
SCA????
borderStylesolid
=solid|borderColor=#C3CDA1|titleBGColor=#C3CDA1|bgColor=#ECF4D1} * [|#Build Questions] ** [???? |#BuildA] ** [ |#BuildB] ** [ |#BuildC] ** [ |#BuildD] ** [ ?|#BuildE] ** [???? |#BuildF] ** [ |#BuildG] ** [mavenRC |#BuildH] ** [|#BuildI] ** [?Eclipse Tuscany Java SCA |#BuildJ] ** [?Maven|#BuildK] * [Java |#Implementation JavaQuestions] ** [ @Service |#ImplementationJavaA] ** [references|#ImplementationJavaB] * [|#Binding Questions] ** [SCA EJB?|#BindingA] * [??????|#DataBinding Questions] ** [???????????????|#DataBindingA] * [Contribution??|#Contribution Questions] ** [|#ContributionA] ** [ |#ContributionB] * [?????|#Policy Framework Questions] ** [Tuscany ?? |#PolicyA] ** [????? ?|#PolicyB] * [|#Specification Questions] ** [Tuscany |#SpecificationA] ** [|#SpecificationB]   {panel} h2. {anchor:Build Questions} {bgcolor:#C3CDA1}

    •  

Anchor
Build Questions
Build Questions

Background Color
color#C3CDA1
??????

{bgcolor} h3. {anchor:BuildA} {bgcolor:#C3CDA1}

Anchor
BuildA
BuildA

Background Color
color#C3CDA1
????????

Java?

{bgcolor} IBM ? Sun ? JDK

IBM ? Sun ? JDK 1.5

???

??

Tuscany??????????????

?? ?

??

?

JDK1.4?

??

Tuscany

SCA

?

??????

?

JDK1.5??????????

??

JDK1.6?XML???????????????????????????????????????????????????????JDK1.6?

{
Code Block
}
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)
{code}

h3. {anchor:BuildB} 

{bgcolor:#C3CDA1}

Anchor
BuildB
BuildB

Background Color
color#C3CDA1
????????

Maven?

{bgcolor}

????

Apache

Tuscany

??

??????Maven

????

??????Maven2.0.5

?

??????????????????????????????????

?

2.0.5?

h3. {anchor:BuildC} {bgcolor:#C3CDA1}?

Anchor
BuildC
BuildC

Background Color
color#C3CDA1
????

?

Tuscany?????

?? {bgcolor}

??

??

Tuscany?SVN

??

????????????????????????????????????

??

trunk?????????????????????????????????????????????????

?

?

??????????????????????????????????????????

?

??????????IDE


????????

{
Code Block
}
cd mytuscanydir
svn checkout [https://svn.apache.org/repos/asf/incubator/tuscany/java/]
{code}

??(??

(????????????)

{
Code Block
}
svn update [https://svn.apache.org/repos/asf/incubator/tuscany/java/]
{code}

??

???maven

Code Block
??

{code}
cd mytuscanydir/sca
mvn clean
{code}

??

????maven

????

??????maven

?

???????

???

SCA??

Code Block
??
{code}
.m2\repository\org\apache\tuscany\sca
{code}

????sca

{
Code Block
}
cd mytuscanydir/sca
mvn
{code}

??????????????????????????

h3. {anchor:BuildD} {bgcolor:#C3CDA1}??

Anchor
BuildD
BuildD

Background Color
color#C3CDA1
?Java??

?? {bgcolor} ?

??

?

itest

????

???????"Java

heap

space"????itest????

itest

????????????????

?????? ??

"MAVEN_OPTS="-Xmx1024m

-Xms512m"

???

???

?

sca?pom?

??[

1

]??

surfire

plugin?????

?? [1] [

1 https://svn.apache.org/repos/asf/incubator/tuscany/java/sca/pom.xml

] h3. {anchor:BuildE} {bgcolor:#C3CDA1}

Anchor
BuildE
BuildE

Background Color
color#C3CDA1
??????

??

Eclipse?

?? {bgcolor} ??

????????????????svn????????????

No Format
??
{noformat} 
demos 
distribution 
itest 
modules 
samples 
tools 
pom.xml 
{noformat} 
????

??maven??

Code Block
??
{code} 
mvn 
{code} 

mvn

?

??????????????

?

Eclipse

Code Block
??
{code} 
mvn -Peclipse eclipse:eclipse 
{code} 
?

???????

?

".classpath"

?

".project"

??

????????

??

Eclipse

???

????

?

Eclipse

????

?"File/Import/Existing

Projects

Into

Workspace"????????????Eclipse?????

Eclipse

?????

???????

????????????????????????????????????????????????????

Anchor
BuildF
BuildF

Background Color
color#C3CDA1
??WebApp??Eclipse WTP?

???

h3. {anchor:BuildF} {bgcolor:#C3CDA1}????WebApp??????Eclipse WTP??? {bgcolor} ?????

??Eclipse

WTP

????

?WebApp

?

???

???

WTP

Web

?

?????

?

mvn

eclipse:eclipse

??????????

-Dwtpversion=1.5?

{
Code Block
} 
mvn -Dwtpversion=1.5 -Peclipse eclipse:eclipse 
{code} 
???

?-Dwtpversion=1.5???Eclipse?? WTP Web??

Eclipse

??<packaging>war</packaging> ??

WTP Web??????<packaging>war</packaging> ??

???????????????WTP

Tomcat

?

Geronimo

Server

???,

???Eclipse???????????

?? h3. {anchor:BuildG} {bgcolor:#C3CDA1}??IBM JDK??

Anchor
BuildG
BuildG

Background Color
color#C3CDA1
IBM JDK WSConfidentialityTestCase??????

java.lang.ExceptionInInitializerError

arising

from

the

base

java.security.InvalidKeyException:

Public

key

presented

not

for

certificate

signature

-

???????

{bgcolor}

???????

??

IBM

JDK?

jre\lib\security\java.security???????????

No Format
??
{noformat} 
# 
# 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 
{noformat} 

h3. {anchor:BuildH} 
{bgcolor:#C3CDA1}maven 

Anchor
BuildH
BuildH

Background Color
color#C3CDA1
maven ?????????????

{bgcolor}

???????????

??

maven

??

???????????????????????????????

??

maven

settings.xml????????????

Code Block
??

{code} 
<mirrors> 
<mirror> 
<id>ant.staging</id> 
<url>http://people.apache.org/~antelder/tuscany/1.0-RC1a/maven</url> 
<mirrorOf>apache.incubator</mirrorOf> 
</mirror> 
{code} 

settings.xml

??

??home

????

.m2

?

???????????

?

:

"C:\Documents

and

Settings\Administrator\.m2"??????????????????:

[

settings.xml

|https://svn.apache.org/repos/asf/incubator/tuscany/java/etc/settings.xml] h3. {anchor:BuildI} {bgcolor:#C3CDA1}

Anchor
BuildI
BuildI

Background Color
color#C3CDA1
???????????????

{bgcolor}

Tuscany??JDK

logger

??

info,

warning

?.

???????logging.properties

????

.

Tuscany?????????????JDK?INFO???

JDK

?????

INFO

???????????logging.properties??????jre/lib????IBM JDK

Code Block
??logging.properties??????????jre/lib????????IBM JDK??

{code} 
C:\thedirwhereiinstalledjava\jre\lib\logging properties 
{code} 

??

????????FINE????????

Code Block
??

{code} 
.level= FINE 
{code} 

????????????

{
Code Block
} 
java.util.logging.ConsoleHandler.level = INFO 
{code} 

??

JDK??????????

[??|http://java.sun.com/j2se/1.4.2/docs/guide/util/logging/overview.html]? h3. {anchor:BuildJ} {bgcolor:#C3CDA1}???Eclipse

?

Anchor
BuildJ
BuildJ

Background Color
color#C3CDA1
?Eclipse?Tuscany Java SCA???

?????

Tuscany Java SCA

????java?

{bgcolor}

??????????

?

java

????JVM????

[

?????

|http://www.eclipsezone.com/eclipse/forums/t53459.html] ???????JVM?????????????

?????Calculator???

Code Block
??

{code} 
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 for transport dt_socket at address: 8000 
3 + 2=5.0 
3 - 2=1.0 
3 * 2=6.0 
3 / 2=1.5 
{code} 

??

????????-X.

????????8000.

?

Eclipse

???

????????????

?

debug

dialog

???

????

?

"Remote

Java

Application"??8000????

8000

????

????Eclipse??

?

?????Eclipse?????

Tuscany

SCA

??

?????????calculator??

?? h3. {anchor:BuildK} {bgcolor:#C3CDA1}

Anchor
BuildK
BuildK

Background Color
color#C3CDA1
Maven???????????????

{bgcolor}

?????????????????

??

windows??????????????????????????????????????????????????????????????????

?? h2. {anchor:Implementation JavaQuestions} {bgcolor:#C3CDA1}

Anchor
Implementation JavaQuestions
Implementation JavaQuestions

Background Color
color#C3CDA1
Java??????

{bgcolor} h3. {anchor:ImplementationJavaA} {bgcolor:#C3CDA1}???

Anchor
ImplementationJavaA
ImplementationJavaA

Background Color
color#C3CDA1
?@Service??????????

Code Block
??
{bgcolor} 
{code} 
@Service(interfaces={Interface1.class, Interface2.class, Interface3.class} ) 
public class ServiceImpl implements Interface1, Interface2, Interface3{ 
... 
} 
{code} 

h3. {anchor:ImplementationJavaB} 

{bgcolor:#C3CDA1}

Anchor
ImplementationJavaB
ImplementationJavaB

Background Color
color#C3CDA1
?????

??

"

??

"?????

{bgcolor}

???????????????...

{
Code Block
} 
public class ServiceImpl implements ServiceInterface1{ 
@Reference 
ServiceInterface2 serviceReference1; 

@Reference 
private ServiceInterface2 serviceReference2; 

@Reference 
protected ServiceInterface2 serviceReference3; 

@Reference 
public ServiceInterface2 serviceReference4; 

... 
} 
{code} 
?????????serviceReference1 ? serviceReference2 ?? null????? SCA ??"??" protected ? public ???????????"??"??????????@Callback, @ConversationId ? @Context?

h2. {anchor:Binding Questions} 

{bgcolor:#C3CDA1}???????
{bgcolor} 

h3. {anchor:BindingA} 

{bgcolor:#C3CDA1}????EJB??????SCA???????SLSB??
{bgcolor} 
?????????????SCA??SLSB?????????????? :-) 

h2. {anchor:DataBinding Questions} 

{bgcolor:#C3CDA1} 
public ServiceInterface2 serviceReference4; 

... 
} 

???????serviceReference1 ? serviceReference2 ??

{bgcolor} h3. {anchor:DataBindingA} {bgcolor:#C3CDA1}

null??? SCA "" protected ? public ?????????

? {bgcolor}

""??????????@Callback, @ConversationId ? @Context?

Anchor
Binding Questions
Binding Questions

Background Color
color#C3CDA1
???????

Anchor
BindingA
BindingA

Background Color
color#C3CDA1
??EJB??SCA???SLSB

??

Java

??

, XML

??

,

??

CORBA

??

,

?SCA??SLSB???????????? (smile)

Anchor
DataBinding Questions
DataBinding Questions

Background Color
color#C3CDA1
????

?????

Anchor
DataBindingA
DataBindingA

Background Color
color#C3CDA1
?????????????

Java???????

?

????

Java

???????????????????????Java ?

???Java

?, XML ??, ??CORBA ??, ??

Java

?????????????????
????????????????Java???????Java???

WSDL

????????

WSDL

????

XML

???

?JavaJava?????Java???????????????????

,

???

XML

???????

DOM, StAX

??

SDO,

?

JAXB

???????WSDL??

AXIOM

??

Tuscany

WSDLXML?
?????????????

{quote} {quote} # *

???????

data mediator interceptor

???, ???XML???DOM, StAX ??SDO, ? JAXB ??????

R

???

A

AXIOM??Tuscany?????

S

???

B

????

  1. ?????data mediator interceptor????
*
  1. ??????????R?A??
A
  1. ???S?B?????????????
    ???????????AB???????????????????
  1. ??????????????????????
    ?????????
(
  1. ????????
)
  1. ????????????(????
Axis2
  1. )?
RMI
  1. ???????????Axis2?RMI??????????????
Axis2
  1. ???
AXIOM
  1. ?????Axis2?AXIOM??????????????
AXIOM
  1. ????AXIOM??????????????????AXIOM
?
  1. ???????????????????
?
  1. :
## A ??
    1. A ??Java
    1. ??
    1. X(java)
?? R ## X
    1. R
    2. X ???
    1. R???
##
    1. ?????
    1. X(java)
    1. ???
    1. AXIOM
    1. ??
    1. X(axiom)
##
    1. X(axiom)
??
    1. ?Axis2???
?? ##
    1. Axis2???
    1. X(axiom)
??
    1. ?(XML
??)???? ##
    1. )??
Axis2
    1. ??
    2. Axis2??????
    1. XML
    1. ?????
    1. X(axiom)
##
    1. X(axiom)
??
    1. ?Axis2???
?? ##
    1. ??????????????
    1. X(axiom)
    1. ???
    1. X(java)
##
    1. X(java)
    1. ???
    1. B???
##
    1. B???????????????
    1. X(java)

    1. .???????????????????????
??
    1. :
???
    1. ???
?
    1. A
????
    1. Axis2
????
    1. ???????Axis2
?
    1. ???????
?
    1. B?

    1. ?????????????????
    1. A
    1. ?
    1. B?????A
    1. ?
    1. B
    1. ???????????????????????????
    1. A->net
    1. ?
    1. net->B?
h2. {anchor:Contribution Questions} {bgcolor:#C3CDA1}

Anchor
Contribution Questions
Contribution Questions

Background Color
color#C3CDA1
Contribution?????

{bgcolor} h3. {anchor:ContributionA} {bgcolor:#C3CDA1}

Anchor
ContributionA
ContributionA

Background Color
color#C3CDA1
META-INF/sca-contribution.xml???????

{bgcolor} [SCA ?????? 1.00?|http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications] ?

SCA ?????? 1.00? 1.10.2.3.

????

?????sca-contribution.xml????????????????????????

??

??????????contribution?

{
Code Block
}
/my/contribution/dir 
{code}

???????????????????

??

contribution

??

.

??,

??????

{
Code Block
}
/my/contribution/dir/META-INF/sca-contribution.xml 
/my/contribution/dir/mycomposite.composite 
{code}

sca-contribution.xml???

{
Code Block
}
<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0" 
targetNamespace="http://mycomposite" 
xmlns:management="http://mycomposite"> 
<deployable composite="mycomposite:MyComposite"/> 
</contribution> 
{code}

?contribution???

??

mycomposite.composite

??????????mycomposite:MyComposite

?

?

?

,

???????

h3. {anchor:ContributionB} {bgcolor:#C3CDA1}

Anchor
ContributionB
ContributionB

Background Color
color#C3CDA1
META-INF/sca-deployables/

???????

{bgcolor} ??

??Tuscany

????

??????,

SCA?????????

??

???????????contribution?

{
Code Block
}
/my/contribution/dir 
{code}

????????????????????

??

/META-INF/sca-deployables/????????

Code Block
??
{code}
/my/contribution/dir/META-INF/sca-deployables/mycomposite.composite 
{code}

h2. {anchor:Policy Framework Questions} 

{bgcolor:#C3CDA1}???????
{bgcolor} 

h3. {anchor:PolicyA} 

{bgcolor:#C3CDA1}Tuscany 1.0 

Anchor
Policy Framework Questions
Policy Framework Questions

Background Color
color#C3CDA1
???????

Anchor
PolicyA
PolicyA

Background Color
color#C3CDA1
Tuscany 1.0 ????????????

{bgcolor} Java SCA

Java SCA 1.0??,

??

SCA

?????????????

definitions.xml

?

???????

???

SCA

??

????????

??

With

respect

to

processing,

computing

aplicable

policies

and

applying

them

is

concerned

here

is

what

the

Release1.0

??

??:

-

  • ???????????????????????????????????????????
- ??
  • ???????axis2
????
  • ????binding-ws-axis2
????
  • itest
??
  • ??????
  • helloworld-ws-service-secure????
??
  • ws-security????
?? -
  • itest
  • ???????
??
  • "confidentiality
  • intent"
??
  • ???????
??
  • Tuscany
???
  • ??
?
  • API????????
?? - ??
  • WS-Policy
??
  • ,
  • ??????????
-
  • ??????????
??
  • sca
??
  • ???
??
  • 'appliesTo'
???
  • ?
?
  • xpath
????
  • ??????????????
  • ?? ????
??[
  • ?????
|http://www.mail-archive.com/tuscany-dev%40ws.apache.org/msg21699.html]? h3. {anchor:PolicyB} {bgcolor:#C3CDA1}

Anchor
PolicyB
PolicyB

Background Color
color#C3CDA1
??????Axis2

WS

?????'confidentiality'

???

{bgcolor} - ??

  • ????????????bouncycastle
?
  • ???
?
  • .
  • ???????????????
  • (?
  • IDEA)?
- ??
  • ??????????Axis2??????????????
??[]
  • ?
[]
  • ?
[]
  • ?
-
  • ?
  • ws-binding-axis2
?
  • ?
?
  • itest?
  • helloworld-ws-service-secure
????
  • definitions.
xml??
  • xml??????
??
  • (confidentiality)
???
  • ????
?
  • Axis2ConfigParam
????
  • ??????????????????????keystore?
??
  • keystore?????????,
  • ??password
  • callback
  • handler
  • ???
-
  • ???????
??
  • binding.ws
???
  • ???????
?
  • bcprov-jdk15-132.jar?
??
  • classpath??
- ??
  • JRE
?
  • ????
???
  • security.policy
??
  • ???????????????
??
  • Sun?IBM?JRE????? ??
  • ??
?? h2. {anchor:Specification Questions} {bgcolor:#C3CDA1}

Anchor
Specification Questions
Specification Questions

Background Color
color#C3CDA1
?????

?? {bgcolor} h3. {anchor:SpecificationA} {bgcolor:#C3CDA1}Tuscany

??

Anchor
SpecificationA
SpecificationA

Background Color
color#C3CDA1
Tuscany ?????????

{bgcolor} SCA

SCA ???????6?:

[

http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-assembly

] [


http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-policy

] [


http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-bindings

] [


http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-j

] [


http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-c-cpp

] [


http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-bpel

]

??????????????????????

???????

[

http://www.oasis-open.org/archives/sca-assembly/

] [


http://www.oasis-open.org/archives/sca-policy/

] [


http://www.oasis-open.org/archives/sca-bindings/

] [


http://www.oasis-open.org/archives/sca-j/

] [


http://www.oasis-open.org/archives/sca-c-cpp/

] [


http://www.oasis-open.org/archives/sca-bpel/

] h3. {anchor:SpecificationB} {bgcolor:#C3CDA1}What does the promote keyword in the composite file mean? {bgcolor} An SCA composite can be used as an implementation

Anchor
SpecificationB
SpecificationB

Background Color
color#C3CDA1
What does the promote keyword in the composite file mean?

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.

"promote"

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.

Hope

the

following

samples

help.

Code Block
 

{code} 
<composite name="Composite1" xmlns:ns="http://dummy"> 
<component name="C1"> 
<implementation.composite name="ns:Composite2"> 
<!-- wire ref1 to component C3's service1 --> 
<reference name="ref1" target="C3/service1"/> 
<!-- configure the service with ws binding --> 
<service name="svc1"> 
<binding.ws .../> 
</service> 
</component> 
</composite> 
Code Block
{code} 

{code} 
<composite name="Composite2" targetNamespace="http://dummy" 
xmlns:ns="http://dummy"> 
<component name="C2"> 
<implementation.java class="my.C2Impl"> 
</component> 

<!-- innerService of component C2 is promoted as svc1 --> 
<service name="svc1" promote="C2/innerService"/> 
<!-- innerReference of component C2 is promoted as ref1 --> 
<reference name="ref1" promote="C2/innerReference"/> 
</composite> 
{code}