steve-perkins / fitnessjiffy-spring

Diet and exercise tracker... a robust Spring Boot sample application
http://steveperkins.com/use-spring-boot-next-project/
115 stars 52 forks source link

Error at running #5

Open jbarros35 opened 9 years ago

jbarros35 commented 9 years ago

Finally after installing all of this with mysql and connecting OK to it I got an error like that Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userToUserDTO' defined in file [C:\Users\jose.barros\Documents\workspace-sts-3.7.0.RELEASE\fitnessjiffy-spring-master\target\classes\com\steveperkins\fitnessjiffy\dto\converter\UserToUserDTO.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [com.steveperkins.fitnessjiffy.repository.WeightRepository]: : Error creating bean with name 'weightRepository': Cannot create inner bean '(inner bean)#32c0915e' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#32c0915e': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Missing table: exercise; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'weightRepository': Cannot create inner bean '(inner bean)#32c0915e' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#32c0915e': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Missing table: exercise

Do you know how to turn into auto generating tables and entities? How can I make it done its supposed to be simple

tjago commented 8 years ago

I played with this example as you did. Got same error. What I did:

After that you can ignite app with: mvn spring-boot:run (should be no errors hopefully) open browser with address: localhost:3002 and you get login screen, but you won't be able to login without a single user created.

There's also no Controller in /src handling login RequestMapping from what I see. But it's just begging, at least app should compile, so play with the code and see what you can learn from it. :)