apache / incubator-streampark

Make stream processing easier! Easy-to-use streaming application development framework and operation platform.
https://streampark.apache.org/
Apache License 2.0
3.91k stars 1.01k forks source link

[Bug] Websocket serverContainer not available #3907

Open xiamuyingu opened 4 months ago

xiamuyingu commented 4 months ago

Search before asking

Java Version

JDK 1.8

Scala Version

2.12.x

StreamPark Version

2.1.4

Flink Version

1.19.1

deploy mode

yarn-application

What happened

I downloaded apache-streampark_2.12-2.1.4-incubating-bin.tar.gz in CentOS7.9,and untar it. I configured environment variables according to document as follows:

export JAVA_HOME=/opt/jdk
export HADOOP_HOME=/opt/hadoop
export HADOOP_CONF_DIR=/opt/hadoop/etc/hadoop
export HADOOP_HDFS_HOME=/opt/hadoop
export HADOOP_YARN_HOME=/opt/hadoop
export HADOOP_MAPRED_HOME=/opt/hadoop
export PATH=${HADOOP_HOME}/bin:${JAVA_HOME}/bin:${PATH}
export CLASSPATH=.:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar

I added mysql-connector-j-8.0.33.jar and flink-shaded-hadoop-3-uber-3.1.1.7.2.9.0-173-9.0.jar to lib directory in streampark. I executed "bash /opt/streampark/bin/startup.sh" and found the service didn't work properly. The log indicated some errors. I also try the streampark docker image 2.1.4. I started the containor and entered it and executed "bash streampark.sh start_docker" and found same errors.

Error Exception

2024-07-22 11:22:26.545 StreamPark [main] WARN  o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext:591 - Exception encountered during context initialization - cancelling refresh attempt: org
.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverEndpointExporter' defined in class path resource [org/apache/streampark/console/base/config/WebSocketConfig.cla
ss]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: javax.websocket.server.ServerContainer not available
2024-07-22 11:22:27.222 StreamPark [main] ERROR o.s.boot.SpringApplication:821 - Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverEndpointExporter' defined in class path resource [org/apache/streampark/console/base/config/WebSocketConfig.
class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: javax.websocket.server.ServerContainer not available
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:920)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
        at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:164)
        at org.apache.streampark.console.StreamParkConsoleBootstrap.main(StreamParkConsoleBootstrap.java:56)
Caused by: java.lang.IllegalStateException: javax.websocket.server.ServerContainer not available
        at org.springframework.util.Assert.state(Assert.java:76)
        at org.springframework.web.socket.server.standard.ServerEndpointExporter.afterPropertiesSet(ServerEndpointExporter.java:107)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
        ... 15 common frames omitted.

Screenshots

image ![Uploading image.png…]()

Are you willing to submit PR?

Code of Conduct

wolfboys commented 4 months ago

Disable websocket in StreamPark. the front-end polling to request data from the back-end. Only info notification is used here.

zzzk1 commented 4 months ago

hi @wolfboys, i would like to try this.

xiamuyingu commented 3 months ago

I found probable cause. I moved flink-shaded-hadoop-3-uber-3.1.1.7.2.9.0-173-9.0.jar to directory /streampark/lib, and when I execute startup.sh, the error happened. I moved flink-shaded-hadoop-3-uber-3.1.1.7.2.9.0-173-9.0.jar out from directory /streampark/lib, and when I execute startup.sh, the service streampark works.