Thanks Simon for your replay!

Anyway I solved the problem in "Run as Java Application". But the one related 
to  "run as Tuscany" is still present.

I'm using eclipse 3.4 Tuscany (lib) 1.3.2, tuscany plugin 1.3.1, and STP 1.0

The composite file is generated automaticcaly, you just had to draw service 
components, references and properties graphically. Here it is the code 
generated in this way:

<?xml version="1.0" encoding="ISO-8859-15"?>
<sca:composite xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"; name="Restaurant">
  <sca:component name="RestaurantServiceComponent">
    <sca:implementation.java class="restaurant.lib.RestaurantServiceImpl"/>
    <sca:service name="RestaurantService">
      <sca:interface.java interface="restaurant.api.RestaurantService"/>
    </sca:service>
    <sca:reference name="billService" 
target="BillServiceComponent/BillService"/>
    <sca:reference name="menuService" 
target="MenuServiceComponent/MenuService"/>
  </sca:component>
   <sca:service name="RestaurantService" 
promote="RestaurantServiceComponent/RestaurantService"/>
  <sca:component name="MenuServiceComponent">
    <sca:implementation.java class="restaurant.lib.MenuServiceImpl"/>
    <sca:service name="MenuService">
      <sca:interface.java interface="restaurant.api.MenuService"/>
    </sca:service>
  </sca:component>
  <sca:component name="BillServiceComponent">
    <sca:implementation.java class="restaurant.lib.BillServiceImpl"/>
    <sca:service name="BillService">
      <sca:interface.java interface="restaurant.api.BillService"/>
    </sca:service>
    <sca:reference name="vatService" target="VatServiceComponent/VatService"/>
    <sca:reference name="tipService" target="TipServiceComponent/TipService"/>
  </sca:component>
  <sca:component name="VatServiceComponent">
    <sca:implementation.java class="restaurant.lib.VatServiceImpl"/>
    <sca:service name="VatService">
      <sca:interface.java interface="restaurant.api.VatService"/>
    </sca:service>
  </sca:component>
  <sca:component name="TipServiceComponent">
    <sca:implementation.java class="restaurant.lib.TipServiceImpl"/>
    <sca:service name="TipService">
      <sca:interface.java interface="restaurant.api.TipService"/>
    </sca:service>
  </sca:component>

</sca:composite>


For what reguard class and interface they seems to work now. It was just a type 
error.
According to you is this the exact way to generate composite o there'is 
something better? I mean for example tools, plugin and so on...

Thanks

Best reguards!

Marco




On Wed, Nov 5, 2008 at 8:21 AM, Marco Piccinni <[EMAIL PROTECTED]> wrote:

    Hi all!
    I found a pdf tutorial on the net which title reads 
"FirstStepsWithSCADesigner". I follow correctly each step twice but something 
doesn't work.

    Could someone help me?


    When I compile the client class(in the package src/test) i get this:

    4-nov-2008 18.06.17 org.apache.tuscany.sca.assembly.xml.CompositeProcessor
    AVVERTENZA: No namespace found: Composite = Restaurant
    4-nov-2008 18.06.17 
org.apache.tuscany.sca.assembly.builder.impl.ComponentConfigurationBuilderImpl
    GRAVE: Reference not found for component reference: Component = 
BillServiceComponent Reference = tipservice
    4-nov-2008 18.06.17 
org.apache.tuscany.sca.assembly.builder.impl.CompositeBindingURIBuilderImpl
    GRAVE: Reference not found for component reference: Component = 
BillServiceComponent Reference = tipservice
    4-nov-2008 18.06.17 
org.apache.tuscany.sca.assembly.builder.impl.ComponentReferenceWireBuilderImpl
    AVVERTENZA: No targets for reference: Composite = Restaurant Reference = 
tipService
    Exception in thread "main" org.osoa.sca.ServiceRuntimeException: 
