JSF、休止状態、tomcat7、JAVA EE 5、および maven を使用して Web アプリケーションをデプロイします。解決できないエラーが表示されます。
java.lang.NoClassDefFoundError: javax.persistence. Persistence.createEntityManagerFactory(Persistence.java:47) at entity.ActeurexterneController.getJpaController(ActeurexterneController.java:44) at entity.ActeurexterneController.access$000(ActeurexterneController.java:23) at entity.ActeurexterneController$1.createPageDataModel(ActeurexterneController.java:59) ) で、entity.ActeurexterneController.getItems(ActeurexterneController.java:159) で、sun.reflect.NativeMethodAccessorImpl.invoke0(ネイティブ メソッド) で、sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) で java.lang.reflect.Method.invoke(Method.java:601) で javax.el.BeanELResolver.getValue(BeanELResolver.java:87) でorg.apache.el.parser.AstValue.getValue( AstValue.java:183) org.apache.el.parser.AstEqual.getValue(AstEqual.java:38) org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:185) com.sun.faces.facelets .el.TagValueExpression.getValue(TagValueExpression.java:109) at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194) javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:413) で javax.faces.component.UIComponent.encodeAll(UIComponent.java:1750) で javax.faces.render.Renderer.encodeChildren(Renderer.java:168) で javax.faces.component.UIComponentBase .encodeChildren(UIComponentBase.java:845) で javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756) で javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759) で javax.faces.component で。 com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:401) の UIComponent.encodeAll(UIComponent.java:1759) com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java: 131) com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) で com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) で javax.faces.webapp.FacesServlet.service(FacesServlet.java:410) で org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:305) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) org.apache. catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java: 168) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) で org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) org .apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor .run(JIoEndpoint.java:312) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang. Thread.run(Thread.java:722) 原因: java.lang.ClassNotFoundException: org.hibernate.proxy.EntityNotFoundDelegate at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
私の persitane.xml :
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect"/> <property name="hibernate.hbm2ddl.auto" value="create-drop"/> <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/> <property name="hibernate.connection.username" value="root"/> <property name="hibernate.connection.password" value="root"/> <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/prosper"/> <property name="javax.persistence.validation.mode">none</property>
そして私の pom.xml で:
<dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>4.1.8.Final</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.hibernate.javax.persistence</groupId> <artifactId>hibernate-jpa-2.0-api</artifactId> <version>1.0.1.Final</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>4.1.8.Final</version> </dependency>
どうも :)