命令行mvn jetty:run 报错 No Spring WebApplicationInitializer types detected on classpath

Windows PowerShell
版权所有 (C) 2009 Microsoft Corporation。保留所有权利。

PS C:\Users\Noah> cd E:\Workspaces\jee-kepler\spring-mvc-study
PS E:\Workspaces\jee-kepler\spring-mvc-study> mvn jetty:run
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building spring-mvc-study Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> jetty-maven-plugin:9.2.2.v20140723:run (default-cli) > test-compile @ spring-mvc-study >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ spring-mvc-study ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ spring-mvc-study ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ spring-mvc-study ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory E:\Workspaces\jee-kepler\spring-mvc-study\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ spring-mvc-study ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< jetty-maven-plugin:9.2.2.v20140723:run (default-cli) < test-compile @ spring-mvc-study <<<
[INFO]
[INFO] --- jetty-maven-plugin:9.2.2.v20140723:run (default-cli) @ spring-mvc-study ---
[INFO] Logging initialized @1983ms
[INFO] Configuring Jetty for project: spring-mvc-study Maven Webapp
[INFO] webAppSourceDirectory not set. Trying src\main\webapp
[INFO] Reload Mechanic: automatic
[INFO] Classes = E:\Workspaces\jee-kepler\spring-mvc-study\target\classes
[INFO] Context path = /
[INFO] Tmp directory = E:\Workspaces\jee-kepler\spring-mvc-study\target\tmp
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides =  none
[INFO] web.xml file = file:/E:/Workspaces/jee-kepler/spring-mvc-study/src/main/webapp/WEB-INF/web.xml
[INFO] Webapp directory = E:\Workspaces\jee-kepler\spring-mvc-study\src\main\webapp
[INFO] jetty-9.2.2.v20140723
[INFO] No Spring WebApplicationInitializer types detected on classpath
[WARNING]
java.lang.ClassNotFoundException: org.springframework.web.servlet.DisPatcherServlet
        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
        at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:449)
        at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:402)
        .......此处省略1万字...
[WARNING] unavailable
javax.servlet.UnavailableException: org.springframework.web.servlet.DisPatcherServlet
        at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:102)
        at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:332)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:868)
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:298)
        at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1341)
        at org.eclipse.jetty.maven.plugin.JettyWebAppContext.startWebapp(JettyWebAppContext.java:296)
        at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1334)
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
        at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:497)
        at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:365)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
        at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:163)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
        at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
        at org.eclipse.jetty.server.Server.start(Server.java:380)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
        at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
        at org.eclipse.jetty.server.Server.doStart(Server.java:347)
        at org.eclipse.jetty.maven.plugin.JettyServer.doStart(JettyServer.java:76)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:543)
        at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:360)
        at org.eclipse.jetty.maven.plugin.JettyRunMojo.execute(JettyRunMojo.java:167)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.
java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[WARNING] FAILED mvc-dispatcher@f974527a==org.springframework.web.servlet.DisPatcherServlet,1,false: javax.servlet.Unava
ilableException: org.springframework.web.servlet.DisPatcherServlet
javax.servlet.UnavailableException: org.springframework.web.servlet.DisPatcherServlet
        at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:102)
        at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:332)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
      .......
[WARNING]
java.lang.ClassNotFoundException: org.springframework.web.servlet.DisPatcherServlet
        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
       
       ......
[WARNING] unavailable
javax.servlet.UnavailableException: org.springframework.web.servlet.DisPatcherServlet
        at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:102)
        at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:332)
      .......
[WARNING] FAILED mvc-dispatcher@f974527a==org.springframework.web.servlet.DisPatcherServlet,1,false: javax.servlet.Unava
ilableException: org.springframework.web.servlet.DisPatcherServlet
javax.servlet.UnavailableException: org.springframework.web.servlet.DisPatcherServlet
        at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:102)
        .......
[WARNING] Failed startup of context o.e.j.m.p.JettyWebAppContext@12a160c2{/,file:/E:/Workspaces/jee-kepler/spring-mvc-st
udy/src/main/webapp/,STARTING}{file:/E:/Workspaces/jee-kepler/spring-mvc-study/src/main/webapp/}
MultiException[javax.servlet.UnavailableException: org.springframework.web.servlet.DisPatcherServlet, javax.servlet.Unav
ailableException: org.springframework.web.servlet.DisPatcherServlet]
        at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:840)
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:298)
        at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1341)
        at org.eclipse.jetty.maven.plugin.JettyWebAppContext.startWebapp(JettyWebAppContext.java:296)
        at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1334)
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
        at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:497)
        at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:365)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
        at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:163)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
        at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
        at org.eclipse.jetty.server.Server.start(Server.java:380)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
        ......
[WARNING] !RequestLog
[INFO] Started ServerConnector@17740dae{HTTP/1.1}{0.0.0.0:8080}
[INFO] Started @3257ms
[INFO] Started Jetty Server

这个是报错的内容,项目是慕课课程中的spring mvc中maven配置课程..

浏览器打开项目错误503,求解决

gao634209276
浏览 4767回答 2
2回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java