Hi,

It seems that the 1.0 SCA java spec defines an algorithm to introspect the services provided by a java interface as follows:

1. @Service will be checked first and honored

2. The following is quoted from Java spec 1.2.1.3.

Introspecting services offered by a Java implementation
In the cases described below, the services offered by a Java implementation class may be determined through introspection, eliding the need to specify them using @Service. The following algorithm is used
to determine how services are introspected from an implementation class:

If the interfaces of the SCA services are not specified with the @Service annotation on the implementation class, it is assumed that all implemented interfaces that have been annotated as @Remotable are the service interfaces provided by the component. If none of the implemented interfaces is remotable, then by default the implementation offers a single service whose type
is the implementation class.

Based on the above, CalculatorServiceImpl is going to have one single service typed by CalculatorServiceImpl. I believe some of the test cases assume that all the local interfaces will be taken as the services, especially if only one interface is implemented by the java class. With the latest spec, the assumption will be incorrect.

Am I right?

If so, I can change the code to behave this way.

Thanks,
Raymond

----- Original Message ----- From: "Jean-Sebastien Delfino" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, May 29, 2007 5:53 PM
Subject: Re: [Java Sca]-Parse two interface error.


Tony Wang wrote:
hi,

when a componentImpl implementation two interface,tuscany parse error.

public interface CalculatorService1 {
    double add(double n1, double n2);
    double subtract(double n1, double n2);
}
public interface CalculatorService2 {
    double multiply(double n1, double n2);
    double divide(double n1, double n2);
}

public class CalculatorServiceImpl implements CalculatorService1,CalculatorService2{
...
}

<composite ...>
       <component name="CalculatorServiceComponent">
       <implementation.java class="calculator.CalculatorServiceImpl"/>
        ...
    </component>
</composite>


The error is:
-----------------------------------------------------
Exception in thread "main" org.osoa.sca.ServiceRuntimeException: org.osoa.sca.ServiceRuntimeException: org.apache.tuscany.sca.contribution.service.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.ServiceTypeNotFoundException: calculator.CalculatorServiceImpl at org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADomain.java:263) at org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(SCADomain.java:81)
 at calculator.CalculatorClient.main(CalculatorClient.java:31)
Caused by: org.osoa.sca.ServiceRuntimeException: org.apache.tuscany.sca.contribution.service.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.ServiceTypeNotFoundException: calculator.CalculatorServiceImpl at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init>(DefaultSCADomain.java:106) at org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADomain.java:230)
 ... 2 more
Caused by: org.apache.tuscany.sca.contribution.service.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.ServiceTypeNotFoundException: calculator.CalculatorServiceImpl at org.apache.tuscany.sca.implementation.java.xml.JavaImplementationProcessor.resolve(JavaImplementationProcessor.java:121) at org.apache.tuscany.sca.implementation.java.xml.JavaImplementationProcessor.resolve(JavaImplementationProcessor.java:1) at org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.resolve(ExtensibleStAXArtifactProcessor.java:102) at org.apache.tuscany.sca.assembly.xml.BaseArtifactProcessor.resolveImplementation(BaseArtifactProcessor.java:387) at org.apache.tuscany.sca.assembly.xml.CompositeProcessor.resolve(CompositeProcessor.java:466) at org.apache.tuscany.sca.assembly.xml.CompositeProcessor.resolve(CompositeProcessor.java:1) at org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.resolve(ExtensibleStAXArtifactProcessor.java:102) at org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.resolve(CompositeDocumentProcessor.java:83) at org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.resolve(CompositeDocumentProcessor.java:1) at org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor.resolve(ExtensibleURLArtifactProcessor.java:73) at org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.processResolvePhase(ContributionServiceImpl.java:317) at org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.addContribution(ContributionServiceImpl.java:254) at org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.contribute(ContributionServiceImpl.java:119) at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init>(DefaultSCADomain.java:104)
 ... 3 more
Caused by: org.apache.tuscany.sca.implementation.java.introspect.impl.ServiceTypeNotFoundException: calculator.CalculatorServiceImpl at org.apache.tuscany.sca.implementation.java.introspect.impl.HeuristicPojoProcessor.visitEnd(HeuristicPojoProcessor.java:109) at org.apache.tuscany.sca.implementation.java.introspect.ExtensibleJavaClassIntrospector.introspect(ExtensibleJavaClassIntrospector.java:109) at org.apache.tuscany.sca.implementation.java.xml.JavaImplementationProcessor.resolve(JavaImplementationProcessor.java:119)
 ... 16 more


Thanks

Tony wang


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





Tony,

Thank you for reporting this, I have created JIRA issue http://issues.apache.org/jira/browse/TUSCANY-1307 to track this bug and will investigate it.

--
Jean-Sebastien


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



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

Reply via email to