java.lang.ClassNotFoundException: javax.persistence.JoinTable

Merhaba Arkadaşlar ,

Hibernate ve Jsf bağlantı ayarlarını yaparken Netbeans’in sitesinde bulunan sakila.db ile yapılmış olan DVD Web Store uygulaması gerçekten çok faydalı bu konuda yine başlayanlara kesinlikle tavsiye ediyorum Netbeans Uygulama.  Temel hatlarıyla hibernate ve jsf  configürasyonu  ve hibernate’in test edilmesi ile ilgili başlangıç uygulaması , kaynak dosyaları indirdiğinizde aşağıdaki hatayı alıyorsanız. Bunun sebebi eksik olan persistence.jar dosyasıdır.  Buradan indirebilir veya Netbeans kullanıyorsanız, Projeye sağ click -> Properties -> Libraries -> Add Library -> Hibernate ekleyebilirsiniz veya buradan indirebilirsiniz.

 

java.lang.ExceptionInInitializerError
        at dvdrental.HibernateUtil.<clinit>(HibernateUtil.java:28)
        at dvdrental.FilmHelper.<init>(FilmHelper.java:20)
        at dvdrental.FilmController.<init>(FilmController.java:34)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
        at java.lang.Class.newInstance0(Class.java:374)
        at java.lang.Class.newInstance(Class.java:327)
        at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:186)
        at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:100)
        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:72)
        at org.apache.el.parser.AstValue.getValue(AstValue.java:161)
        at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:185)
        at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
        at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
        at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:462)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1850)
        at javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
        at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:894)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
        at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:443)
        at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
        at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NoClassDefFoundError: javax/persistence/JoinTable
        at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:272)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1286)
        at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)
        at dvdrental.HibernateUtil.<clinit>(HibernateUtil.java:24)
        ... 50 more
Caused by: java.lang.ClassNotFoundException: javax.persistence.JoinTable
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
        ... 54 more

 

Leave a Reply