java - 使用 IntelliJ IDEA 插件在 Siddhi SDK 中启动 HL7 服务时出现端口绑定(bind)错误

标签 java intellij-idea sdk siddhi

我尝试使用 IntelliJ 插件开发 Siddhi 扩展。当我尝试在任何端口上配置“hl7”源时,HL7Service 似乎启动了两次。这不起作用,因为网络端口只能打开一次。

我检查没有其他 Siddhi 实例正在运行,并且我尝试了许多不同的端口。

@App:name('HL7SiddhiApp')
@App:description('Description of the plan')
@source(type = 'hl7', port = "7777", hl7.encoding = "er7", @map(type = 'text'))
define stream hl7stream (message string);

@sink(type = 'log', @map(type = 'passThrough'))
define stream outStream (message string);

from hl7stream
select message
insert into outStream;
[ca.uhn.hl7v2.util.Home] : hapi.home is set to C:\Workspace\IdeaProjects\HelloSiddhi\HL7Siddhi\.
[ca.uhn.hl7v2.VersionLogger] : HAPI version is: 2.2
[ca.uhn.hl7v2.VersionLogger] : Default Structure libraries found for HL7 versions 2.2, 2.3, 2.4, 2.5, 2.5.1, 
[ca.uhn.hl7v2.conf.store.FileProfileStore] : Profile store directory doesn't exist: C:\Workspace\IdeaProjects\HelloSiddhi\HL7Siddhi\./profiles
[ca.uhn.hl7v2.concurrent.Service] : Starting service HL7 Server
[ca.uhn.hl7v2.app.HL7Service] : Starting ConnectionCleaner service
[ca.uhn.hl7v2.concurrent.Service] : Starting service ConnectionCleaner
[ca.uhn.hl7v2.app.SimpleServer] : Starting SimpleServer running on port 7777
[ca.uhn.hl7v2.concurrent.Service] : Thread ConnectionCleaner entering main loop
[ca.uhn.hl7v2.concurrent.Service] : Starting service Socket Acceptor
[ca.uhn.hl7v2.concurrent.Service] : Thread HL7 Server entering main loop
[ca.uhn.hl7v2.concurrent.Service] : Thread Socket Acceptor entering main loop
[ca.uhn.hl7v2.concurrent.Service] : Prepare to stop thread HL7 Server
INFO  [org.wso2.siddhi.sdk.launcher.LauncherUtils] - Event Input file is not provided or file is empty
[ca.uhn.hl7v2.concurrent.Service] : Starting service HL7 Server
[ca.uhn.hl7v2.app.HL7Service] : Starting ConnectionCleaner service
[ca.uhn.hl7v2.concurrent.Service] : Starting service ConnectionCleaner
[ca.uhn.hl7v2.app.SimpleServer] : Starting SimpleServer running on port 7777
[ca.uhn.hl7v2.concurrent.Service] : Starting service Socket Acceptor
[ca.uhn.hl7v2.concurrent.Service] : Thread HL7 Server entering main loop
[ca.uhn.hl7v2.concurrent.Service] : Thread ConnectionCleaner entering main loop
[ca.uhn.hl7v2.concurrent.Service] : Thread exiting main loop due to exception:
java.lang.RuntimeException: java.net.BindException: Address already in use: JVM_Bind
    at ca.uhn.hl7v2.app.AcceptorThread.afterStartup(AcceptorThread.java:106)
    at ca.uhn.hl7v2.concurrent.Service.run(Service.java:202)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

最佳答案

您可以尝试以下命令来检查本地计算机上正在使用哪些端口以及哪个进程正在使用它。尝试输出中不存在的端口。

sudo netstat -tulpn
  • t:TCP
  • u:udp
  • l:监听端口
  • p:进程 n:网络

关于java - 使用 IntelliJ IDEA 插件在 Siddhi SDK 中启动 HL7 服务时出现端口绑定(bind)错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56663123/

相关文章:

java - 有用于 Java 的 Coffeescript 吗?换句话说 X 被编译成 Java

java - Intellij 运行/调试目标未在其自己的模块中找到类

java - 使用 IntelliJ IDEA 调试时,不同的变量颜色代表什么意思?

java - 如何在 IntelliJ 中获取方法调用的返回类型?

android - 将 SDK 更新到 17.0.0+ 版本后,我在 Firebase Crashlytics 仪表板上看不到崩溃

java - 是什么导致了这个 Java "Cannot find symbol"错误?

Java 8 stream 2 列表列表和sum对应索引

java - JTree 延迟加载 展开

java - 从不同的包访问 R.java

php - Laravel Facebook-登录/丢失电子邮件