我正在用 JSF 開(kāi)發(fā)一個(gè)應(yīng)用程序。錯(cuò)誤是:Caused by: java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index; at org.hibernate.cfg.annotations.EntityBinder.processComplementaryTableDefinitions(EntityBinder.java:1087) at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:767) at org.hibernate.boot.model.source.internal.annotations.AnnotationMetadataSourceProcessorImpl.processEntityHierarchies(AnnotationMetadataSourceProcessorImpl.java:245) at org.hibernate.boot.model.process.spi.MetadataBuildingProcess$1.processEntityHierarchies(MetadataBuildingProcess.java:222) at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:265) at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:83) at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:418) at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:87) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:692) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:724) at w7h5.h8.sf.HibernateSessionFactory.<clinit>(HibernateSessionFactory.java:26) at w7h5.h8.transaction.TransactionalModule.invoke(TransactionalModule.java:29) at abrain.web.common.bean.EditorView.test_post(EditorView.java:112) at abrain.web.common.bean.EditorView.setText(EditorView.java:63) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at javax.el.BeanELResolver.setValue(BeanELResolver.java:122) ... 43 more }我已經(jīng)嘗試創(chuàng)建一個(gè) java 類(lèi)測(cè)試,以防止 Tomcat(8.5 版)失敗,并且一切正常,所以當(dāng)我在服務(wù)器上運(yùn)行應(yīng)用程序時(shí)會(huì)出現(xiàn)問(wèn)題。
1 回答

德瑪西亞99
TA貢獻(xiàn)1770條經(jīng)驗(yàn) 獲得超3個(gè)贊
第一張圖是來(lái)自的接口Table的源碼javax.persistence.jar
。如您所見(jiàn),沒(méi)有方法indexes()
。
第二張圖是來(lái)自的接口Table的源碼jpa-2.1.jar
。并且存在方法indexes()
。
在我看來(lái),可能是你的類(lèi)路徑中有兩個(gè)罐子,這會(huì)造成沖突。當(dāng)您調(diào)用時(shí),javax.persistence.Table
我們不知道它是來(lái)自 javax.persistence.jar 還是 jpa-2.1.jar 的接口。
查看您的類(lèi)路徑并刪除 javaxpersistence.jar,然后重試。
添加回答
舉報(bào)
0/150
提交
取消