When I use a wire:

 

     <wire source="AComponent/bReference>
target="BComponent//BImplementation"/>

 

to wire two components, I get the exception at the end of this message.
This does not happen when I wire the components using a reference on the
component:

 

<component name="AComponent>

          <reference name="bReference" target="BComponent"/>

</component>

 

I then looked at the integration test:
org.apache.tuscany.sca.itest.WireTestCase.java which is part of the
source distribution. It utilizes the following wire:

 

<wire source="WireClient/aWireService"
target="WireService/WireService"/>

 

This test does run successful but that is because the name of the
component and service are equal!!!

If one changes the name of the component from WireService into something
else say WireServiceComponent (both in the wire and the component off
course) the test will fail.

 

I have debugged the source and found that one can fix the problem by
modifying the method:

 

org.apache.tuscany.sca.assembly.builder.impl.CompositeWireBuilderImpl.co
nnectWires( ....)

 

It contains the following line:

 

                resolvedReference.getTargets().add(resolvedService);

 

Which should be changed into:

 

                 resolvedReference.getTargets().add(target);

 

This fixes the problem.

 

However, I am not sure if this is the correct fix. The code preceding
this line is al little strange:

 

// Resolve the target service

            ComponentService target = wire.getTarget();

            if (target != null && target.isUnresolved()) {

                resolvedService =
componentServices.get(target.getName());

                if (resolvedService != null) {

                    wire.setTarget(target);

 

The last line doesn't really do anything usefull. So maybe my fix is
part of a bigger problem in the code ...

 

1-dec-2007 11:46:46
org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl$1
problem

WARNING: [WARNING] Component reference target not found, it might be a
remote service: BImplementation null

Exception in thread "main" org.osoa.sca.ServiceUnavailableException: No
service invoker is available for reference bReference (bindingURI=null
operation=doB).

  at
org.apache.tuscany.sca.binding.sca.impl.RuntimeSCAReferenceBindingProvid
er.createInvoker(RuntimeSCAReferenceBindingProvider.java:192)

  at
org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.addBindingIntercept
or(RuntimeWireImpl.java:214)

  at
org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.initInvocationChain
s(RuntimeWireImpl.java:156)

  at
org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationChains
(RuntimeWireImpl.java:97)

  at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.getInvocatio
nChain(JDKInvocationHandler.java:190)

  at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKIn
vocationHandler.java:124)

  at $Proxy4.doB(Unknown Source)

  at com.x.AImplementation.doA(AImplementation.java:11)

  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

  at java.lang.reflect.Method.invoke(Unknown Source)

  at
org.apache.tuscany.sca.implementation.java.invocation.JavaImplementation
Invoker.invoke(JavaImplementationInvoker.java:105)

  at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKIn
vocationHandler.java:233)

  at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKIn
vocationHandler.java:130)

  at
org.apache.tuscany.sca.core.invocation.CglibProxyFactory$CglibMethodInte
rceptor.intercept(CglibProxyFactory.java:133)

  at com.x.AImplementation$$EnhancerByCGLIB$$baa0b110.doA(<generated>)

  at com.x.RunABComposite.main(RunABComposite.java:10)

 

ÿþDit bericht is vertrouwelijk en kan 
geheime informatie bevatten enkel

bestemd voor de geadresseerde. Indien 
dit bericht niet voor u is bestemd,

verzoeken wij u dit onmiddellijk aan 
ons te melden en het bericht te

vernietigen.

Aangezien de integriteit van het 
bericht niet veilig gesteld is middels

verzending via internet, kan Atos 
Origin niet aansprakelijk worden 
gehouden

voor de inhoud daarvan.

Hoewel wij ons inspannen een virusvrij 
netwerk te hanteren, geven

wij geen enkele garantie dat dit 
bericht virusvrij is, noch aanvaarden 
wij

enige aansprakelijkheid voor de 
mogelijke aanwezigheid van een virus in 
dit

bericht.

 

Op al onze rechtsverhoudingen, 
aanbiedingen en overeenkomsten 
waaronder

Atos Origin goederen en/of diensten 
levert zijn met uitsluiting van alle

andere voorwaarden de 
Leveringsvoorwaarden van Atos Origin 
van toepassing.

Deze worden u op aanvraag direct 
kosteloos toegezonden.

 

This e-mail and the documents attached 
are confidential and intended solely

for the addressee; it may also be 
privileged. If you receive this e-mail

in error, please notify the sender 
immediately and destroy it.

As its integrity cannot be secured on 
the Internet, the Atos Origin group

liability cannot be triggered for the 
message content. Although the

sender endeavours to maintain a 
computer virus-free network, the sender

does not warrant that this transmission 
is virus-free and will not be

liable for any damages resulting from 
any virus transmitted.

 

On all offers and agreements under 
which Atos Origin supplies goods and/or

services of whatever nature, the Terms 
of Delivery from Atos Origin

exclusively apply. 

The Terms of Delivery shall be promptly 
submitted to you on your request.

 

Atos Origin Nederland B.V. / Utrecht

KvK Utrecht 30132762
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to