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

  • Home
  • SEARCH
  • 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 915099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:49:51+00:00 2026-05-15T17:49:51+00:00

I am having a really strange problem implementing Java REST service. I am trying

  • 0

I am having a really strange problem implementing Java REST service. I am trying receive the following model:

@Data @EqualsAndHashCode(callSuper=false, of={"primaryKey"}) 
@Entity @Table(name = "T_UNIQUE_IDENT_TYPE")
@Cache(usage=CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@XmlRootElement(name="UniqueIdentifierType") @XmlAccessorType(XmlAccessType.FIELD)
public class UniqueIdentifierType extends AbstractEntityWithTime implements Serializable {
    private static final long serialVersionUID = 1L;    
    @Id @Basic(optional = false) @Column(name = "F_TYPE_PK") @XmlTransient
    @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="S_UNIQUE_IDENT_TYPE") @SequenceGenerator(name="S_UNIQUE_IDENT_TYPE",sequenceName="S_UNIQUE_IDENT_TYPE") 
    private Long primaryKey;
    @Column(name = "F_NAME", nullable=false, length=50)
    private String typeName;
    @Basic(optional = false) @Column(name = "F_CREATION_TIME") @Temporal(TemporalType.TIMESTAMP) @XmlTransient
    private Calendar creationTime;
    @Basic(optional = false) @Column(name = "F_LASTMODIFY_TIME") @Temporal(TemporalType.TIMESTAMP) @XmlTransient
    private Calendar lastModifyTime;
    @JoinColumn(name = "F_UNIT_PK", referencedColumnName = "F_UNIT_PK") @ManyToOne(optional = false) @XmlTransient
    private SoftwareProviderUnit softwareProviderUnit;
}

My GET rest service has the following signature:

@GET 
@Path("/{name}") 
public UniqueIdentifierType get(@PathParam("unitId") final Long unitId, @PathParam("name") final String name) throws WebApplicationException {

Whenever I do a call on this GET service I receive 500 error containing

java.lang.AssertionError: JAXBException occurred : 2 counts of IllegalAnnotationExceptions

I was able to trace it down to the following two errors:

javassist.util.proxy.MethodHandler is an interface, and JAXB can't handle interfaces.
    this problem is related to the following location:
        at javassist.util.proxy.MethodHandler
        at private javassist.util.proxy.MethodHandler com.rp.central.model.UniqueIdentifierType_$$_javassist_21.handler
        at com.rp.central.model.UniqueIdentifierType_$$_javassist_21

javassist.util.proxy.MethodHandler does not have a no-arg default constructor.
    this problem is related to the following location:
        at javassist.util.proxy.MethodHandler
        at private javassist.util.proxy.MethodHandler com.rp.central.model.UniqueIdentifierType_$$_javassist_21.handler
        at com.rp.central.model.UniqueIdentifierType_$$_javassist_21

The weird thing is that if I change the GET method signature to return a List I get 200 with the JSON view of the object which has all the fields except for the typeName field. I am guessing that the exception is somehow related to that field. I’ve tried adding explicit getters such as

@XmlElement(name="typeName")
public String getTypeName() {
    return typeName;
}

to try to force it to send the typeName, this gets the type name into the “List” version of the GET method but still returns 500 for the non list one. The strange thing is that I have another model which looks exactly the same as this one and works without any problems. I’ve been banging my head against this for a while now, any help will be greatly appreciated.

Thank you.

  • 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-05-15T17:49:51+00:00Added an answer on May 15, 2026 at 5:49 pm

    The exception clearly says that JAXB can’t marshal your UniqueIdentifierType, because the object being marshalled is actually an instance of the class enhanced by Javassist (com.rp.central.model.UniqueIdentifierType_$$_javassist_21), and that class contains a field (added by Javassist) which can’t be marshalled. Probably, ehancement is done by your ORM tool.

    The most obvious solution is to return a fresh copy of the object.

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

Sidebar

Ask A Question

Stats

  • Questions 530k
  • Answers 530k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use a DataGridViewLinkColumn. The link shows an example of setting… May 16, 2026 at 11:29 pm
  • Editorial Team
    Editorial Team added an answer Here's something I came up with: using System; using System.Text.RegularExpressions;… May 16, 2026 at 11:29 pm
  • Editorial Team
    Editorial Team added an answer So I've been struggling with this all day, and sure… May 16, 2026 at 11:29 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Having a really strange problem. Scenario: PHP5.2.9, IIS7, PHP running as FastCGI. I have
i'm having some really strange problem. i wrote a filemanager in PHP with the
I am having some strange problem and its really frustating me. I have a
This is a really strange problem, that appears to be somewhat intermittent (although it
I'm having a strange problem with adding a UINavigationController to my iPhone application. I
Hi guys I am having a very strange problem in ie with the append
I'm new to Ruby, and I'm having a strange problem with the inject method.
I have been having the following problem, i think it's probably due to the
I'm having this problem with UTF8 string comparison which I really have no idea
We have a strange problem. I added a couple of new schema's and orchestrations

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.