我使用hibernate开发了有关多租户的代码。当我尝试运行我的代码时,它在configuration.buildSessionFactory中提供了异常。
Exception in thread "main" java.lang.NoSuchMethodError: org.hibernate.cfg.AnnotationBinder.bindDefaults(Lorg/hibernate/cfg/Mappings;)V
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1404)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1846)
at tcs.com.MultiTenancyPkg.MultitenancyMain.main(MultitenancyMain.java:20)
我在我的代码中导入了上面的jar列表:
commons-collections-2.1.1.jar
commons-logging-1.0.4.jar
dom4j-1.6.1.jar
ejb3-persistence.jar
h2-1.0.60.jar
hibernate-annotations-3.5.6-Final.jar
hibernate-annotations.jar
hibernate-commons-annotations-3.2.0.Final.jar
hibernate-commons-annotations.jar
hibernate-core-4.3.10.Final.jar
hibernate-entitymanager-4.3.10.Final.jar
hibernate3.jar
jboss-logging-3.3.0.Final.jar
jta-1.1.jar
postgresql-9.0-802.jdbc4.jar
postgresql-9.1-901.jdbc4.jar
slf4j-api-1.8.0-beta1.jar
如果有人对此有解决方案,请分享想法/观点。谢谢