Hi Simon,

Just wanted to confirm if you get error message out of this scenario...

I believe most probably, this should be the error message... please
confirm...

org.osoa.sca.ServiceRuntimeException: More than one service is declared on
component ClientComponent. Service name is required to get the service.
    at
org.apache.tuscany.sca.core.context.ComponentContextHelper.getSingleService(ComponentContextHelper.java:313)
    at
org.apache.tuscany.sca.core.context.ComponentContextImpl.createSelfReference(ComponentContextImpl.java:166)
    at
org.apache.tuscany.sca.node.impl.NodeImpl.getServiceReference(NodeImpl.java:787)
    at
org.apache.tuscany.sca.node.impl.NodeImpl.getService(NodeImpl.java:719)
    at
org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.getService(DefaultSCADomain.java:211)


On Sat, Feb 21, 2009 at 7:10 PM, Simon Laws <[email protected]>wrote:

> I'm looking at a Spring based payment component in the travel sample in the
> sandbox [1] and am having problems in the case where the Spring context and
> the implementations it references are unannotated.
>
> I have a bean...
>
> public class PaymentImpl implements Payment {
>
>     private CreditCardPayment creditCardPayment;
>     private EmailGateway emailGateway;
>
>     public void setCreditCardPayment(CreditCardPayment creditCardPayment) {
>         this.creditCardPayment = creditCardPayment;
>     }
>
>     public void setEmailGateway(EmailGateway emailGateway) {
>         this.emailGateway = emailGateway;
>     }
>
> a context...
>
> <beans xmlns="http://www.springframework.org/schema/beans";
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>        xmlns:sca="http://www.springframework.org/schema/sca";
>        xsi:schemaLocation="http://www.springframework.org/schema/beans
>
> http://www.springframework.org/schema/beans/spring-beans.xsd";>
>
>     <bean id="Payment" class="payment.PaymentImpl">
>         <property name="creditCardPayment"
> ref="creditCardPaymentReference"/>
>         <property name="emailGateway" ref="EmailGateway"/>
>     </bean>
>
>     <bean id="EmailGateway" class="scatours.emailgateway.EmailGatewayImpl">
>     </bean>
>
> </beans>
>
> and a composite component...
>
>     <component name="PaymentComponent">
>         <implementation.spring location="Payment-context.xml"/>
>         <service name="Payment">
>             <interface.wsdl interface="
> http://www.tuscanyscatours.com/Payment/#wsdl.interface(Payment)<http://www.tuscanyscatours.com/Payment/#wsdl.interface%28Payment%29>"
> />
>             <binding.ws uri="http://localhost:8080/Payment"; wsdlElement="
> http://www.tuscanyscatours.com/Payment/#wsdl.service(PaymentService)<http://www.tuscanyscatours.com/Payment/#wsdl.service%28PaymentService%29>
> "/>
>         </service>
>         <reference name="creditCardPaymentReference">
>             <binding.ws uri="http://localhost:8081/CreditCardPayment"/>
>         </reference>
>     </component>
>
> Now the introspection that goes on inside SpringXMLComponentTypeLoader [2]
> struggles as it doesn't have access to the information from the SCDL. It
> introspects the bean to try and decide which fields shoulf be references and
> which should be properties and it can't tell the difference. What I think
> should be happing is that it should be looking back at the component in the
> SCDL to see what has actually been defined as a reference and what has been
> defined as a service and using this information to build the component type.
> However there is a lot of code here so I'm loooking for someone familiar
> with the implementation.spring code to tell me what I've missed.
>
> Regards
>
> Simon
>
> [1]
> http://svn.apache.org/repos/asf/tuscany/sandbox/travelsample/chapter-06/payment-spring-contribution/
> [2]
> http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringXMLComponentTypeLoader.java
>



-- 
Thanks & Regards,
Ramkumar Ramalingam

Reply via email to