jetty websocket HttpConnection ClassCastException

时间:2014-11-07 08:08:07

标签: websocket jetty

Jetty - stand alone WebSocket server

我面临与上述链接中描述的相同的问题。有人有解决方案吗?

My Pom详情:

<plugin>
            <groupId>org.simplericity.jettyconsole</groupId>
            <artifactId>jetty-console-maven-plugin</artifactId>
            <version>1.5.6</version>
            <configuration>
                <additionalDependencies>
                    <additionalDependency>
                        <artifactId>jetty-console-jsp-plugin</artifactId>
                    </additionalDependency>
                    <additionalDependency>
                        <artifactId>jetty-console-startstop-plugin</artifactId>
                    </additionalDependency>
                    <additionalDependency>
                        <groupId>com.fixflyer.share</groupId>
                        <artifactId>jc-contextpath-plugin</artifactId>
                        <version>${flyer.jccontextpathplugin}</version>
                    </additionalDependency>
                    <additionalDependency>
                        <groupId>org.eclipse.jdt.core.compiler</groupId>
                        <artifactId>ecj</artifactId>
                        <version>${ecj.version}</version>
                    </additionalDependency>
                </additionalDependencies>
                <properties>
                    contextPath=/abc
                </properties>
            </configuration>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>createconsole</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

和我的依赖列表

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-websocket</artifactId>
        <version>4.0.7.RELEASE</version>
        <exclusions>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-web</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.eclipse.jetty.websocket</groupId>
        <artifactId>websocket-common</artifactId>
        <version>9.2.3.v20140905</version>
        <exclusions>
            <exclusion>
                 <groupId>org.eclipse.jetty.websocket</groupId>
                 <artifactId>websocket-api</artifactId>
            </exclusion>
            <exclusion>
                 <groupId>org.eclipse.jetty</groupId>
                 <artifactId>jetty-io</artifactId>
            </exclusion>
            <exclusion>
                    <groupId>org.eclipse.jetty</groupId>
                    <artifactId>jetty-util</artifactId>
            </exclusion>
        </exclusions>   
    </dependency>
    <dependency>
        <groupId>org.eclipse.jetty.websocket</groupId>
        <artifactId>websocket-api</artifactId>
        <version>9.2.3.v20140905</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.jetty.websocket</groupId>
        <artifactId>websocket-servlet</artifactId>
        <version>9.2.3.v20140905</version>
        <exclusions>
            <exclusion>
                 <groupId>org.eclipse.jetty.websocket</groupId>
                 <artifactId>websocket-api</artifactId>
            </exclusion>
        </exclusions>   
    </dependency>
    <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-io</artifactId>
        <version>9.2.3.v20140905</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-server</artifactId>
        <version>9.2.3.v20140905</version>
     <exclusions>
        <exclusion>
                 <groupId>org.eclipse.jetty</groupId>
                 <artifactId>jetty-http</artifactId>
        </exclusion>
        <exclusion>
                 <groupId>org.eclipse.jetty</groupId>
                 <artifactId>jetty-io</artifactId>
        </exclusion>
     </exclusions>  
   </dependency>
   <dependency>
        <groupId>org.eclipse.jetty.websocket</groupId>
        <artifactId>websocket-server</artifactId>
        <version>9.2.3.v20140905</version>
        <exclusions>
            <exclusion>
                 <groupId>org.eclipse.jetty.websocket</groupId>
                 <artifactId>websocket-common</artifactId>
            </exclusion>
            <exclusion>
                 <groupId>org.eclipse.jetty.websocket</groupId>
                <artifactId>websocket-client</artifactId>
            </exclusion>
            <exclusion>
                 <groupId>org.eclipse.jetty.websocket</groupId>
                <artifactId>websocket-servlet</artifactId>
            </exclusion>
            <exclusion>
                 <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-servlet</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-http</artifactId>
            </exclusion>
            <exclusion>
                 <groupId>org.eclipse.jetty</groupId>
                 <artifactId>jetty-server</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

我将所有的Jetty罐子排除在战争档案之外。

1 个答案:

答案 0 :(得分:0)

最常见的原因:不要在战争中包括码头类WEB-INF/lib