-
Bug
-
Resolution: Done
-
Major
-
None
-
None
According to the JAX-RPC 1.1 specification, a service-specific exception class can feature non-writable properties (so long as there's a corresponding constructor parameter):
Section 4.3.6 XML->Java: "Each element inside the xsd:complexType is mapped to a getter method and a parameter in the constructor of the Java exception. Mapping of these elements follows the standard XML to Java type mapping.
...
package com.example;
public class InvalidTickerException extends java.lang.Exception {
public InvalidTickerException(String tickerSymbol)
public getTickerSymbol() { ... }
}
"
Section 5.5.5 Java->XML: "Multiple fields (each with a getter method and corresponding parameter in the constructor) in the Java exception class are mapped to elements of the xsd:complexType."
Section 7.3 of the "Web Services for J2EE, Version 1.1" document suggests the same interpretation when one examines the XML Schema definition of the 'exception-mappingType' and 'constructor-parameter-orderType' type definitions.
JBoss, however, can only cope well with read-only properties of exception classes where the properties do not have an array type. When any property in a service specifi exception has an array type, Jboss fails when trying to serialize the exception:
13:03:38,734 ERROR [BeanPropertyTarget] Could not convert [Ljava.lang.String; to bean field 'values[1]', type [Ljava.lang.String;
13:03:38,734 WARN [[EJBSessionComponent]] Servlet.service() for servlet EJBSessionComponent threw exception
AxisFault
faultCode:
Client
faultSubcode:
faultString: Null setter method specified.
faultActor:
faultNode:
faultDetail:
stackTrace: java.lang.IllegalAccessException: Null setter method specified.
at org.jboss.axis.utils.BeanPropertyDescriptor.set(BeanPropertyDescriptor.java:190)
at org.jboss.axis.utils.BeanPropertyDescriptor.growArrayToSize(BeanPropertyDescriptor.java:287)
at org.jboss.axis.utils.BeanPropertyDescriptor.set(BeanPropertyDescriptor.java:252)
at org.jboss.axis.encoding.ser.BeanPropertyTarget.set(BeanPropertyTarget.java:183)
at org.jboss.axis.encoding.DeserializerImpl.valueComplete(DeserializerImpl.java:305)
at org.jboss.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.java:590)
at org.jboss.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1249)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.jboss.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:257)
at org.jboss.axis.MessagePart.getAsSOAPEnvelope(MessagePart.java:684)
at org.jboss.axis.Message.getSOAPEnvelope(Message.java:428)
at org.jboss.axis.Message.getContentType(Message.java:494)
at org.jboss.axis.transport.http.AxisServlet.doPost(AxisServlet.java:971)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.jboss.axis.transport.http.AxisServletBase.service(AxisServletBase.java:370)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
For read/writable service sepcific exception properties of an array type no such exception is thrown.
- is related to
-
JBWS-181 Custom exception containing an array
- Closed