Eu já estou na 8° aula do curso de spring-mvc-1 mas desde a 3°, estou tendo
problemas, antes era só quando cadastrava um produto, agora essa é a saida
que aparece no meu console:
SEVERE: Servlet.init() for servlet [SpringDispatcher] threw exception
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productsController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private homecode.CasadoCodigo.daos.DAOProduct homecode.CasadoCodigo.controller.ProductsController.daop; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DAOProduct': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.persistence.EntityManagerFactory]
...
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private homecode.CasadoCodigo.daos.DAOProduct homecode.CasadoCodigo.controller.ProductsController.daop; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DAOProduct': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.persistence.EntityManagerFactory]
...
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DAOProduct': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.persistence.EntityManagerFactory]
...
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.persistence.EntityManagerFactory]
...
SEVERE: Servlet [SpringDispatcher] in web application [/CasadoCodigo] threw load() exception
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.persistence.EntityManagerFactory]
Porém, embora todos esses erros, e diferente de antes, que não havia o menor
contato com o banco de dados, dessa vez houve uma alteração:
Hibernate: alter table Product_preços drop foreign key FK_2ytx0bjix3jc13fywme06sujd
Hibernate: drop table if exists Product
Hibernate: drop table if exists Product_preços
Hibernate: create table Product (id integer not null auto_increment, desc varchar(255), paginas integer, titulo varchar(255), primary key (id))
Hibernate: create table Product_preços (Product_id integer not null, tipo integer, valor decimal(19,2))
Hibernate: alter table Product_preços add constraint FK_2ytx0bjix3jc13fywme06sujd foreign key (Product_id) references Product (id)