JBoss UnknownHostException当不同的网络 [英] JBoss UnknownHostException when on different network

查看:131
本文介绍了JBoss UnknownHostException当不同的网络的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JBoss在网络上工作有一些问题。作为一个快速的概述,我们有一个开发网络(我将称为DEV)和一个客户端网络(说..客户端!)。这些通过防火墙连接。在开发网络中,服务器称为192.168.100.50,客户端网络称为10.0.100.50。两个网络中的DNS通过DNS解析相关的IP(sqlserver.dev.net)。



sqlserver提供2个服务,一个通过.NET Web Service,另一个通过JBoss 。在DEV网络上运行客户端时,两个服务都可以正常工作。当在CLIENT网络上,只有.NET服务有效。



当尝试在以下代码中执行ContextLookup时,JBoss客户端会抛出UnknownHostException:

 属性p = new Properties(); 
p.put(java.naming.factory.initial,org.jnp.interfaces.NamingContextFactory);
p.put(java.naming.factory.url.pkgs,= org.jboss.naming:org.jboss.jnp.interfaces);
p.put(java.naming.provider.url,sqlserver.dev.net:1199);

try {
Context c = new InitialContext(p);
cm =(ServiceRemote)c.lookup(Service.RemoteJNDIName);
} catch(NamingException e){
e.printStackTrace();
抛出新的RuntimeException(e);
}

异常是:



< blockquote>

根异常是java.rmi.UnknownHostException:未知主机:SQLserver


我可以确认问题是客户端尝试连接到没有域名的'sqlserver'。这已经通过将sqlserver添加到客户端的主机文件中进行了测试,它的工作正常。另外,SQLserver的拼写很有趣,因为Windows主机报告的是主机名,而不是如何存储在DNS中。我最好的猜测是,一旦客户端进行初始连接,JBoss会通知客户端将来连接到SQLserver,客户端无法解析。



我已经尝试将以下系统属性设置为sqlserver的FQDN:


jgroups.bind_addr

bind。地址

java.rmi.server.hostname


有没有人有任何想法?

解决方案

好的,事实证明,启动时绑定到0.0.0.0实际上会弄乱它的自我识别。绑定到sqlserver.dev.net(run.bat -b sqlserver.dev.net)修复它。


I'm having a bit of a problem with getting JBoss working across networks. As a quick overview, we have a development network (which I'll call DEV), and a client network (say.. CLIENT!). These are connected via a firewall. In the Dev network, the server is known as 192.168.100.50, on the client network it's known as 10.0.100.50. DNS in both networks resolve the relevant IP by DNS (sqlserver.dev.net).

sqlserver provides 2 services, one via a .NET Web Service, the other by JBoss. When running the client on the DEV network, both services work fine. When on the CLIENT network, only the .NET service works.

The JBoss client throws an UnknownHostException when attempting to perform the ContextLookup in the following code:

Properties p = new Properties();
p.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
p.put("java.naming.factory.url.pkgs", "=org.jboss.naming:org.jboss.jnp.interfaces");
p.put("java.naming.provider.url", "sqlserver.dev.net:1199");

try {
  Context c = new InitialContext(p);
  cm = (ServiceRemote)c.lookup(Service.RemoteJNDIName);
} catch (NamingException e) {
  e.printStackTrace();
  throw new RuntimeException(e);
}

Exception is:

Root exception is java.rmi.UnknownHostException: Unknown host: SQLserver

I can confirm that the problem is that the client is attempting to connect to 'sqlserver' without a domain name. This has been tested by adding 'sqlserver' to the client's host file, and it works fine. Additionall, the spelling of 'SQLserver' is interesting, as this is how the Windows host reports it's hostname, not how it's stored in DNS. My best guess is that once the client makes the initial connection, JBoss tells the client to connect to 'SQLserver' in the future, which the client is unable to resolve.

I've already tried setting the following system properties to the FQDN of sqlserver:

jgroups.bind_addr
bind.address
java.rmi.server.hostname

Does anyone have any ideas?

解决方案

Ok, turns out that binding to 0.0.0.0 on startup actually messes up it's self-identification. Binding to sqlserver.dev.net (run.bat -b sqlserver.dev.net) fixed it.

这篇关于JBoss UnknownHostException当不同的网络的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