org.osoa.sca.ServiceRuntimeException: Reference not found for component 
reference: Component = BillServiceComponent Reference = tipservice
    at 
org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADomain.java:276)
    at 
org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(SCADomain.java:70)
    at test.Client.main(Client.java:7)
    Caused by: org.osoa.sca.ServiceRuntimeException: Reference not found for 
component reference: Component = BillServiceComponent Reference = tipservice
    at 
org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.analyseProblems(DefaultSCADomain.java:309)
    at 
org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.init(DefaultSCADomain.java:239)
    at 
org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init>(DefaultSCADomain.java:120)
    at 
org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADomain.java:242)
    ... 2 more


    whereas if a run as tuscany the restuarant.composite I get this:


    4-nov-2008 18.01.55 
org.apache.tuscany.sca.node.launcher.DomainManagerLauncher main
    INFO: Apache Tuscany SCA Domain Manager starting...

    Using default configuration properties.
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/ui/home/*
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/ui/workspace/*
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/ui/files/*
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/ui/composite/*
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/ui/cloud/*
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/workspace/*
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/contribution/*
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/feed/files/*
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/files/*
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/composite/*
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/composite-source/*
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/deployable/*
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/composite-generated/*
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/composite-resolved/*
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/cloud/*
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/cloud-source/*
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/composite-config/*
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/node-config/*
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/quickstart/*
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/processes/*
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/node/processes/*
    4-nov-2008 18.02.03 org.apache.tuscany.sca.http.jetty.JettyServer 
addServletMapping
    INFO: Added Servlet mapping: http://PC-Marco:9990/ping/*
    4-nov-2008 18.02.03 
org.apache.tuscany.sca.node.launcher.DomainManagerLauncher main
    INFO: SCA Domain Manager started.
    4-nov-2008 18.02.03 
org.apache.tuscany.sca.node.launcher.DomainManagerLauncher main
    INFO: Press enter to shutdown.
    4-nov-2008 18.02.04 org.apache.tuscany.sca.assembly.xml.CompositeProcessor
    AVVERTENZA: No namespace found: Composite = Restaurant
    4-nov-2008 18.02.04 org.apache.tuscany.sca.assembly.xml.CompositeProcessor
    AVVERTENZA: No namespace found: Composite = Restaurant
    4-nov-2008 18.02.04 
org.apache.tuscany.sca.domain.manager.impl.QuickStartServiceImpl doGet
    GRAVE: Could not start composite
    org.osoa.sca.ServiceRuntimeException: javax.xml.stream.XMLStreamException: 
Non-default namespace can not map to empty URI (as per Namespace 1.0 # 2) in 
XML 1.0 documents
    at 
org.apache.tuscany.sca.domain.manager.impl.DeployedCompositeCollectionImpl.writeCompositeCollection(DeployedCompositeCollectionImpl.java:435)
    at 
org.apache.tuscany.sca.domain.manager.impl.DeployedCompositeCollectionImpl.post(DeployedCompositeCollectionImpl.java:275)
    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.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:132)
    at 
org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)
    at 
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:287)
    at 
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
    at $Proxy11.post(Unknown Source)
    at 
org.apache.tuscany.sca.domain.manager.impl.QuickStartServiceImpl.doGet(QuickStartServiceImpl.java:148)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    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.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:132)
    at 
org.apache.tuscany.sca.binding.http.provider.HTTPServiceListenerServlet.service(HTTPServiceListenerServlet.java:75)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
    at org.mortbay.jetty.Server.handle(Server.java:324)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
    at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
    at 
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
    at org.apache.tuscany.sca.core.work.Jsr237Work.run(Jsr237Work.java:63)
    at 
org.apache.tuscany.sca.core.work.ThreadPoolWorkManager$DecoratingWork.run(ThreadPoolWorkManager.java:221)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: javax.xml.stream.XMLStreamException: Non-default namespace can 
not map to empty URI (as per Namespace 1.0 # 2) in XML 1.0 documents
    at 
com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1473)
    at com.ctc.wstx.sw.BaseNsStreamWriter.setPrefix(BaseNsStreamWriter.java:210)
    at 
org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor$XAttr.writeQNamePrefix(BaseStAXArtifactProcessor.java:420)
    at 
org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor$XAttr.writePrefix(BaseStAXArtifactProcessor.java:500)
    at 
org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor.writeAttributePrefixes(BaseStAXArtifactProcessor.java:301)
    at 
org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor.writeStart(BaseStAXArtifactProcessor.java:224)
    at 
org.apache.tuscany.sca.assembly.xml.BaseAssemblyProcessor.writeStart(BaseAssemblyProcessor.java:190)
    at 
org.apache.tuscany.sca.assembly.xml.CompositeProcessor.write(CompositeProcessor.java:534)
    at 
org.apache.tuscany.sca.assembly.xml.CompositeProcessor.write(CompositeProcessor.java:87)
    at 
org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint$LazyStAXArtifactProcessor.write(DefaultStAXArtifactProcessorExtensionPoint.java:346)
    at 
org.apache.tuscany.sca.domain.manager.impl.DeployedCompositeCollectionImpl.writeCompositeCollection(DeployedCompositeCollectionImpl.java:416)
    ... 36 more
    4-nov-2008 18.07.17 
org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor
    GRAVE: ContributionReadException occured due to : 
org.apache.tuscany.sca.contribution.service.ContributionReadException: 
com.ctc.wstx.exc.WstxParsingException: Non-default namespace can not map to 
empty URI (as per Namespace 1.0 # 2) in XML 1.0 documents
    at [row,col {unknown-source}]: [5,17]
    4-nov-2008 18.07.17 
org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor
    GRAVE: ContributionReadException occured due to : 
org.apache.tuscany.sca.contribution.service.ContributionReadException: 
com.ctc.wstx.exc.WstxParsingException: Non-default namespace can not map to 
empty URI (as per Namespace 1.0 # 2) in XML 1.0 documents
    at [row,col {unknown-source}]: [5,17]
    4-nov-2008 18.07.17 
org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor
    GRAVE: ContributionReadException occured due to : 
org.apache.tuscany.sca.contribution.service.ContributionReadException: 
com.ctc.wstx.exc.WstxParsingException: Non-default namespace can not map to 
empty URI (as per Namespace 1.0 # 2) in XML 1.0 documents
    at [row,col {unknown-source}]: [5,17]
    4-nov-2008 18.07.17 
org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor
    GRAVE: ContributionReadException occured due to : 
org.apache.tuscany.sca.contribution.service.ContributionReadException: 
com.ctc.wstx.exc.WstxParsingException: Non-default namespace can not map to 
empty URI (as per Namespace 1.0 # 2) in XML 1.0 documents
    at [row,col {unknown-source}]: [5,17]

    thanks to all!


Hi Marco

I have to admit that I haven't tried the STP tooling. What versions of STP and 
Tuscany are you using?

The problems you are seeing are caused by problems in the composite file. Is 
the restaurant.composite generated by STP or did you type it in manually. For 
example,

The warning about "no namespace found" won't stop it working but mean the 
composite description should look something like.

<sca:composite xmlns:sca="http://www.osoa.org/xmlns/sca/1.0";
           targetNamespace="http://restaurant";
           xmlns:restaurant="http://restaurant";
           name="Restaurant">
etc.

The errors are more serious. The BillServiceComponent doesn't seem to be 
providing a reference called tipService for some reason. Can you compare what 
you have against some of our examples. E.g. take a look at our basic Calculator 
sample (http://svn.apache.org/repos/asf/tuscany/java/sca/samples/calculator/). 
If you can't see anything obviously wrong post your BillServiceImpl and your 
composite file?

Regards

Simon

Reply via email to