You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Tomcat 8.0.26部署时出现java.lang.NoSuchMethodError错误求助

Fixing the NoSuchMethodError with JBoss Logging & Hibernate in Tomcat 8.0.26

Hey there, let's tackle this frustrating error you ran into after firing up Tomcat 8.0.26 with ./startup.sh. First, let's recap the error you saw for clarity:

28-Mar-2018 15:07:58.926 SEVERE [localhost-startStop-2] org.apache.catalina.core.StandardContext.listenerStart 发送上下文初始化事件至ie.company.web.AppContextListener监听器实例时发生异常 java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object; at org.hibernate.ejb.Ejb3Configuration.(Ejb3C...

What's causing this?

This is a classic classpath conflict issue. The root problem is that the version of JBoss Logging present in your classpath is too old—Hibernate's EJB3 module (used by your app's AppContextListener) expects a version of JBoss Logging that has the getMessageLogger(Class, String) method, but the one being loaded doesn't include it.

Step-by-Step Fixes

  • Track down conflicting JBoss Logging JARs
    Check two key locations for duplicate or outdated jboss-logging*.jar files:

    1. Tomcat's global lib/ directory
    2. Your web application's WEB-INF/lib/ directory
      It's common to have an old version bundled with Tomcat or accidentally included via your app's build dependencies.
  • Standardize on a compatible JBoss Logging version
    For Hibernate EJB3 (typically Hibernate 4.x+), you need at least JBoss Logging 3.1.0.GA—we recommend using 3.3.1.Final for broad compatibility with most Hibernate 4.x releases.

    • Delete all old jboss-logging*.jar files from both locations
    • Place the correct version only in your app's WEB-INF/lib/ (this avoids clashing with Tomcat's global libraries)
  • Verify Hibernate & JBoss Logging version alignment
    Double-check your build tool (Maven/Gradle) to ensure you're pulling in the right JBoss Logging version for your Hibernate release:

    • Hibernate 4.3.x → JBoss Logging 3.3.1.Final
    • Hibernate 5.x → JBoss Logging 3.3.0.Final or newer
      Use dependency exclusion rules if a transitive dependency is pulling in an old JBoss Logging version.

Quick Debugging Trick

If you're still unsure which JAR is causing the issue, start Tomcat with the -verbose:class flag:

./startup.sh -verbose:class

This will log every class that gets loaded, so you can trace exactly which jboss-logging*.jar is providing the org.jboss.logging.Logger class missing the required method.

内容的提问来源于stack exchange,提问作者Rodrigo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 06:35:56