17

I'm getting the following error after i try to load an entity by id in hibernate

Course is in unnamed module of loader 'app';

here is an example of my hibernate load code:

 Course temp = (Course) currentSession.load(Course.class, cid);

P.S: i have thymeleaf and java 11 if that matters

Important : I am using spring-boot-devtools If i remove devtools from maven everything works fine

Farshid
  • 187
  • 1
  • 1
  • 5
  • 5
    I can't help you as to what the issue is, but I would like to thank you for pointing out that that issue gets caused by spring-boot-devtools -- saved me so much time by just removing that from my project! – Sophia Price May 22 '19 at 10:25

1 Answers1

4

I have got same issue, and find answer here - https://github.com/springdoc/springdoc-openapi/issues/386. If "Course" class nested in external .jar, you shold include this .jar to load by “restart” devtools classloader. How to do it describe here - https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-devtools-customizing-classload.

  • 9
    While these links may answer the question, it is better to include the essential parts of the answer here and provide the links for reference. Link-only answers can become invalid if the linked page changes. [Answers that are little more than a link may be deleted](https://stackoverflow.com/help/deleted-answers). – Cray Feb 13 '20 at 09:15
  • @vasilii_yar I am sorry I can't understand the solutions in that link, can you please explain the answer? – Sanal S Oct 11 '22 at 11:01
  • @Sanal S Hi! If you get issue - is in unnamed module of loader 'app', you have two variants: 1. Delete spring-boot-devtools from maven dependencies 2. Create file spring-devtools.properties in META-INF folder on project class path, and add string with restart.include.projectcommon=. If you chose first variant, you lose fast restart option. – vasilii_yar Oct 13 '22 at 07:47