Solucionado (ver solução)
Solucionado
(ver solução)
4
respostas

ExceptionInInitializerError

Estou com o seguinte problema:

Esse erro se iniciou depois de resolver o seguinte problema: https://cursos.alura.com.br/forum/topico-destachad-erro-22215

INFORMAÇÕES: Server startup in 6071 ms
FASE: RESTORE_VIEW 1
/login.xhtml
FASE: RENDER_RESPONSE 6
7331 [http-nio-8080-exec-3] INFO org.hibernate.cfg.annotations.Version - Hibernate Annotations 3.4.0.GA
7348 [http-nio-8080-exec-3] INFO org.hibernate.cfg.Environment - Hibernate 3.3.0.SP1
7352 [http-nio-8080-exec-3] INFO org.hibernate.cfg.Environment - hibernate.properties not found
7355 [http-nio-8080-exec-3] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
7362 [http-nio-8080-exec-3] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
7435 [http-nio-8080-exec-3] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.1.0.GA
7439 [http-nio-8080-exec-3] INFO org.hibernate.ejb.Version - Hibernate EntityManager 3.4.0.GA
8763 [http-nio-8080-exec-3] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: br.com.arena.model.Pessoa
8810 [http-nio-8080-exec-3] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity br.com.arena.model.Pessoa on table Pessoa
jul 15, 2016 2:26:06 PM org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Servlet.service() for servlet [Faces Servlet] in context with path [/arena] threw exception [null] with root cause
java.lang.ArrayStoreException: sun.reflect.annotation.EnumConstantNotPresentExceptionProxy
    at sun.reflect.annotation.AnnotationParser.parseEnumArray(Unknown Source)
    at sun.reflect.annotation.AnnotationParser.parseArray(Unknown Source)
    at sun.reflect.annotation.AnnotationParser.parseMemberValue(Unknown Source)
    at sun.reflect.annotation.AnnotationParser.parseAnnotation2(Unknown Source)
    at sun.reflect.annotation.AnnotationParser.parseAnnotations2(Unknown Source)
    at sun.reflect.annotation.AnnotationParser.parseAnnotations(Unknown Source)
    at java.lang.reflect.Field.declaredAnnotations(Unknown Source)
    at java.lang.reflect.Field.declaredAnnotations(Unknown Source)
    at java.lang.reflect.Field.getAnnotation(Unknown Source)
    at java.lang.reflect.AnnotatedElement.isAnnotationPresent(Unknown Source)
    at java.lang.reflect.AccessibleObject.isAnnotationPresent(Unknown Source)
    at org.hibernate.annotations.common.reflection.java.JavaAnnotationReader.isAnnotationPresent(JavaAnnotationReader.java:27)
    at org.hibernate.annotations.common.reflection.java.JavaXAnnotatedElement.isAnnotationPresent(JavaXAnnotatedElement.java:43)
    at org.hibernate.cfg.AnnotationBinder.mustBeSkipped(AnnotationBinder.java:1111)
    at org.hibernate.cfg.AnnotationBinder.addProperty(AnnotationBinder.java:1091)
    at org.hibernate.cfg.AnnotationBinder.addElementsOfAClass(AnnotationBinder.java:1038)
    at org.hibernate.cfg.AnnotationBinder.getElementsToProcess(AnnotationBinder.java:882)
    at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:667)
    at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:546)
    at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:291)
    at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1148)
    at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1226)
    at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:173)
    at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:854)
    at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:191)
    at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:253)
    at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:125)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
    at br.com.arena.util.JPAUtil.<clinit>(JPAUtil.java:9)
    at br.com.arena.dao.TimeDAO.<init>(TimeDAO.java:18)
    at br.com.arena.controller.TimeBean.<init>(TimeBean.java:26)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:188)
    at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:102)
    at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:409)
    at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:269)
    at com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:244)
    at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:116)
    at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
    at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
    at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:94)
    at org.apache.el.parser.AstValue.getValue(AstValue.java:137)
    at org.apache.el.parser.AstNotEqual.getValue(AstNotEqual.java:37)
    at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
    at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
    at com.sun.faces.facelets.tag.TagAttributeImpl.getObject(TagAttributeImpl.java:329)
    at com.sun.faces.facelets.tag.TagAttributeImpl.getBoolean(TagAttributeImpl.java:136)
    at com.sun.faces.facelets.tag.jstl.core.IfHandler.apply(IfHandler.java:91)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
    at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
    at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:308)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:367)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:346)
    at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
    at com.sun.faces.facelets.tag.ui.DecorateHandler.apply(DecorateHandler.java:145)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
    at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
    at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
    at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:152)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:774)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)
4 respostas

Oi Rafael,

Você pode postar a pilha de erro inteira? Era importante ver o caused by da exception. Meu chute é que seu código pode estar compilado para uma versão e tentando rodar sobre uma mais antiga.

Esse e todo o erro gerado no Eclipse Alberto.

Olá,

Confira essas classes suas:

br.com.arena.util.JPAUtil.<clinit>(JPAUtil.java:9)
br.com.arena.dao.TimeDAO.<init>(TimeDAO.java:18)
br.com.arena.controller.TimeBean.<init>(TimeBean.java:26)

Algum ENUM pode estar sendo usado errado

solução!

Como informado, isso começou depois que eu resolvi o seguinte problema: https://cursos.alura.com.br/forum/topico-destachad-erro-22215

La eu alterava para CascadeType.DETACH

Eu troquei para CascadeType.MERGE e o problema se resolveu.