Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8689253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:35:57+00:00 2026-06-12T23:35:57+00:00

i have a web service with Spring and jaxb and i try to throw

  • 0

i have a web service with Spring and jaxb and i try to throw one exception in some cases, for this I use the anotation @WebFault. just like this:

@WebFault
public class ServiceException extends Exception {

private static final long serialVersionUID = -5307754615848423430L;
private FaultBean faultBean;

public ServiceException(String message, ServiceErrorCode serviceErrorCode) {
        super(message);
        this.faultBean = new FaultBean();
        this.faultBean.setMessage(message);
        this.faultBean.setErrorCode(serviceErrorCode);
}

public FaultBean getFaultInfo() {
    return faultBean;
}

}

and it’s work fine, this is the output:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <S:Fault xmlns:ns3="http://www.w3.org/2003/05/soap-envelope">
         <faultcode>S:Server</faultcode>
         <faultstring>myException</faultstring>
         <detail>
            <ns2:ServiceException xmlns:ns2="http://soap.service.test/">
           <errorCode>UNRECOGNIZED_ERROR</errorCode>
           <message>myException</message>
        </ns2:ServiceException>
        <ns2:exception class="ServiceException" note="To disable this feature, set com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace system property to false" xmlns:ns2="http://jax-ws.dev.java.net/">
           <message>myException</message>
           <ns2:stackTrace>
              <ns2:frame class="myWebService" file="myWebService.java" line="50" method="listTickets"/>
              <ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="NativeMethodAccessorImpl.java" line="native" method="invoke0"/>
              <ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="NativeMethodAccessorImpl.java" line="39" method="invoke"/>
              <ns2:frame class="sun.reflect.DelegatingMethodAccessorImpl" file="DelegatingMethodAccessorImpl.java" line="25" method="invoke"/>
              <ns2:frame class="java.lang.reflect.Method" file="Method.java" line="597" method="invoke"/>
              <ns2:frame class="com.sun.xml.ws.api.server.InstanceResolver$1" file="InstanceResolver.java" line="246" method="invoke"/>
              <ns2:frame class="com.sun.xml.ws.server.InvokerTube$2" file="InvokerTube.java" line="146" method="invoke"/>
              <ns2:frame class="com.sun.xml.ws.server.sei.EndpointMethodHandler" file="EndpointMethodHandler.java" line="257" method="invoke"/>
              <ns2:frame class="com.sun.xml.ws.server.sei.SEIInvokerTube" file="SEIInvokerTube.java" line="93" method="processRequest"/>
              <ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="595" method="__doRun"/>
              <ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="554" method="_doRun"/>
              <ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="539" method="doRun"/>

…

so the problem is that does not seem correct show the stacktrace of the error, because the client does not care about those details, but can not find the way to do this, any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:35:59+00:00Added an answer on June 12, 2026 at 11:35 pm

    Propagation of Stack trace is on by default.
    If you think its not safe for your Web Service Application to send the complete stack trace, you can turn off this functionality.
    I am sure you want to set it in the server’s VM.If yes :

    Effectively we need to configure the WLS server to include the following option on startup:

    -Dcom.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace=false
    

    For WLS 10.3 this entry should be included in your startWebLogic.cmd file.

    For a standalone WLS this file is found under:

    <WLS_HOME>/user_projects/domains/<YOUR_DOMAIN>/bin
    

    For the integrated WLS within JDeveloper 11g it’s found under:

    <JDEV_HOME>\system\system11.1.1.0.31.51.88\DefaultDomain\bin
    

    Locate the following entry in the startWebLogic.cmd file:

    set JAVA_OPTIONS=%SAVE_JAVA_OPTIONS%
    

    ..and change it to:

    set JAVA_OPTIONS=-Dcom.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace=false %SAVE_JAVA_OPTIONS%
    

    Restart the WLS server, and reinvoking the web service with an invalid SOAP payload.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have decided to use Spring, Hibernate, and Restlet to create a web service.
I have Spring MVC + JAXB web service and Flex client. I am getting
I have a web service written in Spring MVC. It can be used by
I'm using spring ws 2.0.2.RELEASE I have a web service that creates a sales
I have a spring roo web service that I am currently building out but
I have a spring-based Web Service. I now want to build a sort of
I have a web service that returns this string via the jQuery $.ajax() call
I have a web service. I use it to accept a base 64 string
I have a REST web service built with Spring MVC, with annotation-based configuration and
I have been trying to use @Resource and @Service annotations in Spring as follows.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.