Guest User

Untitled

a guest
Jan 11th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. @SpringBootApplication
  2. public class SpringCd244ManyToManyBootApplication {
  3. public static void main(String[] args) {
  4. SpringApplication.run(SpringCd244ManyToManyBootApplication.class, args);
  5.  
  6. // create session factory
  7. SessionFactory factory = new Configuration()
  8. .configure("hibernate.cfg.xml")
  9. .addAnnotatedClass(Instructor.class)
  10. .addAnnotatedClass(InstructorDetail.class)
  11. .addAnnotatedClass(Course.class)
  12. .addAnnotatedClass(Review.class)
  13. .addAnnotatedClass(Student.class)
  14. .buildSessionFactory();
  15.  
  16. // create session
  17. Session session = factory.getCurrentSession();
  18. try {....
  19.  
  20. 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]
  21. Exception in thread "restartedMain" java.lang.reflect.InvocationTargetException
  22. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  23. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  24. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  25. at java.lang.reflect.Method.invoke(Method.java:498)
  26. at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
  27. 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]
  28. at org.hibernate.property.access.spi.GetterFieldImpl.get(GetterFieldImpl.java:74)
  29. at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValue(AbstractEntityTuplizer.java:626)
Add Comment
Please, Sign In to add comment