Open yin-bp opened 8 years ago
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 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>WebSocketTomcat7</display-name>
<welcome-file-list>
<welcome-file>websocket.jsp</welcome-file>
</welcome-file-list>
</web-app>
Have the same problem.
Same problem here with Java9 & Tomcat9.0.6 Has anybody tried this plugin: https://github.com/gretty-gradle-plugin/gretty ?
Edit: Fixed it by removing (accidentally added) tag <absolute-ordering/>
from my web.xml.
build.gradle:
dependencies {
// JavaEE APIs
providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version:'4.0.0'
providedCompile group: 'javax.servlet.jsp', name: 'javax.servlet.jsp-api', version:'2.3.1'
providedCompile group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2'
providedCompile group: 'javax.websocket', name: 'javax.websocket-api', version:'1.1'
// Tomcat
def tomcatVersion = '9.0.6'
compile group: 'org.apache.tomcat.embed', name: 'tomcat-embed-websocket', version: tomcatVersion
tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}",
// "org.apache.tomcat.embed:tomcat-embed-logging-juli:9.0.0.M6",
"org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}"
}
Deploy websocket services with tomcat 8.0.33 by tomcatRun task,but response 404 error when send a request from client browser (chrome or ie 11):
WebSocket connection to 'ws://localhost/bboss-websocket/Websocket1Action' failed: Error during WebSocket handshake: Unexpected response code: 404
but deploy directly same websocket services with tomcat 8.0.33 is ok.
build.gradle:
gradle version:2.12 tomcat 8.0.33