Jump to content

Environment display problem(UNIX)


HBK32

Recommended Posts

Hi Everyone,

 

I have developed JSP file which generates output in HTML format on web.

Application server is WebSphere.

its working fine in windows envioronment but when I am trying to run it on UNIX machine its giving following error.

 

 

SRVE0068E: Could not invoke the service() method on servlet /Process.jsp. Exception thrown : javax.servlet.ServletException: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.

 

Here I am also attaching JSP(Process.JSP) file which generates report output in HTML format.

 

Basically Process.JSP called by index2.jsp.

Means index2.jsp is calling Process.JSP.

 

I am attaching both files with this post.

 

Following is the code for PROCESS.JSP.

--------Code(Process.JSP) starts here-----------------

<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>

<jsp:useBean id="db" class="ConnDB.DB" scope="request" >

<jsp:setProperty name="db" property="*" />

</jsp:useBean>

 

<html>

<head>

<title>Process</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

 

<body bgcolor="#F5F7F0">

 

<%@ page import="ConnDB.*"%>

<%@ page import="java.awt.*"%>

 

<%@ page import="java.sql.Connection"%>

<%@ page import="net.sf.jasperreports.engine.*" %>

<%@ page import="net.sf.jasperreports.engine.util.*" %>

<%@ page import="net.sf.jasperreports.engine.export.*" %>

 

<%@ page import="com.lowagie.text.pdf.PdfWriter" %>

 

<%//@ page import="javax.print.attribute.*"%>

<%//@ page import="javax.print.attribute.standard.*" %>

 

<%@ page import="java.util.*" %>

<%@ page import="java.io.*" %>

<%@ page import="java.io.OutputStream" %>

 

 

<%

String IValue1 = request.getParameter("nameLine1");

Map parameters = new HashMap();

parameters.put("InputValue1",IValue1);

 

File reportFile = new File(application.getRealPath("/WEB-INF/Jasper/SampleDemo.jasper"));

 

JasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile.getPath());

 

//Get Connection object

Connection conn=(new DB()).connect("Weblogic","svrabm");

 

//Filling Report

 

JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,parameters,conn);

// Create Destination File

File destFile = new File(reportFile.getParent(), jasperPrint.getName() + ".html");

String Destination = destFile.toString();

 

//code For HTML View....

JRHtmlExporter exporter = new JRHtmlExporter();

StringBuffer sbuffer = new StringBuffer();

OutputStream out1=null;

 

Hashtable imagesMap = new Hashtable();

session.setAttribute("IMAGES_MAP", imagesMap);

 

 

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);

exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, out1);

exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, out);

exporter.setParameter(JRExporterParameter.OUTPUT_FILE, destFile);

 

exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, Destination);

 

// exporter.setParameter(JRHtmlExporterParameter.IS_ENCRYPTED, Boolean.TRUE);

//exporter.setParameter(JRHtmlExporterParameter.IS_128_BIT_KEY, Boolean.TRUE);

 

exporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP, imagesMap);

exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "image.jsp?image=");

 

exporter.exportReport();

 

%>

<script language="JavaScript">

window.location("WEB-INF/Jasper/SampleDemo.html");

</script>

</body>

</html>

 

--------Code(Process.JSP) ends here-----------------

I will really appreciate your response.

 

Please reply me ASAP.

 

Thanks in advance.

 

Post edited by: badrishpandya, at: 2008/06/10 03:42

Post edited by: badrishpandya, at: 2008/06/10 03:45

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...