Hibernate .. conexao

2 respostas
W

alguem conseg me ajudar com este erro…

com esta classe…

package util;

import org.hibernate.Session;

import org.hibernate.SessionFactory;

import org.hibernate.cfg.AnnotationConfiguration;
public class ConnectionHibernateFactory {

private static final SessionFactory sessionFactory;

private static final ThreadLocal threadLocal = new ThreadLocal();
static{  //DAH ERRO AQUI AO INSTANCIAR O SESSION FECTORY

	sessionFactory = new AnnotationConfiguration()
	.configure("hibernate.cfg.xml").buildSessionFactory();
}


public static Session getInstance(){
	Session session = threadLocal.get();
	session = sessionFactory.openSession();
	threadLocal.set(session);
	return session;
}

}

dah o seguinte erro…

HTTP Status 500 -


type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Could not initialize class util.ConnectionHibernateFactory

org.vraptor.VRaptorServlet.service(VRaptorServlet.java:95)

javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

java.lang.NoClassDefFoundError: Could not initialize class util.ConnectionHibernateFactory

logic.SisUsuarioLogic.validaLogin(SisUsuarioLogic.java:27)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

java.lang.reflect.Method.invoke(Unknown Source)

org.vraptor.component.DefaultLogicMethod.execute(DefaultLogicMethod.java:61)

org.vraptor.interceptor.ExecuteLogicInterceptor.intercept(ExecuteLogicInterceptor.java:32)

org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:72)

org.vraptor.interceptor.SettingAndValidationInterceptor.intercept(SettingAndValidationInterceptor.java:131)

org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:72)

org.vraptor.interceptor.InjectionInterceptor.intercept(InjectionInterceptor.java:41)

org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:72)

org.vraptor.interceptor.ComponentLookupInterceptor.intercept(ComponentLookupInterceptor.java:58)

org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:72)

org.vraptor.interceptor.FlashScopeInterceptor.intercept(FlashScopeInterceptor.java:22)

org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:72)

org.vraptor.interceptor.RegisterAttributesInteceptor.intercept(RegisterAttributesInteceptor.java:38)

org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:72)

org.vraptor.core.VRaptorExecution.execute(VRaptorExecution.java:98)

org.vraptor.core.DefaultController.execute(DefaultController.java:46)

org.vraptor.VRaptorServlet.service(VRaptorServlet.java:70)

javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.14 logs.

2 Respostas

fiaux

Tá faltando jar do hibernate?

W

nao… naum eh o jar… eu add no projeto …

Criado 1 de setembro de 2008
Ultima resposta 1 de set. de 2008
Respostas 2
Participantes 2