Cannot Display Image From Weblogic 10.3.5 (Doc ID 1371366.1)

Last updated on JUNE 09, 2016

Applies to:

Oracle Weblogic Server - Version 10.3 to 10.3.5
Information in this document applies to any platform.

Symptoms

On WLS 10.3.5 - Custom application that loads images from a local file system is deployed to a managed server running on port 7002 Accessing this application fails to load the images associated to the request.

Application was originally deployed in 10g in an OC4J container where it worked now deployed in 10.3.5 in a Managed server fails.



Below is the image.jsp
<%@page import = "java.io.*,
javax.servlet.*"%>
<%

response.setContentType("image/gif");

File imgFile = new File("C:/image/plant.gif");
//response.setContentLength((int)imgFile.length());
FileInputStream fis = new FileInputStream(imgFile);

OutputStream o = response.getOutputStream();

byte[] buf = new byte[1024];
int count = 0;
while ((count = fis.read(buf)) >= 0) {
o.write(buf, 0, count);
}
fis.close();
o.close();
response.flushBuffer();

System.out.println("Finish retrieval of page.");
%>


Please refer to attached sample that does not work on Weblogic Server 10.3.5.


-->Deploy the attached webapp on WLS 10.3.5 Server
-->Make sure to have an image file on your local directory-something like C:/image/plant.gif
-->Try to access the image.jsp to notice the issue

Cause

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms