Hi Simon,

Thanks for your explanation. I think it is indeed the case that there is no
wire to support the connection. I have the impression that the service does
exist but the runtime thinks it doesn't or something else is going wrong.

I looked in more detail to see whether the composite is really being read. I
found that ContributionServiceImpl.contribute() calls
ContributionServiceImpl.addContribution(). After debugging I found that
there is an exception after processReadPhase where the read problems are
arising. The code excerpt below shows this step:

try {
            // Allow access to read system properties. Requires
PropertyPermission in security policy.
            // Any security exceptions are caught and wrapped as
ContributionException.
            processReadPhase(contribution, contributionArtifacts);
        } catch ( Exception e ) {
            throw new ContributionException(e);
        }

contribution is null and contributionArtifacts has the following contents:

[dex://calculator/CalculatorServiceImpl.class,
dex://calculator/AddServiceImpl.class,
dex://calculator/SubtractServiceImpl.class,
dex://calculator/MultiplyServiceImpl.class,
dex://calculator/DivideServiceImpl.class,
dex://calculator.android/raw/calculator.composite]

In summary ContributionServiceImpl.contribute() is not returning anything
but instead resulting in an exception. I will ask Adriano if the dex
protocol can read .class files, as Android doesn't use .class but .dex
instead. Maybe, dex protocol should access .dex files.

Let me know if you have any pointers or ideas. I'll keep you posted if I
find something new.

Thanks for your help.

On Wed, Jul 23, 2008 at 12:00 PM, Simon Laws <[EMAIL PROTECTED]>
wrote:

>
>
> On Wed, Jul 23, 2008 at 8:32 AM, Adriano Crestani <
> [EMAIL PROTECTED]> wrote:
>
>> Good summary Oscar : )
>>
>> I would like to reproduce your workspace and get this exception with only
>> the modules set your are using. I tried it, but I'm getting some errors
>> related to missing classes from the modules I removed. Could you make a new
>> step by step tutorial of how to reproduce a workspace like yours?
>>
>> Thanks,
>> Adriano Crestani
>>
>>
>> On Tue, Jul 22, 2008 at 4:58 PM, Oscar Castaneda <
>> [EMAIL PROTECTED]> wrote:
>>
>>> Hi,
>>>
>>> I've been mostly using another thread for issues and questions concerning
>>> running Tuscany/SCA on Android. Some progress has been made and a new thread
>>> was needed.
>>>
>>> Recently, Adriano reported some errors while testing changes to the
>>> android sandbox and revision 674723 [1]. There was also a suggestion from
>>> Luciano to look into calculator2 for coming up with a minimal set of modules
>>> necessary to run calculator-android. I took the list of modules from the
>>> tuscany-runtime2 and tuscany-api JARs of the revision that included
>>> calculator2, and augmented it based on dependencies from revision 643746,
>>> which was a previous revision, until the point in which I received the same
>>> errors [2] that Adriano had reported. These errors result in the
>>> RuntimeException shown below:
>>>
>>> java.lang.RuntimeException: Unable to start activity 
>>> ComponentInfo{calculator.android/calculator.android.CalculatorClient}: 
>>> org.osoa.sca.ServiceUnavailableException: Service not found for component 
>>> CalculatorServiceComponent reference setAddService (bindingURI=null 
>>> operation=add). Ensure that the composite containing the service is loaded 
>>> and started somewhere in the SCA domain and that if running in a remote 
>>> node that the interface of the target service marked as @Remotable
>>>
>>>
>>> Seeing this error the first question that came to mind was: how do I
>>> verify whether the composite containing the service is being loaded? and,
>>> does it actually exist? I was thinking that maybe the composite was not
>>> being created and thus was resulting in the errors in [3]. To test this I
>>> changed the first line of "calculator_composite" to read as follows:
>>>
>>> <composite name="Calculator" autowire="true">
>>>
>>> Setting the autowire attribute to true would make the runtime
>>> automatically connect services and references in the composite, granted
>>> there actually was one. This resulted in the error shown in [4] and included
>>> in more detail in [5]. The fact that the runtime wires are being created
>>> makes me think that a composite does exist, as documented in [6]. However,
>>> the error messages confuse me and make me think otherwise, especially the
>>> one shown below:
>>>
>>> java.lang.RuntimeException: Unable to start activity 
>>> ComponentInfo{calculator.android/calculator.android.CalculatorClient}: 
>>> org.osoa.sca.ServiceRuntimeException: org.osoa.sca.ServiceRuntimeException: 
>>> Composite not found: dex://calculator.android/raw/calculator.composite
>>>
>>>
>>>
>>>
>>>
>>> Any suggestions or ideas from the Tuscany community to resolve this
>>> problem will be greatly appreciated. As Adriano mentioned in the previous
>>> thread, we have a feeling we're getting closer to successfully embedding
>>> Tuscany/SCA in Android.
>>>
>>>
>>> [1]
>>> http://cwiki.apache.org/confluence/display/TUSCANYWIKI/SCA+Android+Exception+after+revision+674723
>>> [2] http://androidindelft.googlepages.com/21Jul2.jpg
>>> [3]
>>> http://cwiki.apache.org/confluence/display/TUSCANYWIKI/21Jul2008-2+-+Error+Stack+trace
>>> [4] http://androidindelft.googlepages.com/22Jul1.jpg
>>> [5]
>>> http://cwiki.apache.org/confluence/display/TUSCANYWIKI/22Jul2008+-+Error+Stack+trace
>>> [6]
>>> http://tuscany.apache.org/sca-java-architecture-guide.html#SCAJavaArchitectureGuide-CompositeActivation
>>>
>>> --
>>> best,
>>> -oscar
>>>
>>> Oscar CastaƱeda
>>>
>>
>>
> Hi Oscar
>
> The ServiceUnavailableException you are seeing comes from the SCA binding
> when it tries to create an invoker but it finds there is no wire to support
> the connection. This can be the case if your reference targets a service
> that doesn't exist or at least which the runtime doesn't think exists. As an
> aside I guess you are working on oldish code in the sandbox as this error
> message has changed now.
>
> First you need to look in some detail at whether the composite is really
> being read. Can you tell if ContributionServiceImpl.contribute() is
> returning anything?
>
> Simon
>



-- 
best,
-oscar

Oscar CastaƱeda

Reply via email to