0

我正在对我的 Vaadin 项目使用响应式加载项。我编译了小部件,并且能够在 Eclipse 上运行该项目。我使用的版本是 Vaadin 7.1.9 和 Eclipse Juno。

然后,当我尝试导出到 war 文件并将其部署在 Jetty 8 和 Jetty 9 上时。我收到以下错误。

在 Jetty 8 中,我回来了:我能够启动码头,但是当我尝试从浏览器访问时,我得到了以下信息:

      Widgetset does not contain implementation for com.vaadin.addon.responsive.Responsive. 
      Check its component connector's @Connect mapping, widgetsets GWT module description file and re-compile your widgetset. 
      In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions.

在 Jetty 9,我回来了:

    java.lang.IllegalStateException: Multiple servlets map to path: /*
            at org.eclipse.jetty.servlet.ServletHandler.updateMappings(ServletHandle
    r.java:1383)
            at org.eclipse.jetty.servlet.ServletHandler.setServletMappings(ServletHa
    ndler.java:1480)
            at org.eclipse.jetty.servlet.ServletHandler.addServletMapping(ServletHan
    dler.java:916)
            at org.eclipse.jetty.annotations.WebServletAnnotation.apply(WebServletAn

请注意:我有另一个在 Jetty 8 和 Jetty 9 中成功执行的 war 文件。我的项目也可以在没有该小部件集的情况下工作。

使用 Jetty 8,我尝试再次重新编译小部件,但我得到了同样的错误。

这是我的 web.xml 文件:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
        <display-name>Demo</display-name>
        <context-param>
            <description>Vaadin production mode</description>
            <param-name>productionMode</param-name>
            <param-value>false</param-value>
        </context-param>
        <servlet>
            <servlet-name>Myrmnui Application</servlet-name>
            <servlet-class>com.demo.main.DemoResponsiveAppServlet</servlet-class>
            <init-param>
                <description>Vaadin UI class</description>
                <param-name>UI</param-name>
                <param-value>com.demo.main.MainUI</param-value>
            </init-param>
            <init-param>
                <description>
                Application widgetset</description>
                <param-name>widgetset</param-name>
                <param-value>com.demo.main.widgetset.DemoWidgetset</param-value>
            </init-param>
        </servlet>
        <servlet-mapping>
            <servlet-name>Application</servlet-name>
            <url-pattern>/*</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>Application</servlet-name>
            <url-pattern>/VAADIN/*</url-pattern>
        </servlet-mapping>
    </web-app>

请让我知道如何构建一个战争文件并与小部件一起部署。我使用eclipse导出到war文件。为了确保小部件文件存在,我解压缩了 war 文件并且它们存在。这些文件的文件大小不为零。

提前致谢。

4

1 回答 1

0

The error ...

`java.lang.IllegalStateException: Multiple servlets map to path: /*` 

... is telling, as it points to an invalid WAR deployment, where there are multiple servlets all mapping to the same path-spec. That's not allowed in the Servlet API.

Is it possibly that one of them should be a filter?

Or that some library is bringing in more @WebServlet(value={"/*"}) entries that are conflicting with yours?

If you setup DEBUG logging (or FINEST if using java.util.logging) against the named logger org.eclipse.jetty.servlet.ServletHandler you can see some scant detail on what's going on.

However, the error message can be improved, so a bug has been filed to improve it: https://bugs.eclipse.org/424284

于 2013-12-17T23:56:19.607 回答