[ 
https://issues.apache.org/jira/browse/TUSCANY-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12589541#action_12589541
 ] 

Ramkumar Ramalingam commented on TUSCANY-1867:
----------------------------------------------

This JIRA talks about producing better exception message for those methods with 
@OneWay annotations, when these method does not have "void" return type. The 
best place to throw this exception would be in the 
org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceIntrospectorImpl 
code as shown below, instead of allowing them to crop-up in the axis2 code.

            boolean nonBlocking = method.isAnnotationPresent(OneWay.class);
            if (nonBlocking) {
                if (!(returnType == void.class)) {
                        throw new InvalidOperationException(
                            "Method should return 'void' when declared with an 
@OneWay annotation.",
                            method);
                }
                if (!(faultTypes.length == 0)) {
                        throw new InvalidOperationException(
                            "Method should not declare exceptions with an 
@OneWay annotation.",
                            method);
                }
            }

I'll attach a patch with this fix.

> @OneWay with String return type causes NullPointerException
> -----------------------------------------------------------
>
>                 Key: TUSCANY-1867
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1867
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Axis Binding Extension
>    Affects Versions: Java-SCA-1.0
>         Environment: Windows XP
>            Reporter: Simon Nash
>            Assignee: Ramkumar Ramalingam
>             Fix For: Java-SCA-Next
>
>
> I tried using @OneWay on a method with a String return type and I got a 
> NullPointerException, like this:
> Exception in thread "Axis2 Task" java.lang.NullPointerException
>         at 
> org.apache.axis2.description.OutInAxisOperationClient$NonBlockingInvocationWorker.run(OutInAxisOperation.java:444)
>         at 
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
>         at 
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
>         at java.lang.Thread.run(Thread.java:595)
> We should produce a better exception to tell the user what he/she has done 
> wrong.

-- 
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