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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:06:00+00:00 2026-05-27T12:06:00+00:00

I am getting started with Hibernate, and I am getting the following error for

  • 0

I am getting started with Hibernate, and I am getting the following error for an entity which is supposed to have an enum type.

java.lang.IllegalArgumentException: No enum const class app.entity.ObjType.
java.lang.Enum.valueOf(Enum.java:214)
    org.hibernate.type.EnumType.nullSafeGet(EnumType.java:125)
    org.hibernate.type.CustomType.nullSafeGet(CustomType.java:109)
    org.hibernate.type.AbstractType.hydrate(AbstractType.java:104)
    org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2283)

I have the following enum type defined:

package app.entity;

@Entity
class Example {
    @Enumerated(EnumType.STRING)
    private ObjType type;
}

And the defined Enum class is as follows:

package app.entity;

public enum ObjType {
    typeA,
    typeB
}

What am I doing wrong? Also do set and get methods also have to be annotated with “@Enumerated(EnumType.STRING)” ?

I would appreciate any help.
Thanks

  • 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-27T12:06:01+00:00Added an answer on May 27, 2026 at 12:06 pm

    I think you have an empty value in the database which it is trying to load and it can’t find an enum value for the empty value. Note the extra . at the end of the error message

    app.entity.ObjType.
    

    where it has tried to concat “” with the enum class.

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

Sidebar

Related Questions

I am just getting started working on a Java Struts Hibernate based Web App
I am just getting started on Java, Struts, Hibernate, Tomcat - based Web App
I'm getting started in Hibernate and so far it's not too hard. But I
Getting started with jquery and having trouble getting hello world type example going for
Just getting started using MVC in ASP.NET, I'm going to have it so users
I'm getting the following exception when I try to run my HQL query: java.util.concurrent.ExecutionException:
I have a few Hibernate Envers listeners which I use for audit purposes. I
I'm getting started with JPA and created the following (simplified) tables; airport -------- id
I'm just getting started with Hibernate, and all the examples I'm seeing so far
I am trying to learn Spring Roo following the tutorial Getting Started with Spring

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.