My Oracle Support Banner

OC4J Caches Resolved DNS IP Addresses Indefinitely (Doc ID 727942.1)

Last updated on AUGUST 06, 2018

Applies to:

Oracle Fusion Middleware - Version 10.1.3.1.0 to 10.1.3.3.0 [Release AS10gR3]
Information in this document applies to any platform.
This problem can occur on any platform.

Symptoms

Domain names are being referenced in java code, for example,  mail.ourdomain.com
If the IP address of this changes, the old value is 'cached' by OC4J.
This means the program fails to contact the mail server or whatever other service is being requested.

The following program demonstrates the issue, presuming you have the ability to change the IP address of the named resource :



import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.*;
import javax.servlet.http.*;
import java.net.InetAddress;

public class Servlet1 extends HttpServlet {
private static final String CONTENT_TYPE = "text/html; charset=windows-1252";

public static int mycounter = 0;
public void init(ServletConfig config) throws ServletException {
super.init(config);
}

public void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
out.println("<html>");
out.print("google is: " + InetAddress.getByName("your-resource.com") + "<br>");
out.print("counter is: " + mycounter++ + "<br>");
out.println("</html>");
out.close();
}
}



Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.