You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Simon Laws (JIRA)" <de...@tuscany.apache.org> on 2011/05/23 12:40:47 UTC

[jira] [Resolved] (TUSCANY-3757) Asynch programming model doesn't support Void return types.

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

Simon Laws resolved TUSCANY-3757.
---------------------------------

    Resolution: Fixed

I believe it does now

> Asynch programming model doesn't support Void return types. 
> ------------------------------------------------------------
>
>                 Key: TUSCANY-3757
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-3757
>             Project: Tuscany
>          Issue Type: Bug
>    Affects Versions: Java-SCA-2.x
>         Environment: All
>            Reporter: Simon Laws
>             Fix For: Java-SCA-2.x
>
>
> I believe that it should be possible to define an asynchronous service interface with an operation that returns a void, for example, 
> @AsyncInvocation
> public interface CalculatorServiceAsync {
>     void calculateAsync(Integer n1, ResponseDispatch<String> response);
>     void printAsync(Integer n1, ResponseDispatch<Void> response);
> }
> However this doesn't work with Tuscany (various NPEs while parsing the interface).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Re: [jira] [Resolved] (TUSCANY-3757) Asynch programming model doesn't support Void return types.

Posted by Simon Laws <si...@googlemail.com>.
On Fri, Oct 28, 2011 at 2:44 PM, Simon Laws <si...@googlemail.com> wrote:
> snip...
>> What happened to the async sample which tested this?  It seems to be gone.
> ...snip
>
> Not sure. I'll have a hunt for it an try and reinstate it. If we'RE
> not running any void examples it's easy to believe that the code has
> regressed.
>
> Simon
>
> --
> Apache Tuscany committer: tuscany.apache.org
> Co-author of a book about Tuscany and SCA: tuscanyinaction.com
>

I found some code and see the effect  you're seeing. So if it ever did
work (which I thought it did) it doesn't now. Let me know if you come
up with a solution. I won't get a chance to look at it straight away.

Regards

Simon

-- 
Apache Tuscany committer: tuscany.apache.org
Co-author of a book about Tuscany and SCA: tuscanyinaction.com

Re: [jira] [Resolved] (TUSCANY-3757) Asynch programming model doesn't support Void return types.

Posted by Simon Laws <si...@googlemail.com>.
snip...
> What happened to the async sample which tested this?  It seems to be gone.
...snip

Not sure. I'll have a hunt for it an try and reinstate it. If we'RE
not running any void examples it's easy to believe that the code has
regressed.

Simon

-- 
Apache Tuscany committer: tuscany.apache.org
Co-author of a book about Tuscany and SCA: tuscanyinaction.com

Re: [jira] [Resolved] (TUSCANY-3757) Asynch programming model doesn't support Void return types.

Posted by Greg Dritschler <gr...@gmail.com>.
I'm running into some trouble when I use asyncInvocation with void return
types.  In my case I'm hitting a problem with the client interface.

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.get(ArrayList.java:352)
at
org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSAsyncInterfaceProcessor.isJAXWSAsyncPoolingOperation(JAXWSAsyncInterfaceProcessor.java:104)
at
org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSAsyncInterfaceProcessor.visitInterface(JAXWSAsyncInterfaceProcessor.java:57)
at
org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceIntrospectorImpl.introspectInterface(JavaInterfaceIntrospectorImpl.java:145)
...

The failing statement in JAXWSAsyncInterfaceProcessor is:

        //a return type of Response<R> where R is the return type of M
        DataType<?> operationOutputType =
operation.getOutputType().getLogical().get(0);

I think that operations with void return types don't have a normal output
DataType and some alternate logic is needed here.  I can give it a shot.

What happened to the async sample which tested this?  It seems to be gone.

I assume the proper async mapping is to use Void as had been done for the
sample....

+    // Aysnc Poll
+    public Response<Void> printAsync(Integer i1);
+
+    // Async Callback
+    public Future<Void> printAsync(Integer i1, AsyncHandler<Void> handler);

Out of curiosity I tried running wsimport with enableAsyncMapping in the
WSDL to see what JAX-WS does and I couldn't get it to do this.  Instead of
using Void, it used a wrapper type (xxxResponse) with no member variables.
 But http://axis.apache.org/axis2/java/core/docs/jaxws-guide.html claims
that wsimport has some issues with enableAsyncMapping and void response
type.  Using Void makes sense to me.

On Mon, May 23, 2011 at 6:40 AM, Simon Laws (JIRA)
<de...@tuscany.apache.org>wrote:

>
>     [
> https://issues.apache.org/jira/browse/TUSCANY-3757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
>
> Simon Laws resolved TUSCANY-3757.
> ---------------------------------
>
>    Resolution: Fixed
>
> I believe it does now
>
> > Asynch programming model doesn't support Void return types.
> > ------------------------------------------------------------
> >
> >                 Key: TUSCANY-3757
> >                 URL: https://issues.apache.org/jira/browse/TUSCANY-3757
> >             Project: Tuscany
> >          Issue Type: Bug
> >    Affects Versions: Java-SCA-2.x
> >         Environment: All
> >            Reporter: Simon Laws
> >             Fix For: Java-SCA-2.x
> >
> >
> > I believe that it should be possible to define an asynchronous service
> interface with an operation that returns a void, for example,
> > @AsyncInvocation
> > public interface CalculatorServiceAsync {
> >     void calculateAsync(Integer n1, ResponseDispatch<String> response);
> >     void printAsync(Integer n1, ResponseDispatch<Void> response);
> > }
> > However this doesn't work with Tuscany (various NPEs while parsing the
> interface).
>
> --
> This message is automatically generated by JIRA.
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>