JBoss 4.2.3GA 上基于 HTTP 的 JNDI
我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
jndi.properties
中的差异是否是故意的(在java.naming.factory.url.pkgs
属性级别)?另外,您可以运行 netstat -a | 吗? grep 4446 在两台机器上运行并用输出更新问题?
更新:如果
netstat
命令没有为端口 4446 返回任何内容(JBoss 正在运行,对吧?),则 JBoss RemotingConnector
UnifiedInvoker 服务很可能没有在您的 eApps 主机上侦听,因此连接暂停。也许此服务已被 eApps 禁用,您应该联系支持并与他们讨论。为了以防万一,可以在服务器节点的
conf
目录下的jboss-service.xml
中找到示例Connector
配置。也许将远程文件(如果您有权访问它)与本地文件进行比较以确认这一点(但如果它被禁用,则必须有一个原因,请与支持人员讨论)。顺便说一句,这是我在 GNU/Linux 机器上启动 JBoss 4.2.3.GA(默认配置)时运行
netstat
命令时得到的结果:Are the differences in the
jndi.properties
intentional (at thejava.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 RemotingConnector
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 thejboss-service.xml
under the server node'sconf
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):