2 Replies Latest reply on Feb 20, 2013 10:56 AM by Art O Cathain

    Bean Services - Exception handling

    Art O Cathain Newbie

      I'm new to Switchyard, and impressed so far.

       

      I've been playing with the quickstart demos. I am confused by the behaviour of a bean service call when an exception is thrown. For example, in the multiapp quickstart, if I change InventoryServiceBean:

       

       

        {code}  @Override

          public void createItem(Item item) {

                    if (item.getName().contains("foo")) {

                              throw new RuntimeException("bar, not foo");

                    }

              _inventory.put(item.getItemId(), item);

         {code}

       

      When I visit http://localhost:8080/switchyard-quickstart-demo-multi-web/home.jsf and put in "foo" in the name field and click Create, I get a positive response ("Item has been added"), but a stack trace on the console. I would have thought the Switchyard bean proxy would wrap and rethrow the exception somehow.

       

      In fact, if I neglect to deploy the switchyard-quickstart-demo-multi-order-service entirely, I get a console error ("No registered service found for {urn:switchyard-quickstart-demo:multiapp:0.1.0}InventoryService") but again, the call to createItem completes without an exception.

       

      I find this disconcerting to say the least. Is there some configuration I've missed?

       

      Art