【问题标题】:Servlet mapping specifies an unknown servlet name when use spring4gwt library使用 spring4gwt 库时 Servlet 映射指定未知的 servlet 名称
【发布时间】:2014-08-19 09:26:46
【问题描述】:

我正在尝试使用库 spring4gwt-0.0.1.jar 集成 GWT 和 Spring,但出现以下错误:

Caused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name springGwtRemoteServiceServlet
at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3275)
at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3254)
at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1430)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1344)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:876)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:374)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5355)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 6 more

我的 web.xml

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

    <display-name>TelephoneBook</display-name>

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:spring/application-config.xml</param-value>
    </context-param>

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>    

    <servlet>
        <servlet-name>springGwtRemoteServiceServlet</servlet-name>
        <servlet-class>org.spring4gwt.server.SpringGwtRemoteServiceServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>>springGwtRemoteServiceServlet</servlet-name>
        <url-pattern>/TelephoneBook/springGwtServices/*</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
        <welcome-file>TelephoneBook.html</welcome-file>
    </welcome-file-list>

</web-app>

怎么了?提前致谢!

【问题讨论】:

  • 没错!我怎么可能没有注意到?非常感谢!

标签: spring servlets gwt mapping


【解决方案1】:

在这里&lt;servlet-name&gt;&gt;springGwtRemoteServiceServlet&lt;/servlet-name&gt; 你有很多&gt;。是复制粘贴错误吗? (在开始 servlet-name 标记之后

【讨论】:

  • 没错!我怎么可能没有注意到?非常感谢!
猜你喜欢
  • 2016-04-04
  • 2015-10-20
  • 2019-04-14
  • 2016-07-05
  • 2015-01-03
  • 1970-01-01
  • 2015-11-19
  • 2015-03-01
相关资源
最近更新 更多