Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "is in unnamed module of loader 'app';" with hibernate.load

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

like image 921
Farshid Avatar asked Apr 13 '19 10:04

Farshid


1 Answers

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.

like image 125
vasilii_yar Avatar answered Dec 16 '22 03:12

vasilii_yar