java.util.ServiceConfigurationError:org.apache.juli.logging.Log:提供者org.eclipse.jetty.apache.jsp.JuliLog不是子类型

时间:2019-04-25 09:21:17

标签: rest maven spring-boot jetty

我是春季MVC,码头和宁静的新手。 使用此命令>

时,我正在尝试部署我的Restful App完美运行
mvn clean jetty:run

它给出以下错误:

  

java.util.ServiceConfigurationError:org.apache.juli.logging.Log:   提供者org.eclipse.jetty.apache.jsp.JuliLog不是子类型       在java.util.ServiceLoader.fail(ServiceLoader.java:239)       在java.util.ServiceLoader.access $ 300(ServiceLoader.java:185)       在java.util.ServiceLoader $ LazyIterator.nextService(ServiceLoader.java:376)       在java.util.ServiceLoader $ LazyIterator.next(ServiceLoader.java:404)       在java.util.ServiceLoader $ 1.next(ServiceLoader.java:480)       在org.apache.juli.logging.LogFactory中。 (LogFactory.java:77)       在org.apache.juli.logging.LogFactory中。 (LogFactory.java:65)       在org.apache.tomcat.websocket.WsWebSocketContainer中。 (WsWebSocketContainer.java:92)       在org.apache.tomcat.websocket.server.WsServerContainer中。 (WsServerContainer.java:85)       在org.apache.tomcat.websocket.server.WsSci.init(WsSci.java:131)       在org.apache.tomcat.websocket.server.WsSci.onStartup(WsSci.java:47)       在org.eclipse.jetty.plus.annotation.ContainerInitializer.callStartup   (ContainerInitializer.java:140)       在org.eclipse.jetty.annotations.ServletContainerInitializersStarter.doStart   (ServletContainerInitializersStarter.java:64)       在org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)       在org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:347)       在org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)       在org.eclipse.jetty.maven.plugin.JettyWebAppContext.startWebapp(JettyWebAppContext.java:360)       在org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)       在org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:852)       在org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:278)       在org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)       在org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:428)       在org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)       在org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)       在org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:119)       在org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)       在org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)       在org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)       在org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:119)       在org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)       在org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)       在org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)       在org.eclipse.jetty.server.Server.start(Server.java:418)       在org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)       在org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)       在org.eclipse.jetty.server.Server.doStart(Server.java:382)       在org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)       在org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:477)       在org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:343)       在org.eclipse.jetty.maven.plugin.JettyRunMojo.execute(JettyRunMojo.java:169)       在org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)       在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)       在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)       在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)       在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject中   (LifecycleModuleBuilder.java:117)       在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject中   (LifecycleModuleBuilder.java:81)       在org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build   (SingleThreadedBuilder.java:56)       在org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)       在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)       在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)       在org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)       在org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)       在org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)       在org.apache.maven.cli.MavenCli.main(MavenCli.java:192)       在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处       在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)       在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)       在java.lang.reflect.Method.invoke(Method.java:498)       在org.codehaus.plexus.classworlds.launcher.Launcher.launch上增强   (Launcher.java:289)       在org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)       在org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode   (Launcher.java:415)       在org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

我的pom.xml如下:pom.xml

我的项目如下:project

我已经尝试了很多次,但是都没有成功。请帮忙!

2 个答案:

答案 0 :(得分:1)

由于您使用 Jetty 运行该应用程序,因此此错误告诉您与 tomcat 存在冲突,我相信您的 pom 中有 spring-boot-starter-web 依赖项,并且默认情况下嵌入了 tomcat,这会导致与 jetty 发生冲突.简单地排除它,如下所示。对我有用

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <exclusions>
            <exclusion>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-tomcat</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

答案 1 :(得分:0)

org.apache.tomcat.websocket.WsWebSocketContainer

如果您使用的是jetty:run,则不允许将上述类放在您的类路径/类加载器中。

查找将其引入的依赖项并删除/排除它。