在做项目的时候,出现Caused by: java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.getServletContext()L这个问题,也就是使用request.getServletContext().getRealPath("/")这个报错。感觉好郁闷,看了别人写的文章,可能是tomcat版本号过低。我之前用的是tomcat6,如今我改成tomcat7,问题攻克了,故分享给大家
相关文章
- 08-09Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.
(I)V - 08-09Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getClassLoader()Ljava/lang/ClassLoader;
- 08-09Caused by: java.lang.NoSuchMethodError:javax.servlet.http.HttpServletRequest.getServletContext()L
- 08-09java.lang.NoSuchMethodError: org.springframework.beans.factory.annotation.InjectionMetadata.
(L - 08-09Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: 'L
- 08-09Caused by: Java.lang.NoSuchMethodError: org.springframework.http.HttpMethod.matches(Ljava/lang/Strin
- 08-09异常:Caused by: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z
- 08-09Caused by: java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/
- 08-09异常:Caused by: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z/Caused by: java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreign
- 08-09Caused by: java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index