Oi pessoal!
Desculpem amolar com este assunto de Classes, mas hj apresentei o meu projeto ao professor orientador e segundo ele eu deveria alterar algumas coisas aqui, pois do jeito que está causa perda de performance.
Tenho uma Classe Imovel com um atributo "avatar e tenho um List de Fotos:
@OneToMany(targetEntity=Foto.class, mappedBy = "imovel",orphanRemoval=true)
public List<Foto> fotos;
public Foto getAvatar() {
return avatar;
}
E na classe Foto tenho:
@ManyToOne
private Imovel imovel;
Ele disse que usar esse list na classe Imovel causa perda de performance e que deveria ter apenas aquela anotação na classe Foto.
Outra coisa que ele sugeriu foi transformar os atributos categoria, status e modalidade em classes e fazer associação com Imovel em @OneToOne, fiz isso:
// outros atributos
@OneToOne(cascade=CascadeType.ALL)
@JoinColumn(name="cod_status")
private Status status;
@OneToOne(cascade=CascadeType.ALL)
@JoinColumn(name="cod_modalidade")
private Modalidade modalidade;
@OneToOne(cascade=CascadeType.ALL)
@JoinColumn(name="cod_categoria")
private Categoria categoria;
// gets, sets e metodo construtor
Adicionei ao HibernateUtil estas três novas classes e agora tá pipocando erro que não sei o motivo, não esperava que mudar estas anotações fosse causar tanto problema, segue a stacktrace:
23/08/2010 23:49:28 org.apache.catalina.core.ApplicationContext log
SEVERE: Unhandled exception occurred whilst decorating page
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'indexController' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/controller/IndexController.class]: Unsatisfied dependency expressed through constructor argument with index 2 of type [br.com.imobiliaria.component.Email]: : Error creating bean with name 'email' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/component/Email.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [br.com.imobiliaria.dao.ImovelDAO]: : Error creating bean with name 'imovelDAO' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/dao/ImovelDAO.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [br.com.imobiliaria.dao.ImovelDAO]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'imovelDAO' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/dao/ImovelDAO.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [br.com.imobiliaria.dao.ImovelDAO]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'email' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/component/Email.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [br.com.imobiliaria.dao.ImovelDAO]: : Error creating bean with name 'imovelDAO' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/dao/ImovelDAO.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [br.com.imobiliaria.dao.ImovelDAO]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'imovelDAO' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/dao/ImovelDAO.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [br.com.imobiliaria.dao.ImovelDAO]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:698)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:192)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:984)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:886)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:328)
at org.springframework.web.context.request.AbstractRequestAttributesScope.get(AbstractRequestAttributesScope.java:43)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:385)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:375)
at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1069)
at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:221)
at br.com.caelum.vraptor.ioc.spring.VRaptorApplicationContext.getBean(VRaptorApplicationContext.java:242)
at br.com.caelum.vraptor.ioc.spring.SpringBasedContainer.instanceFor(SpringBasedContainer.java:59)
at br.com.caelum.vraptor.interceptor.InstantiateInterceptor.intercept(InstantiateInterceptor.java:41)
at br.com.caelum.vraptor.core.InstantiatedInterceptorHandler.execute(InstantiatedInterceptorHandler.java:47)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65)
at br.com.imobiliaria.interceptor.NoCacheInterceptor.intercept(NoCacheInterceptor.java:41)
at br.com.caelum.vraptor.core.InstantiatedInterceptorHandler.execute(InstantiatedInterceptorHandler.java:47)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65)
at br.com.caelum.vraptor.util.jpa.JPATransactionInterceptor.intercept(JPATransactionInterceptor.java:48)
at br.com.caelum.vraptor.core.InstantiatedInterceptorHandler.execute(InstantiatedInterceptorHandler.java:47)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65)
at br.com.caelum.vraptor.interceptor.InterceptorListPriorToExecutionExtractor.intercept(InterceptorListPriorToExecutionExtractor.java:46)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65)
at br.com.caelum.vraptor.interceptor.FlashInterceptor.intercept(FlashInterceptor.java:81)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65)
at br.com.caelum.vraptor.interceptor.ResourceLookupInterceptor.intercept(ResourceLookupInterceptor.java:67)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:56)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65)
at br.com.caelum.vraptor.core.DefaultRequestExecution.execute(DefaultRequestExecution.java:70)
at br.com.caelum.vraptor.VRaptor$1.insideRequest(VRaptor.java:92)
at br.com.caelum.vraptor.ioc.spring.SpringProvider.provideForRequest(SpringProvider.java:56)
at br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:89)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'email' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/component/Email.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [br.com.imobiliaria.dao.ImovelDAO]: : Error creating bean with name 'imovelDAO' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/dao/ImovelDAO.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [br.com.imobiliaria.dao.ImovelDAO]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'imovelDAO' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/dao/ImovelDAO.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [br.com.imobiliaria.dao.ImovelDAO]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:698)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:192)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:984)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:886)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:328)
at org.springframework.web.context.request.AbstractRequestAttributesScope.get(AbstractRequestAttributesScope.java:43)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:820)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:762)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:680)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:771)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:691)
... 55 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'imovelDAO' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/dao/ImovelDAO.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [br.com.imobiliaria.dao.ImovelDAO]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:946)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:890)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:328)
at org.springframework.web.context.request.AbstractRequestAttributesScope.get(AbstractRequestAttributesScope.java:43)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:820)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:762)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:680)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:771)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:691)
... 69 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [br.com.imobiliaria.dao.ImovelDAO]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:141)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:72)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:938)
... 81 more
Caused by: java.lang.ExceptionInInitializerError
at br.com.imobiliaria.dao.ImovelDAO.<init>(ImovelDAO.java:32)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
... 83 more
Caused by: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on br.com.imobiliaria.bean.Imovel.status references an unknown entity: br.com.imobiliaria.bean.Status
at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(ToOneFkSecondPass.java:103)
at org.hibernate.cfg.AnnotationConfiguration.processEndOfQueue(AnnotationConfiguration.java:541)
at org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInOrder(AnnotationConfiguration.java:523)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:380)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1377)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
at br.com.imobiliaria.dao.HibernateUtil.<clinit>(HibernateUtil.java:33)
... 89 more
23/08/2010 23:49:28 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet default threw exception
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'indexController' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/controller/IndexController.class]: Unsatisfied dependency expressed through constructor argument with index 2 of type [br.com.imobiliaria.component.Email]: : Error creating bean with name 'email' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/component/Email.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [br.com.imobiliaria.dao.ImovelDAO]: : Error creating bean with name 'imovelDAO' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/dao/ImovelDAO.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [br.com.imobiliaria.dao.ImovelDAO]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'imovelDAO' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/dao/ImovelDAO.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [br.com.imobiliaria.dao.ImovelDAO]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'email' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/component/Email.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [br.com.imobiliaria.dao.ImovelDAO]: : Error creating bean with name 'imovelDAO' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/dao/ImovelDAO.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [br.com.imobiliaria.dao.ImovelDAO]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'imovelDAO' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/dao/ImovelDAO.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [br.com.imobiliaria.dao.ImovelDAO]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:698)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:192)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:984)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:886)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:328)
at org.springframework.web.context.request.AbstractRequestAttributesScope.get(AbstractRequestAttributesScope.java:43)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:385)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:375)
at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1069)
at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:221)
at br.com.caelum.vraptor.ioc.spring.VRaptorApplicationContext.getBean(VRaptorApplicationContext.java:242)
at br.com.caelum.vraptor.ioc.spring.SpringBasedContainer.instanceFor(SpringBasedContainer.java:59)
at br.com.caelum.vraptor.interceptor.InstantiateInterceptor.intercept(InstantiateInterceptor.java:41)
at br.com.caelum.vraptor.core.InstantiatedInterceptorHandler.execute(InstantiatedInterceptorHandler.java:47)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65)
at br.com.imobiliaria.interceptor.NoCacheInterceptor.intercept(NoCacheInterceptor.java:41)
at br.com.caelum.vraptor.core.InstantiatedInterceptorHandler.execute(InstantiatedInterceptorHandler.java:47)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65)
at br.com.caelum.vraptor.util.jpa.JPATransactionInterceptor.intercept(JPATransactionInterceptor.java:48)
at br.com.caelum.vraptor.core.InstantiatedInterceptorHandler.execute(InstantiatedInterceptorHandler.java:47)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65)
at br.com.caelum.vraptor.interceptor.InterceptorListPriorToExecutionExtractor.intercept(InterceptorListPriorToExecutionExtractor.java:46)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65)
at br.com.caelum.vraptor.interceptor.FlashInterceptor.intercept(FlashInterceptor.java:81)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65)
at br.com.caelum.vraptor.interceptor.ResourceLookupInterceptor.intercept(ResourceLookupInterceptor.java:67)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:56)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65)
at br.com.caelum.vraptor.core.DefaultRequestExecution.execute(DefaultRequestExecution.java:70)
at br.com.caelum.vraptor.VRaptor$1.insideRequest(VRaptor.java:92)
at br.com.caelum.vraptor.ioc.spring.SpringProvider.provideForRequest(SpringProvider.java:56)
at br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:89)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'email' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/component/Email.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [br.com.imobiliaria.dao.ImovelDAO]: : Error creating bean with name 'imovelDAO' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/dao/ImovelDAO.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [br.com.imobiliaria.dao.ImovelDAO]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'imovelDAO' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/dao/ImovelDAO.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [br.com.imobiliaria.dao.ImovelDAO]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:698)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:192)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:984)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:886)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:328)
at org.springframework.web.context.request.AbstractRequestAttributesScope.get(AbstractRequestAttributesScope.java:43)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:820)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:762)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:680)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:771)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:691)
... 55 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'imovelDAO' defined in file [/home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/imobiliaria/WEB-INF/classes/br/com/imobiliaria/dao/ImovelDAO.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [br.com.imobiliaria.dao.ImovelDAO]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:946)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:890)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:328)
at org.springframework.web.context.request.AbstractRequestAttributesScope.get(AbstractRequestAttributesScope.java:43)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:820)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:762)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:680)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:771)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:691)
... 69 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [br.com.imobiliaria.dao.ImovelDAO]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:141)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:72)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:938)
... 81 more
Caused by: java.lang.ExceptionInInitializerError
at br.com.imobiliaria.dao.ImovelDAO.<init>(ImovelDAO.java:32)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
... 83 more
Caused by: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on br.com.imobiliaria.bean.Imovel.status references an unknown entity: br.com.imobiliaria.bean.Status
at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(ToOneFkSecondPass.java:103)
at org.hibernate.cfg.AnnotationConfiguration.processEndOfQueue(AnnotationConfiguration.java:541)
at org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInOrder(AnnotationConfiguration.java:523)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:380)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1377)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
at br.com.imobiliaria.dao.HibernateUtil.<clinit>(HibernateUtil.java:33)
... 89 more
Removi td de imovelDAO na IndexController, então não era pra dar erro nesta classe. =/
A aplicação estava rodando sem problemas, foi só fazer essas alterações que expliquei que foi td pro ralo. Até aquele atributo avatar eu tinha feito seguindo a dica do Garcia, tava chamando o avatar pela classe Imovel, e agora o professor me diz pra colocar uma coluna avatar do tipo boolean na classe Foto, justamente o que eu tinha feito antes de pedir um help aqui. O.o
O que vcs acham??? Posso confiar na dica do professor?
Abraço!!
