JBoss 4.2.3GA 上基于 HTTP 的 JNDI

发布于 2024-08-22 02:42:32 字数 1428 浏览 2 评论 0原文

我在 eapps.com 上有一个远程服务器,我将其用作“生产”服务器。我家里有自己的计算机,用作我的“开发”服务器。我正在尝试使用 JNDI over HTTP 进行一些批处理。以下内容适用于家庭,但不适用于 eapps 机器。

我正在连接到一些 EJB(无状态会话),并将我的 jndi.properties 设置为:(

这是针对 eapps 机器)

java.naming.factory.initial=org.jboss.naming.HttpNamingContextFactory
java.naming.provider.url=http://my.prodhost.com:8080/invoker/JNDIFactory
java.naming.factory.url.pkgs=org.jboss.naming.client:org.jnp.interfaces
# timeout is in milliseconds
jnp.timeout=15000
jnp.sotimeout=15000
jnp.maxRetries=3

(这是针对我家里的机器)

java.naming.factory.initial=org.jboss.naming.HttpNamingContextFactory
java.naming.provider.url=http://localhost:8080/invoker/JNDIFactory
java.naming.factory.url.pkgs=org.jnp.interfaces
java.naming.factory.url.pkgs=org.jboss.naming.client
# timeout is in milliseconds
jnp.timeout=15000
jnp.sotimeout=15000
jnp.maxRetries=3

正如我所说,它可以在家里工作,但是当我远程尝试,我得到:

Can not get connection to server. Problem establishing socket connection for InvokerLocator [socket://my.prodhost.com:4446//?dataType=invocation&enableTcpNoDelay=true&marshaller=org.jboss.invocation.unified.marshall.InvocationMarshaller&socketTimeout=600000&unmarshaller=org.jboss.invocation.unified.marshall.InvocationUnMarshaller]
...
Caused by: java.net.ConnectException: Connection timed out: connect

我在这里做错了什么,或者可能是防火墙问题?据我所知,端口 4446 并未被阻止。

I've got a remote server on eapps.com that I'm using as my "production" server. I have my own computer at home that I'm using as my "development" server. I'm trying to use JNDI over HTTP to do some batch processing. The following works at home, but not on the eapps machine.

I'm connecting to some EJBs (stateless session), and have my jndi.properties set to this:

(this is for the eapps machine)

java.naming.factory.initial=org.jboss.naming.HttpNamingContextFactory
java.naming.provider.url=http://my.prodhost.com:8080/invoker/JNDIFactory
java.naming.factory.url.pkgs=org.jboss.naming.client:org.jnp.interfaces
# timeout is in milliseconds
jnp.timeout=15000
jnp.sotimeout=15000
jnp.maxRetries=3

(this is for my machine at home)

java.naming.factory.initial=org.jboss.naming.HttpNamingContextFactory
java.naming.provider.url=http://localhost:8080/invoker/JNDIFactory
java.naming.factory.url.pkgs=org.jnp.interfaces
java.naming.factory.url.pkgs=org.jboss.naming.client
# timeout is in milliseconds
jnp.timeout=15000
jnp.sotimeout=15000
jnp.maxRetries=3

As I said, it works at home, but when I try it remotely, I get:

Can not get connection to server. Problem establishing socket connection for InvokerLocator [socket://my.prodhost.com:4446//?dataType=invocation&enableTcpNoDelay=true&marshaller=org.jboss.invocation.unified.marshall.InvocationMarshaller&socketTimeout=600000&unmarshaller=org.jboss.invocation.unified.marshall.InvocationUnMarshaller]
...
Caused by: java.net.ConnectException: Connection timed out: connect

Am I doing something wrong here, or is it possibly a firewall issue? To the best of my knowledge, port 4446 is not blocked.

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

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

发布评论

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

评论(1

烂人 2024-08-29 02:42:32

jndi.properties 中的差异是否是故意的(在 java.naming.factory.url.pkgs 属性级别)?

另外,您可以运行 netstat -a | 吗? grep 4446 在两台机器上运行并用输出更新问题?

更新:如果 netstat 命令没有为端口 4446 返回任何内容(JBoss 正在运行,对吧?),则 JBoss Remoting Connector UnifiedInvoker 服务很可能没有在您的 eApps 主机上侦听,因此连接暂停。也许此服务已被 eApps 禁用,您应该联系支持并与他们讨论。

为了以防万一,可以在服务器节点的 conf 目录下的 jboss-service.xml 中找到示例 Connector 配置。也许将远程文件(如果您有权访问它)与本地文件进行比较以确认这一点(但如果它被禁用,则必须有一个原因,请与支持人员讨论)。

顺便说一句,这是我在 GNU/Linux 机器上启动 JBoss 4.2.3.GA(默认配置)时运行 netstat 命令时得到的结果:

$ netstat -a | grep 4446
tcp        0      0 localhost:4446          *:*                     LISTEN  

Are the differences in the jndi.properties intentional (at the java.naming.factory.url.pkgs property level)?

Also, can you run a netstat -a | grep 4446 on both machines and update the question with the output?

Update: If the netstat command didn't return anything for port 4446 (JBoss was running, right?), then the JBoss Remoting Connector for the UnifiedInvoker service is very likely not listening on your eApps host, hence the connection timeout. Maybe this service has been disabled by eApps, you should contact the support and discuss this with them.

Just in case, a sample Connector configuration can be found in the jboss-service.xml under the server node's conf directory. Maybe compare the remote one (if you have access to it) with your local file to confirm this (but if it's disable, there must be a reason, discuss it with the support).

And by the way, this is what I get when I run the netstat command with JBoss 4.2.3.GA started on my GNU/Linux machine (default configuration):

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