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 "Tom Jordahl (JIRA)" <ax...@ws.apache.org> on 2005/09/08 00:16:30 UTC

[jira] Commented: (AXIS-2200) Unable to throw CustomException without hostname and exceptionName being added to details

    [ http://issues.apache.org/jira/browse/AXIS-2200?page=comments#action_12322893 ] 

Tom Jordahl commented on AXIS-2200:
-----------------------------------

There is a switch that turns off the stack trace in the exception.  It would be reasonable to enhance that switch to turn off the hostname.  Note that the <exceptionName> element is a legacy left over from pre Axis 1.0 fault support and can probably be removed now.

Care to submit a patch Chris?

> Unable to throw CustomException without hostname and exceptionName being added to details
> -----------------------------------------------------------------------------------------
>
>          Key: AXIS-2200
>          URL: http://issues.apache.org/jira/browse/AXIS-2200
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2.1
>  Environment: Windows XP SP1, Sun JDK 1.4.2, JBoss 4.0.2/Tomcat 5.5.9 
>     Reporter: Chris Nappin

>
> When throwing an exception as a fault in Axis, it automatically adds a "hostname" and "exceptionName" to the "detail" section. Whilst I'm sure this can be really useful for debugging development systems, it should be possible to turn this behaviour off for a production system. Perhaps it could be tied to the "axis.development.system" flag, like stack traces in SOAP faults are?  Below is an example SOAP fault extract thrown by Axis:
> <soapenv:Fault>
>     <faultcode>soapenv:Server.generalException</faultcode>
>     <faultstring/>
>     <detail>
>         <com.test.MyFirstException>
>             <text>Test!</text>
>         </com.test.MyFirstException>
>         <ns1:exceptionName xmlns:ns1="http://xml.apache.org/axis/">
>             com.test.MyFirstException
>         </ns1:exceptionName>
>         <ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">
>             PC55-ABMUK
>         </ns2:hostname>
>     </detail>
> </soapenv:Fault>
> This SOAP extract is taken from a fault thrown by an auto-generated exception defined using the following wsdl:
> <!-- fault element -->
>   <xsd:element name="MyFirstException">
>    <xsd:complexType>
>     <xsd:sequence>
>      <xsd:element name="text" type="xsd:string" minOccurs="1" maxOccurs="1" nillable="false"/>
>     </xsd:sequence>
>    </xsd:complexType>
>   </xsd:element>
> ...
> <message name="MyFirstExceptionFault">
>     <part name="fault" element="typens:MyFirstException"/>
> </message>
> ...
> <portType name="MyPort">
> <operation name="test">
>     <input message="typens:Request"/>
>     <output message="typens:Response"/>
>     <fault name="MySecondException" message="typens:MySecondExceptionFault"/>
> </operation>
> </port>
> ...
> <binding name="MyBinding" type="typens:MyPort">
> 	<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
> 	<operation name="test">
> 	  <input>
> 		<soap:body use="literal"/>
> 	  </input>
> 	  <output>
> 		<soap:body use="literal"/>
> 	  </output>
>           <fault name="MyFirstException">
>                 <soap:fault name="MyFirstException" use="literal"/>
>           </fault>	    
> 	</operation>
>   </binding>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira