java.lang.NoSuchMethodError:org.hibernate.engine.spi.SessionFactoryImplementor.getProperties()Ljava/util/Map

java.lang.NoSuchMethodError:org.hibernate.engine.spi.SessionFactoryImplementor.getProperties()Ljava/util/Map,java,hibernate,servlets,struts2,Java,Hibernate,Servlets,Struts2,请帮助解决我的问题,当我尝试在ApacheTomcat上运行我的程序时,我遇到了以下错误。我正在struts2中使用hibernate内核(5.2.9.Final)和hibernate commons注释(5.0.1.Final) 日志信息如下: INFO: Server startup in 41821 ms 25240 [http-nio-8080-exec-7] INFO org.hibernate.Version - HHH000412: Hibernate Core {5.2.9.

请帮助解决我的问题,当我尝试在ApacheTomcat上运行我的程序时,我遇到了以下错误。我正在struts2中使用hibernate内核(5.2.9.Final)和hibernate commons注释(5.0.1.Final)

日志信息如下:

INFO: Server startup in 41821 ms
25240 [http-nio-8080-exec-7] INFO  org.hibernate.Version  - HHH000412: Hibernate Core {5.2.9.Final}
25247 [http-nio-8080-exec-7] INFO  org.hibernate.cfg.Environment  - HHH000206: hibernate.properties not found
25352 [http-nio-8080-exec-7] WARN  org.hibernate.orm.deprecation  - HHH90000012: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/hibernate-configuration. Use namespace http://www.hibernate.org/dtd/hibernate-configuration instead.  Support for obsolete DTD/XSD namespaces may be removed at any time.
Hibernate Annotation Configuration loaded
Hibernate Annotation serviceRegistry created
26171 [http-nio-8080-exec-7] INFO  org.hibernate.annotations.common.Version  - HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
26964 [http-nio-8080-exec-7] WARN  org.hibernate.orm.connections.pooling  - HHH10001002: Using Hibernate built-in connection pool (not for production use!)
26988 [http-nio-8080-exec-7] INFO  org.hibernate.orm.connections.pooling  - HHH10001005: using driver [com.mysql.cj.jdbc.Driver] at URL [jdbc:mysql://localhost:3306/scale_report?serverTimezone=UTC]
26989 [http-nio-8080-exec-7] INFO  org.hibernate.orm.connections.pooling  - HHH10001001: Connection properties: {user=root, password=****}
26989 [http-nio-8080-exec-7] INFO  org.hibernate.orm.connections.pooling  - HHH10001003: Autocommit mode: false
27023 [http-nio-8080-exec-7] INFO  org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl  - HHH000115: Hibernate connection pool size: 1 (min=1)
28642 [http-nio-8080-exec-7] INFO  org.hibernate.dialect.Dialect  - HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
Initial SessionFactory creation failed.java.lang.NoSuchMethodError: org.hibernate.engine.spi.SessionFactoryImplementor.getProperties()Ljava/util/Map;
我使用以下jar文件:

antlr-2.7.7<br>
classmate-1.3.0<br>
dom4j-1.6.1<br>
hibernate-commons-annotations-5.0.1.Final<br>
hibernate-core-5.2.9.Final<br>
hibernate-jpa-2.1-api-1.0.0.Final<br>
hibernate-entitymanager-4.2.21.Final<br>
jandex-2.0.3.Final<br>
javassist-3.20.0-GA<br>
jboss-logging-3.3.0.Final<br>
jboss-transaction-api_1.2_spec-1.0.1.Final<br>

com.azalea.ufl.barcode.1.0<br>
commons-collections-3.1<br>
commons-configuration-1.2<br>
commons-fileupload-1.2.1<br>
commons-lang-2.1<br>
commons-logging<br>
cvom<br>
CrystalCommon2<br>
CrystalReportsRuntime<br>
DatabaseConnectors<br>
derby<br>
ejb3-persistence<br>
freemarker-2.3.13<br>
icu4j<br>
jai_imageio<br>
JDBInterface<br>
jrcerom<br>
jstl-1.2<br>
jta-1.1<br>
keycodeDecoder<br>
log4j-1.2.15<br>
logging<br>
mssql-jdbc-7.0.0.jre8<br>
mysql-connector-java-8.0.15<br>
ognl-2.6.11<br>
pfjgraphics<br>
QueryBuilder<br>
sap.com~tc~sec~csi<br>
slf4j-api-1.5.8<br>
slf4j-log4j12-1.5.8<br>
struts2-convention-plugin-2.1.6<br>
struts2-core-2.1.6<br>
webreporting<br>
webreporting-jsf<br>
xmlbeans-2.3.0<br>
xpp3<br>
Xtreme<br>
xwork-2.1.2<br>
antlr-2.7.7
同学-1.3.0
dom4j-1.6.1
hibernate-commons-annotations-5.0.1.最终版本
hibernate-core-5.2.9.最终版本
hibernate-jpa-2.1-api-1.0.0.最终版本
hibernate-entitymanager-4.2.21.最终版本
jandex-2.0.3.最终版
javassist-3.20.0-GA
jboss-logging-3.3.0.最终版
jboss-transaction-api_1.2_spec-1.0.1.最终版
com.azalea.ufl.barcode.1.0
commons-collections-3.1
commons-configuration-1.2
commons-fileupload-1.2.1
commons-lang-2.1
公共日志记录
cvom
晶体2
CrystalReportsRuntime
数据库连接器
德比
ejb3持久性
freemarker-2.3.13
icu4j
jai_imageio
JDBInterface
jrcerom
jstl-1.2
jta-1.1
keycodeDecoder
log4j-1.2.15
日志记录
mssql-jdbc-7.0.0.jre8
mysql-connector-java-8.0.15
ognl-2.6.11
pfjgraphics
QueryBuilder
sap.com~tc~sec~csi
slf4j-api-1.5.8
slf4j-log4j12-1.5.8
struts2-convention-plugin-2.1.6
struts2-core-2.1.6
网络报道
webreporting jsf
xmlbeans-2.3.0
xpp3
极端
xwork-2.1.2

这样的异常通常会在
干净构建部署
过程出现问题时抛出,请尝试手动删除以前编译的代码,如果在Apache tomcat中,请转到包含部署的文件夹并手动删除任何过去的剩余代码

编辑: 对于未来参考,具体例外情况如下:

java.lang.NoSuchMethodError: org.hibernate.engine.spi.SessionFactoryImplementor.getProperties()Ljava/util/Map
当库发生冲突时,由Hibernate抛出(通常是javax.persistence)

建议的方法是确保 子依赖项(这些库使用的依赖项)不是 矛盾的是,给出的建议是,如果你, 清除可疑库,并检查消息何时重新出现,以及 然后尝试寻找一个兼容的版本


感谢您回复@White_King,我遵照您的指示,但问题仍然存在。我也犯了同样的错误。我正在打印下面的错误完成消息,该消息正在jsp页面中打印。HTTP状态500-类型异常报告消息说明服务器遇到内部错误,无法满足此请求。例外根本原因java.lang.NoSuchMethodError:org.hibernate.engine.spi.SessionFactoryImplementor.getProperties()Ljava/util/Map;org.hibernate.internal.CacheImpl.(CacheImpl.java:71)org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:28)org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:20)org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.initiateService(SessionFactoryServiceRegistryImpl.java:58)私有静态SessionFactory SessionFactory;私有静态ServiceRegistry ServiceRegistry;私有静态SessionFactory createSessionFactory(){try{Configuration Configuration=new Configuration();Configuration.configure(“hibernate.cfg.xml”);serviceRegistry=new StandardServiceRegistryBuilder().applySettings(Configuration.getProperties()).build();sessionFactory=configuration.buildSessionFactory(serviceRegistry);返回sessionFactory;}我明白了,问题似乎与此相似:检查一下,解决方案对你有效。感谢你的回复,谢谢你。我得到了解决方案,我移除了所有的罐子,并根据要求逐个添加。现在它可以工作了。