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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:20:43+00:00 2026-06-11T11:20:43+00:00

I have a REST Web Service API. I mapped database using JPA. I have

  • 0

I have a REST Web Service API. I mapped database using JPA. I have an entity “persona”. Adding a new entity with POST method works fine, also GET method works fine, but when I try to call PUT method, there is some exception that I found out while debugging: “Cannot suppress a null exception.” and “Self-suppression not permitted”. In the test database with other entities everything works fine…
Adding works almost the same like editing in my case – firstly I only get the values and then after changing I do everything the same, the only difference is that there is used method PUT instead of POST.

This is my PUT method (here the exception occurs):

 @PUT
@Consumes({"application/xml", "application/json"})
public Response edit(Persona entity) {
    try {
        getJpaController().edit(entity);
        return Response.ok().build();
    } catch (Exception ex) {
        return Response.notModified(ex.getMessage()).build();
    }
}

I’m working first time with web services, so I’m a newbie.

What can be the reason of such behaviour? What is this self-suppression error?

If you need any source code else, please, tell me, I will edit my post.

@EDIT:

I found some exception in JpaController Class, my Persona class has:

@OneToOne(cascade = CascadeType.ALL, mappedBy = "persona")
    private Personaacceso personaacceso;

In JpaController there is:

Personaacceso personaaccesoOld = persistentPersona.getPersonaacceso();
            Personaacceso personaaccesoNew = persona.getPersonaacceso();

if (personaaccesoOld != null && !personaaccesoOld.equals(personaaccesoNew)) {
                if (illegalOrphanMessages == null) {
                    illegalOrphanMessages = new ArrayList<String>();
                }
                illegalOrphanMessages.add("You must retain Personaacceso " + personaaccesoOld + " since its persona field is not nullable.");
            }

So there is showing a message that I have to retain Personaacceso. Any idea how to solve it?

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

    Okey, I know what was the reason now…

    Each Persona entity has some other entities (one-to-one or one-to-many). The Jpa Controller wasn’t retaining all these containing entities (instead, it was creating new ones). So, the data was lost and because of that persona entity wasn’t edited.

    Solution:
    To every containing entity do something like:

    containedEntityNew=containedEntityOld;
    

    However, take into consideration, that then these entity-fields are just rewrited from the old “main” entity.

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

Sidebar

Related Questions

I have an ASP.NET Web API (version 4) REST service where I need to
I'm adding an API to a Symfony-application which should act as a REST web-service.
I'm building an ASP.NET Web API REST service. The calls (URLs) I have to
I have created a REST web service and successfully used it with a client.
I want to build a REST web service on app engine. Currently i have
I have to map a REST Webservice URL like http://server:8080/application/service/customer/v1 to createCustomer method in
Background: I have a Visual Studio solution consisting of a website + REST web-service
I'm looking for how to do a POST request to a REST web service,
I have just created my first rest service using apicontroller. I am using it
Are there any known how-tos or best practices for web service REST API versioning?

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.