【问题标题】:getting SERVICE_UNAVAILABLE Google Web Toolkit获取 SERVICE_UNAVAILABLE Google Web Toolkit
【发布时间】:2016-02-12 07:38:20
【问题描述】:

当我运行该项目时,我在浏览器中看到一个带有“HTTP 错误:503 / 访问 /EmployeeTracker.html 时出现问题。原因:SERVICE_UNAVAILABLE”的页面

HTTP ERROR: 503

Problem accessing /EmployeeTracker.html. Reason: 
    Service Unavailable


Powered by Jetty:// 

下面是我的 web.xml 文件:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5"
         xmlns="http://java.sun.com/xml/ns/javaee">

  <!-- Servlets -->

  <!-- Default page to serve -->
  <welcome-file-list>
    <welcome-file>EmployeeTracker.html</welcome-file>
  </welcome-file-list>

  <servlet>
    <servlet-name>JsonStockData</servlet-name>
    <servlet-class>com.teamcenter.awc.employee.server.JsonStockData</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name></servlet-name>
    <url-pattern>/employeetracker/stockPrices</url-pattern>
  </servlet-mapping>

</web-app>

下面是堆栈跟踪:

[WARN] Server class 'org.eclipse.jetty.servlet.listener.ELContextCleaner' could not be found in the web app, but was found on the system classpath
   [WARN] Adding classpath entry 'file:/F:/workdir/eclipse-SDK-4.4.1-win32-x86_64/plugins/com.google.gwt.eclipse.sdkbundle_2.6.0/gwt-2.6.0/gwt-dev.jar' to the web app classpath for this session
   For additional info see: file:/F:/workdir/eclipse-SDK-4.4.1-win32-x86_64/plugins/com.google.gwt.eclipse.sdkbundle_2.6.0/gwt-2.6.0/doc/helpInfo/webAppClassPath.html
Starting Jetty on port 0
   [WARN] Failed startup of context c.g.g.d.s.j.WebAppContextWithReload{/,file:/D:/workdir/devunits/AWS/aw2.4.latest/eclipse/EmployeeTracker/war/},D:\workdir\devunits\AWS\aw2.4.latest\eclipse\EmployeeTracker\war
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.visit(IterativeDescriptorProcessor.java:85)
    at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.process(IterativeDescriptorProcessor.java:72)
    at org.eclipse.jetty.webapp.MetaData.resolve(MetaData.java:367)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1240)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
    at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:518)`enter code here`
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
    at org.eclipse.jetty.server.handler.RequestLogHandler.doStart(RequestLogHandler.java:162)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
    at org.eclipse.jetty.server.Server.doStart(Server.java:282)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:717)
    at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:522)
    at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1104)
    at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:844)
    at com.google.gwt.dev.DevMode.main(DevMode.java:322)
Caused by: java.lang.IllegalStateException: No such servlet: 
    at org.eclipse.jetty.servlet.ServletHandler.updateMappings(ServletHandler.java:1320)
    at org.eclipse.jetty.servlet.ServletHandler.setServletMappings(ServletHandler.java:1414)
    at org.eclipse.jetty.servlet.ServletHandler.addServletMapping(ServletHandler.java:896)
    at org.eclipse.jetty.webapp.StandardDescriptorProcessor.addServletMapping(StandardDescriptorProcessor.java:1199)
    at org.eclipse.jetty.webapp.StandardDescriptorProcessor.visitServletMapping(StandardDescriptorProcessor.java:632)
    ... 23 more

你知道如何解决它吗?

【问题讨论】:

    标签: servlets gwt invocationtargetexception


    【解决方案1】:

    您的 servlet 映射的 servlet 名称为空。试试这个:

    <servlet-mapping>
        <servlet-name>JsonStockData</servlet-name>
        <url-pattern>/employeetracker/stockPrices</url-pattern>
    </servlet-mapping>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-09-01
      • 1970-01-01
      • 2011-01-03
      • 1970-01-01
      • 1970-01-01
      • 2011-09-03
      • 2011-04-21
      • 1970-01-01
      相关资源
      最近更新 更多