nested exception is java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.getServletCon

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u012848709/article/details/80348698

文件上传获取路劲出错

出错的部分是req.getServletContext().getRealPath(SysConstant.UP_FILE); 改为下面的内容
req.getSession().getServletContext().getRealPath(SysConstant.UP_FILE);

nested exception is java.lang.NoSuchMethodError

06-05

使用spring框架开发了一个网站,在后面的业务中需要填加大数据,引入了Spring-core和hadoop-mapreduce-client-core依赖,系统编译正常,但是在运行这一业务的时候,出现异常nnorg.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: org.apache.hadoop.util.StringUtils.toUpperCase(Ljava/lang/String;)Ljava/lang/String;n at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:978)n at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)n at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)n at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)n at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)n at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)n at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)n at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)n at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)n at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)n at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)n at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)n at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)n at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)n at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)n at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)n at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)n at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)n at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)n at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)n at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:283)n at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2463)n at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2452)n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)n at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)n at java.lang.Thread.run(Thread.java:748)nCaused by: java.lang.NoSuchMethodError: org.apache.hadoop.util.StringUtils.toUpperCase(Ljava/lang/String;)Ljava/lang/String;n at org.apache.hadoop.mapreduce.lib.db.DBInputFormat.setConf(DBInputFormat.java:167)n at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:62)n at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:117)n at org.apache.hadoop.mapred.JobClient.writeNewSplits(JobClient.java:959)n at org.apache.hadoop.mapred.JobClient.writeSplits(JobClient.java:979)n at org.apache.hadoop.mapred.JobClient.access$600(JobClient.java:174)n at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:897)n at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:850)n at java.security.AccessController.doPrivileged(Native Method)n at javax.security.auth.Subject.doAs(Subject.java:422)n at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1083)n at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:850)n at org.apache.hadoop.mapreduce.Job.submit(Job.java:465)n at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:495)n at cn.mapple.web.component.SubmitCountHadoop.getCount(SubmitCountHadoop.java:55)n at cn.mapple.web.controller.front.SubmitCountController.getSubmitCount(SubmitCountController.java:29)n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)n at java.lang.reflect.Method.invoke(Method.java:498)n at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)n at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)n at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:114)n at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)n at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)n at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)n at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)n ... 32 moren

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试

关闭