java.lang.nosuchmethoderror是什么错误
java.lang.NoSuchMethodError:org.springframework.web.context.support.XmlWebApplication...
java.lang.NoSuchMethodError: org.springframework.web.context.support.XmlWebApplicationContext.getEnvironment()Lorg/springframework/core/env/ConfigurableEnvironment;应该怎么解决?? 求大神们帮忙解决下 在线等!!!!!!!!!!!!!!!
展开
2个回答
展开全部
jar包冲突造成的,检查一下吧
java.lang.NoSuchMethodError occur if there is some issue with the jar loaded. I think that on the system that you are trying to run this code on, has CLASSPATH set to some path which is loading the older version of the jar. Use the following code to find out the paths from where the ClassLoader is resolving the dependencies
public static void main(String[] args) {
URLClassLoader classLoader = (URLClassLoader)Main.class.getClassLoader();
System.out.println(Arrays.toString(classLoader.getURLs()));
}
java.lang.NoSuchMethodError occur if there is some issue with the jar loaded. I think that on the system that you are trying to run this code on, has CLASSPATH set to some path which is loading the older version of the jar. Use the following code to find out the paths from where the ClassLoader is resolving the dependencies
public static void main(String[] args) {
URLClassLoader classLoader = (URLClassLoader)Main.class.getClassLoader();
System.out.println(Arrays.toString(classLoader.getURLs()));
}
更多追问追答
追问
打印出很多包名来 怎么办大神
追答
看一下哪些包是不需要的,有这个方法,删掉!
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询