简体   繁体   中英

java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;

I am converting a Spring web project to a Maven project and I am getting this error:

java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;

Apart from this error, seems that I have a lot of problems with dependencies, I am trying to fix them but I am a complete newbie into Maven:

  1. oct 30, 2014 3:53:30 PM org.apache.catalina.loader.WebappClassLoader validateJarFile>
  2. INFO: validateJarFile(C:\\Users\\a\\workspace.metadata.plugins\\org.eclipse.wst.server.core\\tmp0\\wtpwebapps\\revista2_local\\WEB-INF\\lib\\el-api-2.2.jar)
    • jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/el/Expression.class>
  3. oct 30, 2014 3:53:30 PM org.apache.catalina.loader.WebappClassLoader validateJarFile>
  4. INFO: validateJarFile(C:\\Users\\a\\workspace.metadata.plugins\\org.eclipse.wst.server.core\\tmp0\\wtpwebapps\\revista2_local\\WEB-INF\\lib\\jboss-el-api_2.2_spec-1.0.0.Final.jar)
    • jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/el/Expression.class>
  5. oct 30, 2014 3:53:30 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
  6. INFO: validateJarFile(C:\\Users\\a\\workspace.metadata.plugins\\org.eclipse.wst.server.core\\tmp0\\wtpwebapps\\revista2_local\\WEB-INF\\lib\\jboss-javaee-5.0.0.GA.jar)
    • jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class>
  7. oct 30, 2014 3:53:30 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
  8. INFO: validateJarFile(C:\\Users\\a\\workspace.metadata.plugins\\org.eclipse.wst.server.core\\tmp0\\wtpwebapps\\revista2_local\\WEB-INF\\lib\\jboss-servlet-api_3.0_spec-1.0.0.Final.jar)
    • jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
  9. oct 30, 2014 3:53:30 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
  10. INFO: validateJarFile(C:\\Users\\a\\workspace.metadata.plugins\\org.eclipse.wst.server.core\\tmp0\\wtpwebapps\\revista2_local\\WEB-INF\\lib\\jsp-api-2.1.jar)
    • jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/el/Expression.class
  11. oct 30, 2014 3:53:30 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
  12. INFO: validateJarFile(C:\\Users\\a\\workspace.metadata.plugins\\org.eclipse.wst.server.core\\tmp0\\wtpwebapps\\revista2_local\\WEB-INF\\lib\\servlet-api-2.5.jar)
    • jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

(Read the complete output for more details)

I am using Tomcat 7.0.

You seem to have the org.jboss.logging.Logger class in two libraries:

jboss:jboss-common:jar:4.2.2.GA and org.jboss.logging:jboss-logging:jar:3.1.3.GA

the second one is used by hibernate and I would thing it is the correct one. I think you need to use the correct jboss-common version to not run into this issue.

Related Question: Error "java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger"

i removed jboss-common-3.2.3.jar,commons-logging-1.1.1.jar,commons-lang-2.3.jar and commons-collections-3.2.2. Then it worked for me. I was using widlfly 13 with java 10

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM