Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Outstanding Contributor.. Amishra Outstanding Contributor..
Outstanding Contributor..
185 views

java.net.SocketException: Connection reset

Hello there,

We have a report that is throwing java.net.SocketException: Connection reset error. In the jsp code we added utl_i18n.unescape_reference on one of the columns so that we can escape special characters like "&",">","<" etc. 

select utl_i18n.unescape_reference(RTrim(xmlagg(xmlelement(e,kte.visible_parameter1|| ' - ' || visible_parameter41||'%'||'; ')).EXTRACT('//text()'),'; ')) from ......

This doesnt look to be report timeout issue as we increased it and report is still failing. 

 

Running report/web/knta/rpt/Report.jsp Posting report request tohttp://yyy.yy.yyy.yy:8082/itg/servlet/RunJspReport Post data= 'REPORT_JSP=%2Fweb%2Fknta%2Frpt%2FReport.jsp&OUT_BASEFILE=rep_56643&USER_ID=3333&REPORT_ID=55887&SUBMISSION_LANGUAGE=AMERICAN&KEYID=55447&KEY=2580716' Writing report fileD:\PPM\reports\rep_56643.html Error running report. Connection reset

java.net.SocketException: Connection reset at com.kintana.rpt.server.KSCRunJspReportCommand.logError(KSCRunJspReportCommand.java:310) at com.kintana.rpt.server.KSCRunJspReportCommand.execute(KSCRunJspReportCommand.java:254) at com.kintana.core.server.execution.CommandRunner.run(CommandRunner.java:120) at java.lang.Thread.run(Thread.java:745)
(Cleaning up any partial report output...)
HTTP response:200 - OK

 Any ideas? 

Thank you in advance. 

Regards,
Ajay Mishra
0 Likes
6 Replies
Aurobinda Super Contributor.
Super Contributor.

Re: java.net.SocketException: Connection reset

Hi Ajay,
Hope you are doing well. Although have not come across this issue earlier, could you please let us know more details about the issue as below:
1. Could you please check, if the report is working after removing utl_i18n.unescape_reference ? If yes, then we need to troubleshoot on this or we need to find out other way around to meet this business requirement.
If no, please check until when it was running successfully and what are the changes made post that. Then we need to dig down to find out, which part of the code is creating this problem.
2. As it's related to Java, we need to understand, if any recent java upgrade happen which might be one of the reasons.
3. Also need to know, are all the reports in system failing, or only this report or any other configured similar way also that is failing.
4. Is the same report failing in all your instances or only this issue is related to particular instance.
5. Which version of PPM are you using and is it related to your recent upgrade?
6. Also, please revisit the JSP file again and verify all the connections tags and other tags are properly closed.

If all good, could please stop ppm services , run kJSPCompiler and then start services and then try to submit the report again.
You may also run the JSPCompiler with -x to get more detail of compilation log, which might help you to troubleshoot/fix the issue :)
Outstanding Contributor.. Amishra Outstanding Contributor..
Outstanding Contributor..

Re: java.net.SocketException: Connection reset

Thank you Aurobinda - I will try these and will let you know.
Regards,
Ajay Mishra
0 Likes
Aurobinda Super Contributor.
Super Contributor.

Re: java.net.SocketException: Connection reset

Hi Ajay,

Also, could you please check if you have the below simillar tagging in your jsp file. 

<%-- -- report initialization: load bundle, get JDBC connection, Load report parameters -- --%>
<rpt:initReport bundleName="KEXP_Resources" />
<rpt:getJDBCConnection />
<rpt:loadReportParameters />

<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=<%=SessionData.getI18NEncoding()%>">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="<%= new java.util.Date().toString() %>">
<title><c:out value="${P_REPORT_TITLE}" /> [<rpt:resource name="KINTANA.TXT" />]</title>

<%-- -- css style sheet -- --%>

 

Also, while fetching the data, we had used below way. Hope this helps you.

 

---------------------------------------------

SELECT knta_i18n_format_utils.Format_Date_By_Pattern(kp.start_date,knta_i18n_format_utils.Get_User_Date_Pattern(3, <c:out value="${USER_ID}" />, 10))
|| ' - ' ||
knta_i18n_format_utils.Format_Date_By_Pattern(kp.end_date,knta_i18n_format_utils.Get_User_Date_Pattern(3, <c:out value="${USER_ID}" />, 10)) users_period_name
FROM ktmg_periods kp where kp.period_id = :period_id

-----------------------------------------------------------

Thanks

Auro

0 Likes
Outstanding Contributor.. Amishra Outstanding Contributor..
Outstanding Contributor..

Re: java.net.SocketException: Connection reset

Hi Auro, 

Yes we have the exact same setup here. 

<%@ page import="com.kintana.core.server.AppException" %>
<%@ page import="com.kintana.core.db.DBConstants" %>
<%@ page import="com.kintana.core.web.util.URLHelper" %>
<%@ page import="com.kintana.core.web.util.*" %>
<%-- -- report initialization: load bundle, get JDBC connection, Load report parameters -- --%>

<%@ page import="com.kintana.core.web.util.SessionData" %>
<%@ taglib uri="/Kintanareporttld" prefix="rpt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<%-- -- report initialization: load bundle, get JDBC connection, Load report parameters -- --%>
<rpt:initReport bundleName="KEXP_Resources" />
<rpt:getJDBCConnection />
<rpt:loadReportParameters />

<%
response.setContentType("application/vnd.ms-excel");
response.addHeader("content-disposition", "inline; filename=ERMasterReport.xls");
%>

<%-- Defining report header --%>

<%-- -- report initialization: load bundle, get JDBC connection, Load report parameters -- --%>

<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=<%=SessionData.getI18NEncoding()%>">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="<%= new java.util.Date().toString() %>">
<title><c:out value="${P_REPORT_TITLE}" /></title>

<%-- -- css style sheet -- --%>


While fetching report as well; it looks the same.

 

<rpt:openStatement var="requestQuery" >
 SELECT utl_i18n.unescape_reference(RTrim(xmlagg(xmlelement(e,kte.visible_parameter1|| ' - ' || visible_parameter2||'%'||'; ')).EXTRACT('//text()'),'; ')) C
FROM kcrt_table_entries kte ... .....

ending with 
<rpt:runStatement stmtName="requestQuery" var="requestResult" />

Finally towards the end closing the connections.

<rpt:returnJDBCConnection />

 

Regards,
Ajay Mishra
0 Likes
Aurobinda Super Contributor.
Super Contributor.

Re: java.net.SocketException: Connection reset

Hi Ajay,

Thanks for sharing the snippet. This looks ok to me as well. I think, there is some issue with the data (to fetch that, we might need to slightly tweek our query). Could you please try to run the report only for a single request copying the below code snippet and only replacing the request_id.

SELECT UTL_I18N.UNESCAPE_REFERENCE(RTrim(xmlagg(xmlelement(e,kte.visible_parameter1|| ' - ' || visible_parameter2||'%'||'; ')).EXTRACT('//text()'),'; ')) c
FROM kcrt_table_entries kte
WHERE REQUEST_ID = 32500
;

Also, if it still does not work, could you please share the output of the same query after executing in SQL Developer/Toad.

 

 

0 Likes
Outstanding Contributor.. Amishra Outstanding Contributor..
Outstanding Contributor..

Re: java.net.SocketException: Connection reset

Certainly will do that Auro - Thanks for your help; truly appreciated. 

 

 

Regards,
Ajay Mishra
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.