我想运行这个 kurento 示例: https://doc-kurento.readthedocs.io/en/stable/tutorials/java/tutorial-one2one.html
但是在 docker 上构建应用程序服务器时我遇到了一些问题。
问题是,kurento-media-server 构建成功,但其应用程序服务器崩溃了。
我使用的命令是:
1)docker run -t --name kms -p 8889:8888 kurento/kurento-media-server
2)docker run -t --name apps -p 8080:8080 docker-apps
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:06 min
[INFO] Finished at: 2019-10-31T12:16:28+00:00
[INFO] Final Memory: 54M/553M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:
2.1.5.RELEASE:run (default-cli) on project kurento-one2one-call-advanced: An exception
occurred while running. null: InvocationTargetException: Error creating bean with name
'webSocketHandlerMapping' defined in org.springframework.web.socket.config.annotation.
DelegatingWebSocketConfiguration: Bean instantiation via factory method failed;
nested exception is org.springframework.beans.BeanInstantiationException:
Failed to instantiate [org.springframework.web.servlet.HandlerMapping]:
Factory method 'webSocketHandlerMapping' threw exception; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'callHandler': Unsatisfied dependency expressed through
field 'kurento'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'kurentoClient' defined in org.kurento.tutorial.one2onecalladv.One2OneCallAdvApp:
Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException:
Failed to instantiate [org.kurento.client.KurentoClient]:
Factory method 'kurentoClient' threw exception; nested exception is
org.kurento.commons.exception.KurentoException: Exception connecting to KMS: [KurentoClient]
Exception connecting to WebSocket server ws://127.0.0.1:8889/kurento: Connection refused: /127.0.0.1:8889 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]
我使用的Dockerfile是:
FROM ubuntu:16.04
MAINTAINER USER1 "[email protected]"
RUN apt-get update
RUN apt-get install git -y
RUN apt-get install curl -y
RUN apt install apt-utils -y
RUN apt install maven -y
RUN apt install openjdk-8-jdk openjdk-8-jre -y
RUN apt-get install software-properties-common -y
RUN git clone https://github.com/Kurento/kurento-tutorial-java.git
WORKDIR kurento-tutorial-java/kurento-one2one-call-advanced/
EXPOSE 8080
ENTRYPOINT mvn -U clean spring-boot:run -Dkms.url=ws://127.0.0.1:8889/kurento
答案1
端口 8888 是 Websocket 安全端口。您必须使用 -Dkms.url=韋斯://127.0.0.1:8889/kurento 或者更改 Kurento Server 中的 kurento.conf.json 以公开 8433 端口,然后您可以使用 ws:// 协议。