Olá, estou desenvolvendo uma aplicação usando Struts, Spring e Hibernate.
A integração entre o Struts e o Spring eu já consegui fazer.
Já a integração do Spring com o Hibernate está complicado.
Esse erro eu não estou conseguindo entender.
Esse é o arquivo action-servlet.xml
Código:
<?xml version="1.0" encoding="UTF-8" ?>
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://localhost:3306/chat</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value>spectrum4vn</value>
</property>
<!-- Referência dos arquivos de mapeamento -->
<property name="mappingResources">
<list><!-- br/com/integrator/dao/ -->
<value>br/com/integrator/dao/Agenda.hbm.xml</value>
<value>br/com/integrator/dao/Cadastro.hbm.xml</value>
<value>br/com/integrator/dao/Usuario.hbm.xml</value>
</list>
</property>
<!-- Configuração de Dialeto do Banco de Dados -->
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
e este é parte do erro
Código:
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFactory’ defined in ServletContext resource [/WEB-INF/action-servlet.xml]: Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource [br/com/integrator/dao/Agenda.hbm.xml] cannot be opened because it does not exist
Caused by: java.io.FileNotFoundException: class path resource [br/com/integrator/dao/Agenda.hbm.xml] cannot be opened because it does not exist
Neste erro ele me diz que não está conseguindo acessar o arquivo Agenda.hbm.xml, mas o caminho está correto, não entendi porque não está funcionando, já pesquisei, ja mudei o arquivo para a pasta raiz, já coloquei na mesma pasta que o arquivo .class.
Qualquer ajuda é bem vinda.
muito obrigado.