How to disable JVM domain name resolution (hostnames)?

Asked

Viewed 323 times

4

An application is trying to access a remote EJB. Regardless of whether the configuration uses the address servidor.empresa.com.br or an IP to access the service, an error occurs:

weblogic.utils.NestedError: This address was valid earlier, but now we get: .
    at weblogic.rjvm.JVMID.address(JVMID.java:565)
    at weblogic.rjvm.RJVMManager.record(RJVMManager.java:153)
    at weblogic.rjvm.RJVMManager.findOrCreateInternal(RJVMManager.java:292)
    at weblogic.rjvm.RJVMManager.findOrCreateRemote(RJVMManager.java:139)
    at weblogic.rjvm.ConnectionManagerServer.handleIdentifyResponse(ConnectionManager
    Truncated. see log file for complete stacktrace
Caused By: java.net.UnknownHostException: servidor
    at java.net.InetAddress.getAllByName0(InetAddress.java:1158)
    at java.net.InetAddress.getAllByName(InetAddress.java:1084)
    at java.net.InetAddress.getAllByName(InetAddress.java:1020)
    at java.net.InetAddress.getByName(InetAddress.java:970)
    at weblogic.rjvm.JVMID.address(JVMID.java:558)
    Truncated. see log file for complete stacktrace

Apparently, regardless of hostname and IP the JVM is making a query to DNS and, for some reason, is ignoring the .empresa.com.br, using only the server name.

Is there any way to tell the JVM "forget DNS, just use IP!"?

Remarks:

  • An alternative proposed in some forums is to edit hosts (windows environment) pointing the servidor (without the .empresa.com.br for its IP, but it seems more like a gambiarra
  • JDK version: 1.6
  • Version of Weblogic: 10
  • By chance the operating system involved is Linux?

  • 1

    By description, the application seems to be bug, trying to query with the wrong address (ignoring .empresa.com.br). Wouldn’t it be better to fix this problem?

  • @Marcoszolnowski Windows XP (development machine).

  • @Elias It is not an application bug, it works in other environments and, as I explained, even passing the IP does not work. The address is passed directly to the InitialContext thus: prop.put( Context.PROVIDER_URL , providerURL ); InitialContext ic = new InitialContext( prop );

  • At the moment, the closest I see, would be to try some modification with DNS_URL. But I don’t believe that’s it.

2 answers

2

Check two things:

Adds in hosts host IP and name, and disable verifcation server name.

If you are a domain server put on the server: Servername->Serverstart->Arguments -Dweblogic.security.SSL.ignoreHostnameVerification=true

If it is Adminserver, it has to be in the Setdomainenv.sh script: JAVA_OPTIONS="Dweblogic.security.SSL.ignoreHostnameVerification=true" Export JAVA_OPTIONS

I hope I’ve helped ;)

1


Searching for the error message:

This address was Valid earlier, but now we get ...

It is noticeable that it only occurs with those who use Weblogic in some type of specific environment, usually corporate with firewalls and proxies.

There are not many results for the error and none of which exist point to a specific cause or solution, except one workaround which is to add the server name without your domain to the operating system’s "hosts" files:

  • Windows: %SystemRoot%\system32\drivers\etc\hosts
  • Other: /etc/drivers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.