This is because there is no default service for the composite (we should probably check for this and throw a better error). What seems to be happening is that CompositeComponentExtension.locateService() is resolving to a child composite context which has no default service. It looks as if you are trying to have nested composites. If you do this the DAS component needs to be exposed as a service on the inner composite.

Another option would be to point the current composite context to the inner composite (there is a config parameter in the servlet context for this). You should be able to find an example of this in the Spring sample.

A further option would be just to have one composite (as opposed to the hierarchy) would make things simpler.

Jim

On Nov 2, 2006, at 3:29 AM, Luciano Resende wrote:

I have created a simple DASService component, and trying to use it in a
client web application (based on webapp sample app)...
Although, I'm getting the following exception :

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        java.util.ArrayList.RangeCheck(ArrayList.java:546)
        java.util.ArrayList.get(ArrayList.java:321)
org.apache.tuscany.spi.extension.CompositeComponentExtension.getServic eInstance(CompositeComponentExtension.java:239) org.apache.tuscany.spi.extension.CompositeComponentExtension.locateSer vice(CompositeComponentExtension.java:269) org.apache.tuscany.core.launcher.CompositeContextImpl.locateService (CompositeContextImpl.java:65)
        org.apache.jsp.Company_jsp._jspService(Company_jsp.java:80)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java:332) org.apache.jasper.servlet.JspServlet.serviceJspFile (JspServlet.java:314)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.tuscany.runtime.webapp.TuscanyFilter.doFilter (TuscanyFilter.java:58)


das service default.scdl
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
name="DASServiceComposite">

   <component name="DASServiceComponent">
       <implementation.java class="
org.apache.tuscany.samples.das.service.DASServiceImpl"/>
   </component>

</composite>


das service client default.scdl
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
name="DASServiceComposite">

   <component name="DASServiceComponent">
       <implementation.composite name="DASServiceComposite"
jarLocation="lib/sample-das-service-1.0-incubator-SNAPSHOT.jar"/>
   </component>
</composite>


This is with trunk code... Any ideas on what might be wrong ?

- Luciano Resende


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

Reply via email to