Problemas Com Hibernate + Spring

1 resposta
D

Bom dia Caros…

Sou iniciante no Spring… e criei uma aplicacao que roda o Hibernate + Spring…

só que quando tento Rodar algo relacionado ao Spring ta dando um erro assim…

GRAVE: java.lang.IllegalArgumentException: No SessionFactory specified
javax.faces.el.EvaluationException: java.lang.IllegalArgumentException: No SessionFactory specified

Segue meu AppContext

<?xml version="1.0" encoding="UTF-8"?>
<!-- data source -->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost/agenda" />
<property name="username" value="root" />
<property name="password" value="root" />
</bean>

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
    
    <property name="dataSource" ref="dataSource" />
    
    <property name="annotatedClasses">
        <list>
            <value>agenda.dao.entitybeans.Contato</value>
        </list>
    </property>
    <property name="hibernateProperties">
		<props>            
		  <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>  
          <prop key="show_sql">true</prop>  
          <prop key="hibernate.generate_statistics">true</prop>  
          <prop key="hibernate.use_sql_comments">true</prop>  
        </props> 
    </property>

</bean>
 
         
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
        <property name="sessionFactory" ref="sessionFactory" />
</bean>

Alguem pode me ajudar?

Valeu!!!

1 Resposta

D

opa!! postei no lugar errado…

close please!!!

Criado 16 de fevereiro de 2011
Ultima resposta 16 de fev. de 2011
Respostas 1
Participantes 1