[ 
https://issues.apache.org/jira/browse/TUSCANY-1347?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Simon Nash resolved TUSCANY-1347.
---------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: Java-SCA-Next)
                   Java-SCA-1.2

The NPE no longer occurs.  With EchoServiceImpl.asyncEcho() updated to use the 
correct APIs, this program seems to be working as implemented.  The JUnit test 
case claims that an error has occurred because no exception was thrown from the 
async invocation, but I don't understand why this is expected.

If you think there is still a problem here, please reopen the JIRA with a 
description of what results are expected and why.

Here is the code I used in my version of the EchoServiceImpl.asyncEcho() method:

    public String asyncEcho(String input) {

        AsyncEchoService asyncEchoService;
        ServiceReference<AsyncEchoService> serviceRef = 
context.getServiceReference(AsyncEchoService.class, "asyncEchoRef");
        asyncEchoService = serviceRef.getService();

        asyncEchoService.echo(input);

        int count = 0;
        while (_result == null & count < 10) // wait ten seconds max
        {
            System.out.println("while loop: _result " + _result);
            try {
                Thread.sleep(1024);
                count = count + 1;
            } catch (InterruptedException e) {

            }
        }
        return _result;

    }


> IndexOutOfBoundsException thrown when trying to locate a service that 
> includes a callback
> -----------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-1347
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1347
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Core Runtime
>    Affects Versions: Java-SCA-Next
>            Reporter: Kevin Williams
>            Assignee: Simon Nash
>            Priority: Minor
>             Fix For: Java-SCA-1.2
>
>         Attachments: 1347.patch, 1347part2.patch, sca_itest_echoService.jar
>
>
> More complete description and test case to follow
> Here is the exception thrown...
> [6/14/07 17:59:55:187 MDT] 00000020 SystemErr     R 
> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
>       at java.util.ArrayList.RangeCheck(ArrayList.java:572)
>       at java.util.ArrayList.get(ArrayList.java:347)
>       at 
> org.apache.tuscany.sca.core.runtime.RuntimeComponentImpl.getServiceReference(RuntimeComponentImpl.java:98)
>       at 
> org.apache.tuscany.sca.core.runtime.RuntimeComponentImpl.createSelfReference(RuntimeComponentImpl.java:58)
>       at 
> org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain.getServiceReference(EmbeddedSCADomain.java:292)
>       at 
> org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain.getService(EmbeddedSCADomain.java:228)
>       at 
> org.apache.tuscany.sca.host.embedded.impl.SimpleCompositeContextImpl.locateService(SimpleCompositeContextImpl.java:80)
>       at sca.fvt.EchoServiceImpl.asyncEcho(Unknown Source)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to