Pessoal, preciso preencher um ‘select’ com os nome dos departamentos. Acredito que as coisas estejam certas… mas acontece o seguinte erro.
Agradeço a ajuda…
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: Unable to instantiate using public br.com.kelow.logic.DaoInterceptor()
org.vraptor.VRaptorServlet.service(VRaptorServlet.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
org.vraptor.interceptor.InterceptorInstantiationException: Unable to instantiate using public br.com.kelow.logic.DaoInterceptor()
org.vraptor.interceptor.InterceptorDealer.poll(InterceptorDealer.java:68)
org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:58)
org.vraptor.interceptor.RegisterAttributesInteceptor.intercept(RegisterAttributesInteceptor.java:57)
org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:72)
org.vraptor.core.VRaptorExecution.execute(VRaptorExecution.java:89)
org.vraptor.core.VRaptorController.execute(VRaptorController.java:39)
org.vraptor.VRaptorServlet.service(VRaptorServlet.java:57)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
org.vraptor.component.ComponentInstantiationException: Unable to instantiate using public br.com.kelow.logic.DaoInterceptor()
org.vraptor.component.ComponentConstructor.newInstance(ComponentConstructor.java:45)
org.vraptor.interceptor.InterceptorType.newInstance(InterceptorType.java:67)
org.vraptor.interceptor.InterceptorDealer.poll(InterceptorDealer.java:62)
org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:58)
org.vraptor.interceptor.RegisterAttributesInteceptor.intercept(RegisterAttributesInteceptor.java:57)
org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:72)
org.vraptor.core.VRaptorExecution.execute(VRaptorExecution.java:89)
org.vraptor.core.VRaptorController.execute(VRaptorController.java:39)
org.vraptor.VRaptorServlet.service(VRaptorServlet.java:57)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
java.lang.reflect.InvocationTargetException
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
java.lang.reflect.Constructor.newInstance(Unknown Source)
org.vraptor.component.ComponentConstructor.newInstance(ComponentConstructor.java:43)
org.vraptor.interceptor.InterceptorType.newInstance(InterceptorType.java:67)
org.vraptor.interceptor.InterceptorDealer.poll(InterceptorDealer.java:62)
org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:58)
org.vraptor.interceptor.RegisterAttributesInteceptor.intercept(RegisterAttributesInteceptor.java:57)
org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:72)
org.vraptor.core.VRaptorExecution.execute(VRaptorExecution.java:89)
org.vraptor.core.VRaptorController.execute(VRaptorController.java:39)
org.vraptor.VRaptorServlet.service(VRaptorServlet.java:57)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
java.lang.ExceptionInInitializerError
br.com.kelow.dao.DaoFactory.(DaoFactory.java:22)
br.com.kelow.logic.DaoInterceptor.(DaoInterceptor.java:13)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
java.lang.reflect.Constructor.newInstance(Unknown Source)
org.vraptor.component.ComponentConstructor.newInstance(ComponentConstructor.java:43)
org.vraptor.interceptor.InterceptorType.newInstance(InterceptorType.java:67)
org.vraptor.interceptor.InterceptorDealer.poll(InterceptorDealer.java:62)
org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:58)
org.vraptor.interceptor.RegisterAttributesInteceptor.intercept(RegisterAttributesInteceptor.java:57)
org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:72)
org.vraptor.core.VRaptorExecution.execute(VRaptorExecution.java:89)
org.vraptor.core.VRaptorController.execute(VRaptorController.java:39)
org.vraptor.VRaptorServlet.service(VRaptorServlet.java:57)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
org.hibernate.MappingException: Could not determine type for: java.util.List, at table: departamento, for columns: [org.hibernate.mapping.Column(funcionarios)]
org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:269)
org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
org.hibernate.mapping.Property.isValid(Property.java:185)
org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:440)
org.hibernate.mapping.RootClass.validate(RootClass.java:192)
org.hibernate.cfg.Configuration.validate(Configuration.java:1108)
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1293)
org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)
br.com.kelow.util.HibernateUtil.(HibernateUtil.java:15)
br.com.kelow.dao.DaoFactory.(DaoFactory.java:22)
br.com.kelow.logic.DaoInterceptor.(DaoInterceptor.java:13)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
java.lang.reflect.Constructor.newInstance(Unknown Source)
org.vraptor.component.ComponentConstructor.newInstance(ComponentConstructor.java:43)
org.vraptor.interceptor.InterceptorType.newInstance(InterceptorType.java:67)
org.vraptor.interceptor.InterceptorDealer.poll(InterceptorDealer.java:62)
org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:58)
org.vraptor.interceptor.RegisterAttributesInteceptor.intercept(RegisterAttributesInteceptor.java:57)
org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:72)
org.vraptor.core.VRaptorExecution.execute(VRaptorExecution.java:89)
org.vraptor.core.VRaptorController.execute(VRaptorController.java:39)
org.vraptor.VRaptorServlet.service(VRaptorServlet.java:57)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs.
Apache Tomcat/5.5.26
Mande pra nós o mapeamento no lugar que está dando a exceção.
pafuncio,
cara eu acho que eu já consegui resolver isso ai…obrigado pela ajuda.
Mas ainda to tendo problema com outras coisas,
se você puder me ajudar eu agradeço, e muito.
O problema é seguinte. Eu preciso fazer um select dos departamentos que eu tenho para na hora de cadastrar um funcionario ficar legal, porque se não vou ter que trabalhar com os id´s, o que não é bom… Então, entre departamento e funcionario existe um relacionamento 1…n e o problema maior é que a chave do departamento é composta. To pelejando nisso faz tempo e não saio do canto. Se puder ajudar…
Valeu,
Tales.
Oi Tales,
A princípio, na sua tela de cadastro dos funcionários faça a listagem dos departamentos normalmente, por exemplo:
session.createCriteria(Departamento.class).list();
Depois, quando vc for persistir o seu funcionário, passe para ele o departamento que o usuário escolheu, pegando-o pelo codigo.
public void adicionaFuncionario(Funcionario f, Long codigoDepartamento) {
Departamento departamento = departamentoDAO.getById(codigoDepartamento);
f.setDepartamento(meuDepartamento);
funcionarioDAO.save(f);
}
Abs.