Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @SpringBootApplication
- public class SpringCd244ManyToManyBootApplication {
- public static void main(String[] args) {
- SpringApplication.run(SpringCd244ManyToManyBootApplication.class, args);
- // create session factory
- SessionFactory factory = new Configuration()
- .configure("hibernate.cfg.xml")
- .addAnnotatedClass(Instructor.class)
- .addAnnotatedClass(InstructorDetail.class)
- .addAnnotatedClass(Course.class)
- .addAnnotatedClass(Review.class)
- .addAnnotatedClass(Student.class)
- .buildSessionFactory();
- // create session
- Session session = factory.getCurrentSession();
- try {....
- 2018-01-11 20:45:33.261 INFO 5772 --- [ restartedMain] org.hibernate.orm.connections.pooling : HHH10001008: Cleaning up connection pool [jdbc:mysql://localhost:3306/webapp?useSSL=false]
- Exception in thread "restartedMain" java.lang.reflect.InvocationTargetException
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
- at java.lang.reflect.Method.invoke(Method.java:498)
- at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
- Caused by: org.hibernate.property.access.spi.PropertyAccessException: Error accessing field [private io.scalando.Instructor io.scalando.Course.instructor] by reflection for persistent property [io.scalando.Course#instructor] : Course [id=0, title=Pacman - How To Score One Million Points]
- at org.hibernate.property.access.spi.GetterFieldImpl.get(GetterFieldImpl.java:74)
- at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValue(AbstractEntityTuplizer.java:626)
Add Comment
Please, Sign In to add comment