0 Replies Latest reply on Sep 23, 2006 8:19 PM by Jeff Schnitzer

    Standard Java exceptions thrown from EJB3 web services?

    Jeff Schnitzer Newbie

      Hiya. I'm trying out the web service annotations for the first time, and hit a stumbling block.

      JBossWS doesn't seem to allow me to deploy EJB3 web service methods that throw standard java exceptions like UnsupportedEncodingException. Ie, a method like this:

      public void blah() throws UnsupportedEncodingException;

      Produces this exception on deployment:

      org.jboss.ws.WSException: Element message found in jaxrpc-mapping but not in the schema: {http://ws.subethamail.org/}UnsupportedEncodingException

      It works just fine if the declared exception is one of my own; the exception shows up in the WSDL schema section. However, when the exception is part of the JDK, the schema section says nothing. Note that problems also occur if my exception extends something other than java.lang.Exception itself.

      Is this expected behavior?
      Is there a way I can make standard declared java exceptions work just like my own exceptions?

      I've read the "Custom Exceptions" section of the user guide (and the linked IBM article) but it's oriented towards JSR-109 web services not EJB3 JSR-181 services.

      BTW this is 4.0.4.GA (from the latest installer, with ejb3rc8) using the stock JBossWS that comes with that version.

      Thanks in advance,
      Jeff Schnitzer
      http://subetha.tigris.org/ - hopefully soon to be a mailing list manager with web service APIs :-)