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

    xiaoxiao2021-04-01  39

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

    打开终端的 tomcat localhost log:

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

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

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

    转载请注明原文地址: https://ju.6miu.com/read-665495.html

    最新回复(0)