0

每当我尝试在 localhost:8080 上运行 java 镜像快速启动大师时,我都会得到。

            HTTP ERROR: 503
            Problem accessing /. Reason:
            SERVICE_UNAVAILABLE
            Powered by Jetty://

我在命令行中使用mav jetty:run。我不知道我哪里错了。我担心解决方案会打到我的脸,我看不到它。

任何帮助将不胜感激在此先感谢您。

 Scanning for projects...

 ----------------------------------------------------------------------
 Building glass-java-starter 0.1-SNAPSHOT
 ----------------------------------------------------------------------

 >>> maven-jetty-plugin:6.1.26:run (default-cli) @ glass-java-starter >

 --- maven-resources-plugin:2.6:resources (default-resources) @ glass-j
er ---
 Using 'UTF-8' encoding to copy filtered resources.
 Copying 1 resource

 --- maven-compiler-plugin:3.1:compile (default-compile) @ glass-java-s
-
 Nothing to compile - all classes are up to date

 --- maven-resources-plugin:2.6:testResources (default-testResources) @
va-starter ---
 Using 'UTF-8' encoding to copy filtered resources.
 skip non existing resourceDirectory C:\mirror-quickstart-java-master\s
esources

 --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ glas
arter ---
 No sources to compile

 <<< maven-jetty-plugin:6.1.26:run (default-cli) @ glass-java-starter <

 --- maven-jetty-plugin:6.1.26:run (default-cli) @ glass-java-starter -
 Configuring Jetty for project: glass-java-starter
 Webapp source directory = C:\mirror-quickstart-java-master\src\main\we

 Reload Mechanic: automatic
 Classes = C:\mirror-quickstart-java-master\target\classes
 Logging to org.slf4j.impl.SimpleLogger(org.mortbay.log) via org.mortba
4jLog
 Context path = /
 Tmp directory =  determined at runtime
 Web defaults = org/mortbay/jetty/webapp/webdefault.xml
 Web overrides =  none
 web.xml file = C:\mirror-quickstart-java-master\src\main\webapp\WEB-IN

 Webapp directory = C:\mirror-quickstart-java-master\src\main\webapp
 Starting jetty 6.1.26 ...
 jetty-6.1.26
NG] Failed startup of context org.mortbay.jetty.plugin.Jetty6PluginWebA
@6d9ef759{/,C:\mirror-quickstart-java-master\src\main\webapp}
ang.ClassNotFoundException: com.google.glassware.SignOutServlet
  at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadCla
rstStrategy.java:50)
  at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRe
244)
  at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRe
230)
  at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLo
:401)
  at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLo
:363)
  at org.mortbay.jetty.handler.ContextHandler.loadClass(ContextHandler.
)
  at org.mortbay.jetty.plugin.Jetty6MavenConfiguration.parseAnnotations
venConfiguration.java:141)
  at org.mortbay.jetty.plus.webapp.AbstractConfiguration.configure(Abst
guration.java:119)
  at org.mortbay.jetty.webapp.WebXmlConfiguration.configureWebApp(WebXm
ation.java:180)
  at org.mortbay.jetty.plus.webapp.AbstractConfiguration.configureWebAp
tConfiguration.java:96)
  at org.mortbay.jetty.plus.webapp.Configuration.configureWebApp(Config
ava:149)
  at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.
)
  at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.ja

  at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:

  at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6P
ppContext.java:115)
  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.ja

  at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollect
152)
  at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(Context
llection.java:156)
  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.ja

  at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollect
152)
  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.ja

  at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.ja

  at org.mortbay.jetty.Server.doStart(Server.java:224)
  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.ja

  at org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServ
32)
  at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJett
a:454)
  at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMo
96)
  at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(AbstractJett
java:210)
  at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:

  at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Defa
luginManager.java:106)
  at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecu
208)
  at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecu
153)
  at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecu
145)
  at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildPr
ecycleModuleBuilder.java:84)
  at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildPr
ecycleModuleBuilder.java:59)
  at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreade
fecycleStarter.java:183)
  at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifec
er.java:161)
  at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:318)
  at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153)
  at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
  at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
  at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorIm
7)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAc
l.java:43)
  at java.lang.reflect.Method.invoke(Method.java:606)
  at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(L
ava:290)
  at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.

  at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode
.java:414)
  at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.ja

 Started SelectChannelConnector@0.0.0.0:8080
 Started Jetty Server
4

1 回答 1

1

看起来 Web 应用程序无法找到已声明的 servlet SignOutServlet。

这个 servlet 被删除了几次提交,看起来您的 web.xml 文件与可用源不同步。您有几个选项可以解决此问题:

  1. 制作一个新的克隆/下载最新版本的Java 快速入门的 zip 文件(这可能是最简单的解决方案)
  2. 从本次提交src/main/webapp/WEB-INF/web.xml中删除对 SignOutServlet 的所有引用。

      <url-pattern>/attachmentproxy</url-pattern>
    </servlet-mapping>
    
    <!-- remove stuff below here -->
    <servlet>
      <servlet-name>signout</servlet-name>
      <servlet-class>com.google.glassware.SignOutServlet</servlet-class>
    </servlet>
    <servlet-mapping>
      <servlet-name>signout</servlet-name>
      <url-pattern>/signout</url-pattern>
    </servlet-mapping>
    <!-- remove stuff above here -->
    
    
    <welcome-file-list>
      <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    

删除这些依赖项后,请在构建之前进行清理:

$ mvn clean jetty:run
于 2013-08-20T22:52:55.803 回答