maven+springmvc 中tomcat启动报java.lang.NoSuchMethodError: org.springframework.util.ClassUtils.getMethod

maven+springmvc 中tomcat启动报java.lang.NoSuchMethodError: org.springframework.util.ClassUtils.getMethod 


严重: StandardWrapper.Throwable
java.lang.NoSuchMethodError: org.springframework.util.ClassUtils.getMethod(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
at org.springframework.core.convert.support.GenericConversionService.(GenericConversionService.java:81)
at org.springframework.core.env.AbstractPropertyResolver.(AbstractPropertyResolver.java:41)
at org.springframework.core.env.PropertySourcesPropertyResolver.(PropertySourcesPropertyResolver.java:41)
at org.springframework.core.env.AbstractEnvironment.(AbstractEnvironment.java:112)
at org.springframework.core.env.StandardEnvironment.(StandardEnvironment.java:54)
at org.springframework.web.context.support.StandardServletEnvironment.(StandardServletEnvironment.java:44)
at org.springframework.web.servlet.HttpServletBean.createEnvironment(HttpServletBean.java:215)
at org.springframework.web.servlet.HttpServletBean.getEnvironment(HttpServletBean.java:205)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1282)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1195)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1085)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5318)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5610)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1259)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1998)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
十一月 15, 2016 9:45:57 上午 org.apache.catalina.core.StandardContext loadOnStartup
严重: Servlet [dispatcher] in web application [/testmav] threw load() exception
java.lang.NoSuchMethodError: org.springframework.util.ClassUtils.getMethod(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
at org.springframework.core.convert.support.GenericConversionService.(GenericConversionService.java:81)
at org.springframework.core.env.AbstractPropertyResolver.(AbstractPropertyResolver.java:41)
at org.springframework.core.env.PropertySourcesPropertyResolver.(PropertySourcesPropertyResolver.java:41)
at org.springframework.core.env.AbstractEnvironment.(AbstractEnvironment.java:112)
at org.springframework.core.env.StandardEnvironment.(StandardEnvironment.java:54)
at org.springframework.web.context.support.StandardServletEnvironment.(StandardServletEnvironment.java:44)
at org.springframework.web.servlet.HttpServletBean.createEnvironment(HttpServletBean.java:215)
at org.springframework.web.servlet.HttpServletBean.getEnvironment(HttpServletBean.java:205)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1282)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1195)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1085)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5318)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5610)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1259)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1998)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

网上说:

很可能是spring-context-2.5.jar和spring.jar冲突了,两个中留下一个,都试试

亲测:去除spring.jar 解决问题

你可能感兴趣的:(maven+springmvc 中tomcat启动报java.lang.NoSuchMethodError: org.springframework.util.ClassUtils.getMethod)