JNDI 查找在 HornetQ 队列示例中挂起

发布于 2024-12-27 00:21:47 字数 1902 浏览 2 评论 0原文

我正在尝试使用远程托管的 JNDI 和 HornetQ 服务器来运行 HornetQ jms/queue 示例。

HornetQ 服务器运行在 10.0.10.102 上。客户端在 10.0.2.62 上运行。服务器和客户端机器都是 Linux 机器。

我在客户端配置了 client-jndi.properties 文件,如下所示: java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.provider.url=jnp://10.0.10.102:1099 java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

我在 hornetq-beans.xml 配置文件中配置了 JNDI 设置,如下所示:

<bean name="JNDIServer" class="org.jnp.server.Main">
  <property name="namingInfo">
     <inject bean="Naming"/>
  </property>
  <property name="port">1099</property>
  <property name="bindAddress">10.0.10.102</property>
  <property name="rmiPort">1098</property>
  <property name="rmiBindAddress">10.0.10.102</property>
</bean>

我得到一个“连接被拒绝”错误或客户端挂起查找 JNDI 服务,具体取决于我是否在服务器端 Linux 计算机上运行“rmiregistry” (10.0.10.102)。

如果不运行“rmiregistry”,我会在客户端收到以下错误:

 [java] javax.naming.CommunicationException: Could not obtain connection to any of these urls: 10.0.10.102:30199 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server /10.0.10.102:30199 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server /10.0.10.102:30199 [Root exception is java.net.ConnectException: Connection refused]]]

当我在服务器主机上运行“rmiregistry”时,JNDI 查找挂起:

 [java] Jan 12, 2012 2:23:47 PM org.hornetq.common.example.HornetQExample getContext
 [java] INFO: using server0/client-jndi.properties for jndi

挂起这里...

知道我还需要做什么来配置 JNDI 或JNDI 查找过程的 Java 环境?谢谢。

I am trying to run the HornetQ jms/queue example with the JNDI and HornetQ server being hosted remotely.

The HornetQ server is running on 10.0.10.102. The client running on 10.0.2.62. Both the server and client machines are Linux boxes.

I configured the client-jndi.properties file on the client side as follows:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://10.0.10.102:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

I configured the JNDI settings in the hornetq-beans.xml config file as follows:

<bean name="JNDIServer" class="org.jnp.server.Main">
  <property name="namingInfo">
     <inject bean="Naming"/>
  </property>
  <property name="port">1099</property>
  <property name="bindAddress">10.0.10.102</property>
  <property name="rmiPort">1098</property>
  <property name="rmiBindAddress">10.0.10.102</property>
</bean>

I get either a "Connection Refused" error or the client hangs looking up the JNDI service depending upon whether I ran the "rmiregistry" on the server side Linux machine (10.0.10.102).

Without running "rmiregistry", I get the following error on the client side:

 [java] javax.naming.CommunicationException: Could not obtain connection to any of these urls: 10.0.10.102:30199 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server /10.0.10.102:30199 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server /10.0.10.102:30199 [Root exception is java.net.ConnectException: Connection refused]]]

When I do run "rmiregistry" on the server host, the JNDI lookup hangs:

 [java] Jan 12, 2012 2:23:47 PM org.hornetq.common.example.HornetQExample getContext
 [java] INFO: using server0/client-jndi.properties for jndi

Hangs here...

Any idea what else I need to do to configure JNDI or my Java environment for the JNDI lookup process? Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡写薰衣草的香 2025-01-03 00:21:47

该示例被编写为在同一终端上执行。该示例在同一个机器上启动远程服务器和本地服务器。

当您远程运行它时,您正在创建某种机制来启动远程服务器,因此您可能会弄乱一些配置。

我没有足够的信息来说明您如何启动服务器,所以我现在无法真正回答您的问题。如果您提供有关如何启动服务器以及进行哪些配置更改的更多信息,我将尽力帮助您。

我建议您阅读 HornetQ 的 Netty/remoting 配置章节。

至于这里的 Netty,我只是认为你更改了错误的文件,因为

That example was written to be executed on the same terminal. The example is starting a remote server and the local server on the same box.

As you're running it remotely, you're creating some mechanism to start a remote server, so you're probably messing up some config.

I don't have enough information as to how you are starting the server, so I can't really answer your question right now. I will try to help you if you provide more information on how you're starting the server and what configuration changes are you making.

I would recommend you to read the Netty/remoting configuration chapter of HornetQ.

As for Netty here I just think you're changing the wrong file since

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文