How to solve java.net.SocketException: Software caused connection abort: socket write error exception -
i have error
severe: severe: servlet.service() servlet [jsp] in context path [/firstjsp] threw exception [clientabortexception: java.net.socketexception: software caused connection abort: socket write error] root cause
when run application .
the error messages are
java.net.socketexception: software caused connection abort: socket write error @ java.net.socketoutputstream.socketwrite0(native method) @ java.net.socketoutputstream.socketwrite(unknown source) @ java.net.socketoutputstream.write(unknown source) @ org.apache.coyote.http11.internaloutputbuffer.realwritebytes(internaloutputbuffer.java:216) @ org.apache.tomcat.util.buf.bytechunk.flushbuffer(bytechunk.java:460) @ org.apache.tomcat.util.buf.bytechunk.append(bytechunk.java:368) @ org.apache.coyote.http11.internaloutputbuffer$outputstreamoutputbuffer.dowrite(internaloutputbuffer.java:241) @ org.apache.coyote.http11.filters.chunkedoutputfilter.dowrite(chunkedoutputfilter.java:119) @ org.apache.coyote.http11.abstractoutputbuffer.dowrite(abstractoutputbuffer.java:192) @ org.apache.coyote.response.dowrite(response.java:533) @ org.apache.catalina.connector.outputbuffer.realwritebytes(outputbuffer.java:373) @ org.apache.tomcat.util.buf.bytechunk.append(bytechunk.java:373) @ org.apache.catalina.connector.outputbuffer.writebytes(outputbuffer.java:403) @ org.apache.catalina.connector.outputbuffer.write(outputbuffer.java:391) @ org.apache.catalina.connector.coyoteoutputstream.write(coyoteoutputstream.java:91) @ org.apache.catalina.connector.coyoteoutputstream.write(coyoteoutputstream.java:84) @ chartdirector.getsessionimage.a(sourcefile:90) @ chartdirector.webchartviewer.streamchart(sourcefile:301) @ org.apache.jsp.automaticalarm_jsp._jspservice(automaticalarm_jsp.java:157) @ org.apache.jasper.runtime.httpjspbase.service(httpjspbase.java:70) @ javax.servlet.http.httpservlet.service(httpservlet.java:722) @ org.apache.jasper.servlet.jspservletwrapper.service(jspservletwrapper.java:432) @ org.apache.jasper.servlet.jspservlet.servicejspfile(jspservlet.java:390) @ org.apache.jasper.servlet.jspservlet.service(jspservlet.java:334) @ javax.servlet.http.httpservlet.service(httpservlet.java:722) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:305) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210) @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:224) @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:169) @ org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:472) @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:168) @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:98) @ org.apache.catalina.valves.accesslogvalve.invoke(accesslogvalve.java:928) @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:118) @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:407) @ org.apache.coyote.http11.abstracthttp11processor.process(abstracthttp11processor.java:987) @ org.apache.coyote.abstractprotocol$abstractconnectionhandler.process(abstractprotocol.java:539) @ org.apache.tomcat.util.net.jioendpoint$socketprocessor.run(jioendpoint.java:298) @ java.util.concurrent.threadpoolexecutor$worker.runtask(unknown source) @ java.util.concurrent.threadpoolexecutor$worker.run(unknown source) @ java.lang.thread.run(unknown source)
my java code is:
public connection getconnection() { string connectionurl = "jdbc:sqlserver://localhost:49184;databasename=alarm;user=sa;password=controls@#$%"; try { class.forname("com.microsoft.sqlserver.jdbc.sqlserverdriver"); con = drivermanager.getconnection(connectionurl); } catch (exception e) { system.out.println(" \nexception in getconnection() " + e); } return con; } public void closeconnection(statement stmt, resultset rs, connection con) { try { if (stmt != null) { stmt.close(); } if (rs != null) { rs.close(); } if (con != null) { con.close(); } } catch (exception e) { system.out.println("\nexception in closeconnection( statement stmt, resultset rs, connection con) " + e); } } public int get_count1() { { try { con = getconnection(); stmt = con.createstatement(); string sql = " select system_name, count(distinct arrival_time) c i2alarmlog ack_status = 0 , direction='came' , arrival_time between '2014-01-22 17:56:41.000' , '2014-01-24 17:56:41.000' , system_name in('i2-tciu database','i2-vcs logging','indus1 vacuum','indus2 tciu','indus2 vacuum','septum_sip2','tl3 vacuum') group system_name union select 'totalsum' totalsum,sum(s.c) totalvalue (select system_name, count(distinct arrival_time) c i2alarmlog ack_status = 0 , direction='came' , arrival_time between '2014-01-22 17:56:41.000' , '2014-01-24 17:56:41.000' , system_name in('i2-tciu database','i2-vcs logging','indus1 vacuum','indus2 tciu','indus2 vacuum','septum_sip2','tl3 vacuum') group system_name ) s"; stmt.executequery(sql); rs = stmt.getresultset(); while (rs.next()) { t1 = (rs.getint(2)); } } catch (exception e) { system.out.println("\nexception " + e); } { closeconnection(stmt, rs, con); } } system.out.println(t1); return t1; }
how resolve it. have used jsp display.i have used chartdirector displaying charts as:-
<% @page import = "chartdirector.*" %> <% // data line chart double[] data1 = ab.total(); // labels line chart string[] labels = { "vacuum", "rss", "mps", "rf", "blfe", "orbit", "lcw", "tcs", "interlock", "bds", "msis", "microton", "power conditioner", "database" }; xychart c = new xychart(1000, 650); c.setplotarea(90, 60, 750, 430); c.xaxis().setlabels(labels); c.xaxis().settitle("system_name", "arial bold", 12); c.xaxis().setlabelstyle("arial bold", 10).setfontangle(45); c.addbarlayer3(data1).setbordercolor(chart.transparent, chart.softlighting(chart.left)); barlayer layer = c.addbarlayer2(chart.stack, 10); layer.setaggregatelabelstyle(); layer.adddataset(data1, 10, "arial bold italic"); layer.setbordercolor(chart.transparent, chart.softlighting(chart.top)); c.xaxis().setcolors(chart.transparent); c.yaxis().setcolors(chart.transparent); c.yaxis().settitle("alarm_count", "arial bold", 12); c.yaxis().setlabelstyle("arial bold", 10); c.yaxis().setlinearscale(0.0, ab.max_count()); c.yaxis().setlabelstep(2); c.yaxis().setmargin(7); c.xaxis().setwidth(2); c.yaxis().setwidth(2); try { // stream chart browser , terminate out.clear(); if (webchartviewer.streamchart(response, c.makechart2(chart.png))) return; } catch (illegalstateexception e) { // old servers may not support streaming. forced redirect // browser use traditional method. response.sendredirect(response.encoderedirecturl("getchart.jsp?" + c.makesession(request, "chart"))); return; } %>
moreover,the chart updated randomly.
Comments
Post a Comment