You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Raymond Feng (JIRA)" <tu...@ws.apache.org> on 2007/07/17 02:07:04 UTC
[jira] Assigned: (TUSCANY-1405) when the component is implemented
by a composite which has multi service,occur can't find service error.
[ https://issues.apache.org/jira/browse/TUSCANY-1405?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Raymond Feng reassigned TUSCANY-1405:
-------------------------------------
Assignee: Raymond Feng
Thank you for reporting this issue and I can reproduce/identify the problem now.
> when the component is implemented by a composite which has multi service,occur can't find service error.
> --------------------------------------------------------------------------------------------------------
>
> Key: TUSCANY-1405
> URL: https://issues.apache.org/jira/browse/TUSCANY-1405
> Project: Tuscany
> Issue Type: Bug
> Components: Java SCA Assembly Model
> Affects Versions: Java-SCA-0.90
> Reporter: wangfeng
> Assignee: Raymond Feng
> Fix For: Java-SCA-0.91
>
> Attachments: ConmpositeImplementation.jar
>
>
> I create a simple SCA application,which test composite Implementation.I defined two composite files,one is OuterComposite.composite,the other is InnerComposite.composite and the Innercomposite file has defined two composite services.
> when I get a service (offer a service name to the getService method) from the component which defined in the OuterComposite file ,occur an error as below.
> Exception in thread "main" org.osoa.sca.ServiceRuntimeException: Service not found: TargetComponent/Service_Two
> at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.getService(DefaultSCADomain.java:278)
> at composite.CompositeClient.main(CompositeClient.java:31)
> OuterComposite.composite
> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
> targetNamespace="http://sample"
> xmlns:sample="http://sample"
> name="OuterComposite">
> <component name="TargetComponent">
> <implementation.composite name="sample:InnerComposite"/>
> </component>
> </composite>
> InnerComposite.composite
> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
> targetNamespace="http://sample"
> xmlns:sample="http://sample"
> name="InnerComposite">
> <service name="Service_One" promote="ComponentOne">
> <interface.java interface="composite.Target"/>
> </service>
> <service name="Service_Two" promote="ComponentTwo">
> <interface.java interface="composite.Target"/>
> </service>
> <component name="ComponentOne">
> <implementation.java class="composite.TargetOne"/>
> </component>
> <component name="ComponentTwo">
> <implementation.java class="composite.TargetTwo"/>
> </component>
> </composite>
> Target.java
> package composite;
> public interface Target {
> String hello(String arg);
> }
> TargetOne.java
> package composite;
> import org.osoa.sca.annotations.Service;
> @Service(Target.class)
> public class TargetOne implements Target {
> public String hello(String arg) {
> return "TargetOne: Hello " + arg+ "!";
> }
> }
> TargetTwo.java
> package composite;
> import org.osoa.sca.annotations.Service;
> @Service(Target.class)
> public class TargetTwo implements Target {
> public String hello(String arg) {
> return "TargetTwo: Hello " + arg + "!";
> }
> }
> CompositeClient .java
> package composite;
> import org.apache.tuscany.sca.host.embedded.SCADomain;
> public class CompositeClient {
> public static void main(String[] args) throws Exception {
> SCADomain scaDomain = SCADomain.newInstance("OuterComposite.composite");
> Target target = scaDomain.getService(Target.class, "TargetComponent/Service_Two");
> String res = target.hello("Wang Feng");
> System.out.println(res);
> scaDomain.close();
> }
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org