From ea86dd59d5321ac3c3da88290203428bb2f225aa Mon Sep 17 00:00:00 2001 From: Elijah Date: Wed, 15 Dec 2021 13:43:35 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-64286=20fix:=20=E5=86=85=E5=B5=8Ctomcat?= =?UTF-8?q?=E4=B8=8D=E6=94=AF=E6=8C=81websocket?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 1 + .../java/com/fr/start/server/FineEmbedServerActivator.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/build.gradle b/build.gradle index 5bac80b64..a3892da96 100644 --- a/build.gradle +++ b/build.gradle @@ -69,6 +69,7 @@ allprojects { implementation 'org.swingexplorer:swag:1.0' implementation 'net.java.dev.jna:jna:5.4.0' implementation 'org.apache.tomcat:tomcat-catalina:8.5.72' + implementation 'org.apache.tomcat:tomcat-websocket:8.5.72' implementation 'io.socket:socket.io-client:0.7.0' implementation 'com.fr.third:fine-third:' + frVersion implementation 'com.fr.core:fine-core:' + frDevVersion diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java index 854d260bf..35e2090d9 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java @@ -8,8 +8,10 @@ import com.fr.stable.EncodeConstants; import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; import com.fr.startup.FineWebApplicationInitializer; +import com.fr.third.guava.collect.Sets; import com.fr.third.springframework.web.SpringServletContainerInitializer; import com.fr.third.springframework.web.context.support.AnnotationConfigWebApplicationContext; +import com.fr.web.socketio.WebSocketEndpoint; import com.fr.workspace.WorkContext; import org.apache.catalina.Context; import org.apache.catalina.LifecycleException; @@ -17,6 +19,7 @@ import org.apache.catalina.Wrapper; import org.apache.catalina.loader.WebappLoader; import org.apache.catalina.startup.Tomcat; import org.apache.catalina.webresources.StandardRoot; +import org.apache.tomcat.websocket.server.WsSci; import java.io.File; import java.util.HashSet; @@ -92,6 +95,7 @@ public class FineEmbedServerActivator extends Activator { Set> classes = new HashSet>(); classes.add(FineWebApplicationInitializer.class); context.addServletContainerInitializer(initializer, classes); + context.addServletContainerInitializer(new WsSci(), Sets.newHashSet(WebSocketEndpoint.class)); } // tomcat的maxPostSize会影响到post参数获取,默认2M