You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "John G. Norman (JIRA)" <ji...@apache.org> on 2007/04/15 22:15:15 UTC

[jira] Updated: (AXIS2-2529) In ADBClient, exceptions of void-operations will not get delivered by the client

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

John G. Norman updated AXIS2-2529:
----------------------------------

    Attachment: pojo.zip

This is a hacked version of samples/pojo with the additional operations showing the issue. Just use the same instructions/ant targets as for samples/pojo supplied with the Axis2 1.1.1 download.


> In ADBClient, exceptions of void-operations will not get delivered by the client
> --------------------------------------------------------------------------------
>
>                 Key: AXIS2-2529
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2529
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.1.1
>         Environment: Windows XP at lesat
>            Reporter: John G. Norman
>            Priority: Critical
>         Attachments: pojo.zip
>
>
> This seems to be very similar to https://issues.apache.org/jira/browse/AXIS2-1277
> I'm setting the priority to "Critical" - 1277 was "Blocker."
> Below is an e-mail I posted to the user e-mail list. On the advice of Anne Thomas Manes, I'm filing this.
> -----
> My POJO-style client wasn't getting exceptions from its POJO-style
> service. So I went back to the samples/pojo example, and threw an
> exception from a method. The client got it. Hmm. I just couldn't
> figure out what the difference was between my code and the sample.
> Then I realized that my methods return void.
> So I added this to AddressBookService.java in samples/pojo, a method
> returning void, then a second returning String:
>   /** NOTE: returns void */
>    public void test1(String s) throws Exception {
>        throw new Exception("test1");
>    }
>    public String test2(String s) throws Exception {
>        throw new Exception("test2");
>    }
> And this to AddressBookADBClient.java:
>            /* test the operation returning void; want to see exception */
>            Test1 test1 = new Test1();
>            test1.setParam0("foo");
>            stub.test1(test1);
>            Test2 test2 = new Test2();
>            test2.setParam0("bar");
>            stub.test2(test2);
> Here's a snippet from the server-side log:
> Apr 14, 2007 10:55:28 AM
> org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver
> invokeBusinessLogic
> SEVERE: test1
> java.lang.reflect.InvocationTargetException
> Caused by: java.lang.Exception: test1
>        at sample.addressbook.service.AddressBookService.test1(Unknown Source)
>        ... 35 more
> Apr 14, 2007 10:55:29 AM
> org.apache.axis2.rpc.receivers.RPCMessageReceiver invokeBusinessLogic
> SEVERE: test2
> java.lang.reflect.InvocationTargetException
> Caused by: java.lang.Exception: test2
>        at sample.addressbook.service.AddressBookService.test2(Unknown Source)
>        ... 35 more
> As you can see, both exceptions are thrown.
> Now here's the client (NOTICE: No evidence of an exception from the
> test1 method):
> adb.client.run:
>     [java] Name   :Abby Cadabby
>     [java] Street :Sesame Street
>     [java] City   :Sesame City
>     [java] State  :Sesame State
>     [java] Postal Code :11111
>     [java] org.apache.axis2.AxisFault: test2
>     [java]     at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.jav
> a:271)
>     [java]     at
> org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.
> java:202)
>     [java]     at
> sample.addressbook.stub.AddressBookServiceStub.test2(Unknown Source)
> So I guess that the incredibly crude workaround -- just to get some working code --  is that I'll have to have all of my methods return something: Perhaps a String, or maybe I'll create a JavaBean class called Nothing. Or maybe even Void with a capital V.

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org