[JBossWS] - JAXWS: handlers and exceptions
by fburlet
Hi,
I don't understand everything in the exception handling in JAXWS.
I written a small webservice; the code is here under:
| package com.kiala.handler.test.webservice;
|
| import javax.ejb.Stateless;
| import javax.jws.HandlerChain;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
|
| import com.kiala.handler.test.exception.UserException;
|
| @Stateless
| @WebService
| @HandlerChain(file = "handler-chain.xml")
| @SOAPBinding(style = SOAPBinding.Style.RPC, use = SOAPBinding.Use.LITERAL)
| public class ExceptionService {
|
| public String throwException(String s) throws UserException {
| if ("Hello".equals(s)) {
| return "World!";
| } else {
| throw new UserException(s);
| }
| }
| }
|
UserException is a custom exception extending java.lang.Exception.
My question is: is UserException obliged to extend java.lang.RuntimeException in ordre to trigger the execution of the handlers's handleFault(MessageContext msgContext) method ? If I don't extend RuntimeException, the handleFault(MessageContext msgContext) is not executed... Note that the generated response is the same if I extend RuntimeException or not: the reason of my question. The specification and the doc is not clear (at least for me) about that.
I'm using jboss 4.2.0.GA and jbossws 1.2.1.GA with jdk 1.5.
Thanks for you help,
Fred.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4050115#4050115
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4050115
17 years, 4 months
[JBossWS] - MIssing wsdl4j.jar in scripts
by PeterJ
When I run the wsrunclient or wsprovide scripts (possibly also with wsconsume, but I am not sure), I get the following exception (if I use the --show-traces option to see what the error was):
Generating WSDL:
| SalesTaxService.wsdl
| Error: Could not generate. (use --show-traces to see full traces)
| java.lang.NoClassDefFoundError: javax/wsdl/WSDLException
| at org.jboss.ws.tools.wsdl.WSDLWriter.write(WSDLWriter.java:89)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.pr
| ocessOrGenerateWSDL(JAXWSWebServiceMetaDataBuilder.java:292)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.bu
| ildWebServiceMetaData(JAXWSWebServiceMetaDataBuilder.java:131)
| at org.jboss.ws.tools.jaxws.impl.WSContractProviderImpl.provide(WSContra
| ctProviderImpl.java:118)
| at org.jboss.ws.tools.jaxws.impl.WSContractProviderImpl.provide(WSContra
| ctProviderImpl.java:134)
| at org.jboss.ws.tools.jaxws.command.wsprovide.generate(wsprovide.java:16
| 7)
| at org.jboss.ws.tools.jaxws.command.wsprovide.main(wsprovide.java:76)
Adding the client/wsdl4j.jar file to the claspsath constructed in the script solves this problem. What bugs me about this is how these scripts that deal with WSDLs can even run without the WSDL JAR file being included? Is anyone else seeing this error?
I am seeing this in JBoss AS, both 5.0 beta2 and 4.2.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049921#4049921
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049921
17 years, 4 months