gpt4 book ai didi

java - 使用 Coherence jar 运行多播测试时出现错误

转载 作者:行者123 更新时间:2023-12-02 10:39:49 25 4
gpt4 key购买 nike

我正在我的计算机上运行多播测试,以检查它是否可以与在我的工作场所运行的其他节点交换数据包。我通过 VPN 连接到工作场所网络。在工作场所测试运行良好,但当我使用 VPN 时则不然。谁能指出我缺少什么,是否需要在 VPN 上启用某些特定功能。以下是日志:

$ java -cp ./coherence-3.5.1.b461.jar -Djava.net.preferIPv4Stack=true 
com.tangosol.net.MulticastTest -group=237.0.0.1:30012 -ttl 4
2018-10-26 04:05:54.303/0.318 Oracle Coherence 3.5.1/461 <Info>
(thread=main, member=n/a): Loaded operational configuration from
resource "jar:file:/coherence-3.5.1.b461.jar!/tangosol-coherence.xml"
2018-10-26 04:05:54.307/0.321 Oracle Coherence 3.5.1/461 <Info>
(thread=main, member=n/a): Loaded operational overrides from resource
"jar:file:/coherence-3.5.1.b461.jar!/tangosol-coherence-override-
dev.xml"
2018-10-26 04:05:54.307/0.321 Oracle Coherence 3.5.1/461 <D5>
(thread=main, member=n/a): Optional configuration override "/tangosol-
coherence-override.xml" is not specified
2018-10-26 04:05:54.309/0.324 Oracle Coherence 3.5.1/461 <D5>
(thread=main, member=n/a): Optional configuration override "/custom-
mbeans.xml" is not specified

Oracle Coherence Version 3.5.1/461
Grid Edition: Development mode
Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights
reserved.

Starting test on ip=C02NK9NJG3QC/10.30.61.25, group=/237.0.0.1:30012,
ttl=4
Configuring multicast socket...
2018-10-26 04:05:54.373/0.387 Oracle Coherence GE 3.5.1/461 <Error>
(thread=main, member=n/a): An exception occurred while executing the
MulticastTest:
2018-10-26 04:05:54.373/0.388 Oracle Coherence GE 3.5.1/461 <Error>
(thread=main, member=n/a): (Wrapped) java.net.SocketException: Can't
assign requested address (Error setting socket option)
at com.tangosol.util.Base.ensureRuntimeException(Base.java:293)
at com.tangosol.util.Base.ensureRuntimeException(Base.java:269)
at com.tangosol.net.MulticastTest.initSocket(MulticastTest.java:323)
at com.tangosol.net.MulticastTest.run(MulticastTest.java:267)
at com.tangosol.net.MulticastTest.main(MulticastTest.java:126)
Caused by: java.net.SocketException: Can't assign requested address
(Error setting socket option)
at java.net.PlainDatagramSocketImpl.socketSetOption0(Native Method)
at java.net.PlainDatagramSocketImpl.socketSetOption
(PlainDatagramSocketImpl.java:74)
at java.net.AbstractPlainDatagramSocketImpl.setOption
(AbstractPlainDatagramSocketImpl.java:309)
at java.net.MulticastSocket.setInterface(MulticastSocket.java:471)
at com.tangosol.net.MulticastTest.initSocket(MulticastTest.java:315)
... 2 more

2018-10-26 04:05:54.373/0.388 Oracle Coherence GE 3.5.1/461 <Error>
(thread=main, member=n/a):

Exiting MulticastTest

最佳答案

为什么会出错?

如果没有进一步的细节和分析,我不确定,但是part of this answer可能会解释您遇到的错误。这是相关引用,重点是我的:

In my case I had just began using a VPN to a network that required authentication. ... but via the VPN the multicast requests were met with an authentication challenge and this error was the result.

如何修复它,或者更确切地说......有哪些替代方案?

我对此问题没有直接经验,因此无法针对您的具体情况提供解决方案:

I am running multicast test on my computer to check if it can exchange packets with other nodes running at my workplace.

但我认为您可以根据您的需求考虑替代方案:

在本地网络中使用多播

如果您确实需要多播与本地网络中的计算机配合使用(例如本地调试 session ),并且不需要连接到工作场所网络上的计算机,请确保多播正在使用您的本地网络接口(interface).

您的计算机当前连接到的不同网络接口(interface)可能有不同的 IP 地址。您可以通过发出ipconfig来检查它们/ifconfig命令。

对于您的实例,JVM 选择一个 IP 为 10.30.61.25 的网络接口(interface)。用于多播。使用该 IP 时似乎存在问题。如果该 IP 是您的 VPN IP,并且如果您的本地 IP 是 112.1.1.100 ,然后尝试使用 -local <IP> 指定您的本地 IP ,像这样:

java -cp ./coherence-3.5.1.b461.jar -Djava.net.preferIPv4Stack=true com.tangosol.net.MulticastTest -group 237.0.0.1:30012 -ttl 4 -local 112.1.1.100

在工作场所网络中使用多播

如果您主要需要在工作场所网络内运行多播,请尝试仅在该工作场所网络内运行多播。因此,设置多播测试以在工作场所的服务器/主机上远程运行。

关于java - 使用 Coherence jar 运行多播测试时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53005017/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com