Erro ao pegar sessão

1 resposta
3rd_child

Bom dia pessoal,

estou fazendo um aplicação de teste e qdo tento executar ocorre o seguinte erro:

Exception in thread "main" org.hibernate.HibernateException: No CurrentSessionContext configured!
	at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:540)
	at com.jchrisos.dao.GenericDAO.create(GenericDAO.java:14)
	at com.jchrisos.test.Test.main(Test.java:21)

meu hibernate.cfg.xml está assim:

<!DOCTYPE hibernate-configuration PUBLIC
	"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
	"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
	<session-factory>
		<property name="show_sql">true</property>
		<property name="dialect">org.hibernate.dialect.MySQL5Dialect</property>
		<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
		<property name="connection.url">jdbc:mysql://localhost/test</property>
		<property name="connection.username">root</property>
		<property name="connection.password">123456</property>
		<mapping class="com.test.vo.PostVO"/>
	</session-factory>
</hibernate-configuration>

Agradeço desde já!
Obrigado!

1 Resposta

3rd_child

Consegui resolver pessoal!

Achei em um blog a solução, faltou colocar no meu hibernate.cfg.xml:

link do blog: http://www.jroller.com/page/HazemBlog?entry=hibernate_no_currentsessioncontext_configured

vlw pessoal! :wink:

Criado 11 de março de 2007
Ultima resposta 11 de mar. de 2007
Respostas 1
Participantes 1