运行 javawebservice 报错 “org.apache.catalina.core.StandardContext.startInternal One or more listeners ”

来源:互联网 发布:从零学c语言 编辑:程序博客网 时间:2024/05/31 19:51

 运行的时候报错,终端显示如下:


打开终端的 tomcat localhost log:


可以看到错误原因是缺少BlockJUint4ClassRunner,但是maven中确实添加了junit的jar包,项目中有一个类引用了BlockJunit4ClassRunner:


项目在运行的时候检索了所有的类,再看看maven中junit是如何添加的:


<scope>provided<scope>这个条件限制了junit在运行的时候不被添加到classpath中,而项目运行时检索所有类会检索到OrderedRunner这个类,这个类又继承了BlockJUint4ClassRunner, 所以需要将provided删除,使用默认的compile即可

0 1