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 8844421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:28:57+00:00 2026-06-14T11:28:57+00:00

I have a spring Web Service, where I have a DAO with one method

  • 0

I have a spring Web Service, where I have a DAO with one method add() which is annotated with @Transactional like below:

class MyDAOClass {

    @Transactional(rollbackFor = Exception.class)
    add(){
        doAdd1();
        doAdd2();
        doAdd3();
    }

    ...

    doAdd2() throws MyException {
        throw new MyException ("My Exception Message");
    }

    ...

}

The service layer:

Now when I call the webservice, the service layer internally calls the add() method of this class. The service layer catches MyException e and gets the message and puts in the response object which is marshalled and sent back to the client. But, when the doAdd2() method throws the exception, the transaction is rolled back, and instead of “My Exception Message” , i get the following error message on the client side:

<SOAP-ENV:Body>
  <SOAP-ENV:Fault>
     <faultcode>SOAP-ENV:Server</faultcode>
     <faultstring xml:lang="en">Transaction rolled back because it has been marked as rollback-only</faultstring>
  </SOAP-ENV:Fault>

  • 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-14T11:28:58+00:00Added an answer on June 14, 2026 at 11:28 am

    Nevermind. I found the issue. I had my service class also annotated with @Transactional. The problem solved after I removed the this annotation. I am just keeping it for those who might be wondering why they get this message.

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

Sidebar

Related Questions

In a Spring web application I have several DAO and service layer beans. One
I have web service which return json string like : d={main0ID:abc.es/main,main1ID:ah/main} I wanna append
I have a small Spring web application, with the typical MVC Service DAO JPA/Hibernate
I have a Spring MVC web application with conroller like below : @Controller public
I have a Restful web service developed in Spring MVC which currently returns farmer
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 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
Have a RESTful web-serice with Facade layer, Service layer and Dao layer. Trying to

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.