IllegalStateException: getOutputStream() has already been called
Hi guys,
I am writing JSP to retrieve data from database and export to the user as csv or zip file. It has to be binary. I would like to a download dialog to show up and allow users to choose where to save the exported file.
Funcitonally, it works fine althrough I get an error page saying nothing to display. But it always complains that IllegalStateException: getOutputStream() has already been called for this session. I have done much research and testing, but....in vain.
Hope somebody could help me with this. so frustrated that I am about to explode.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="application/octet-stream">
<title>Load Page</title>
</head>
<body >
<% OutputStream outRes = response.getOutputStream( ); %><%@page contentType="application/octet-stream"%><%
%><%@page pageEncoding="UTF-8" import="java.sql.*,java.io.*,java.util.*,java.util.zip.*,java.math.BigDecimal;"%><%
%><%
try {
Class.forName(ResourceBundle.getBundle("map").getString("driver"));
} catch (ClassNotFoundException ex) {
//ex.printStackTrace();
return;
String EXPORT_DIR = ResourceBundle.getBundle("map").getString("SUBMITTAL_EXPORT_DIR");
String EXPORT_NAME = ResourceBundle.getBundle("map").getString("SUBMITTAL_NAME");
String EXPORT_ZIP_NAME = ResourceBundle.getBundle("map").getString("SUBMITTAL_ZIP_NAME");
String sqlQuery = "SELECT EMP_ID, EMP_NAME FROM EMP";
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
OutputStream expStream = null;
boolean success = false;
try {
//out.println("<p>Connecting to the source database ...");
// establish database connection
conn = DriverManager.getConnection(
ResourceBundle.getBundle("map").getString("sqlurl"),
ResourceBundle.getBundle("map").getString("ORACLE_DBUSER"),
ResourceBundle.getBundle("map").getString("ORACLE_DBPASSWORD") );
stmt = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
rs = stmt.executeQuery(sqlQuery);
//out.println("Done</p>");
// open a file to write
File exportFile = new File(EXPORT_DIR + File.separatorChar + EXPORT_NAME);
if (exportFile.exists()) exportFile.delete();
exportFile.createNewFile();
expStream = new BufferedOutputStream(new FileOutputStream(exportFile));
// iterate all records to save them to the file
//out.print("<p>Exporting the table data ...");
while(rs.next()) {
String recordString = "";
ResultSetMetaData metaData = rs.getMetaData() ;
int colCount = metaData.getColumnCount();
for(int i=1; i<=colCount; i++) {
int colType = metaData.getColumnType(i);
switch(colType) {
case Types.CHAR: {
String sValue = rs.getString(i);
if (rs.wasNull())
recordString += ("'',");
else
recordString += ("'"+ sValue + "',");
break;
case Types.VARCHAR: {
String sValue = rs.getString(i);
if (rs.wasNull())
recordString += ("'',");
else
recordString += ("'"+ sValue + "',");
break;
case Types.FLOAT: {
float fValue = rs.getFloat(i);
if (rs.wasNull())
recordString += (",");
else
recordString += (fValue + ",");
break;
case Types.DOUBLE: {
double dbValue = rs.getDouble(i);
if (rs.wasNull())
recordString += (",");
else
recordString += (dbValue + ",");
break;
case Types.INTEGER: {
int iValue = rs.getInt(i);
if (rs.wasNull())
recordString += (",");
else
recordString += (iValue + ",");
break;
case Types.NUMERIC: {
BigDecimal bdValue = rs.getBigDecimal(i);
if (rs.wasNull())
recordString += (",");
else
recordString += (bdValue + ",");
break;
default:
out.println("<p><font color=#ff0000> Unidentified Column Type "
+ metaData.getColumnTypeName(i) + "</font></p>"); */
success = false;
return;
recordString = recordString.substring(0, recordString.length()-1);
expStream.write(recordString.getBytes());
expStream.write((new String("\n")).getBytes());
expStream.flush();
//out.println("Done</p>");
//out.println("<p>Data have been exported to " + filepath + "</p>");
success = true;
} catch (SQLException ex) {
//out.println(ex.getStackTrace());
} catch (IOException ex) {
//out.println(ex.getStackTrace());
} finally {
if (expStream != null) {
try {
expStream.close();
} catch (IOException ex) {
// out.println(ex.getStackTrace());
if (rs != null) {
try {
rs.close();
} catch(SQLException ex) {
//out.println(ex.getStackTrace());
if (stmt != null) {
try {
stmt.close();
} catch(SQLException ex) {
// out.println(ex.getStackTrace());
if(conn != null) {
try {
conn.close();
} catch(SQLException ex) {
// out.println(ex.getStackTrace());
if (!success) return;
* compress the exported CSV file if necessary
int DATA_BLOCK_SIZE = 1024;
if (request.getParameter("zip")!=null && request.getParameter("zip").equalsIgnoreCase("true")) {
success = false;
BufferedInputStream sourceStream = null;
ZipOutputStream targetStream = null;
try {
File zipFile = new File(EXPORT_DIR + File.separatorChar + EXPORT_ZIP_NAME);
if (zipFile.exists()) zipFile.delete();
zipFile.createNewFile();
FileOutputStream fos = new FileOutputStream ( zipFile );
targetStream = new ZipOutputStream ( fos );
targetStream.setMethod ( ZipOutputStream.DEFLATED );
targetStream.setLevel ( 9 );
* Now that the target zip output stream is created, open the source data file.
FileInputStream fis = new FileInputStream ( EXPORT_DIR + File.separatorChar + EXPORT_NAME );
sourceStream = new BufferedInputStream ( fis );
/* Need to create a zip entry for each data file that is read. */
ZipEntry theEntry = new ZipEntry ( EXPORT_DIR + File.separatorChar + EXPORT_NAME );
* Before writing information to the zip output stream, put the zip entry object
targetStream.putNextEntry ( theEntry );
/* Add comment to zip archive. */
//targetStream.setComment( "comment" );
/* Read the source file and write the data. */
byte[] buf = new byte[DATA_BLOCK_SIZE];
int len;
while ( ( len = sourceStream.read ( buf, 0, DATA_BLOCK_SIZE ) ) >= 0 ) {
targetStream.write ( buf, 0, len );
* The ZipEntry object is updated with the compressed file size,
* uncompressed file size and other file related information when closed.
targetStream.closeEntry ();
targetStream.flush ();
success = true;
} catch ( FileNotFoundException e ) {
//e.printStackTrace ();
} catch ( IOException e ) {
//e.printStackTrace ();
} finally {
try {
if (sourceStream != null)
sourceStream.close ();
if (targetStream != null)
targetStream.close ();
} catch(IOException ex) {
//ex.printStackTrace();
if (!success) return;
* prompt the user to download the file
//response.setContentType("text/plain");
//response.setContentType( "application/octet-stream" );
InputStream inStream = null;
//OutputStream outRes = null;
try {
if (request.getParameter("zip")!=null && request.getParameter("zip").equalsIgnoreCase("true")) {
response.setHeader("Content-Disposition", "attachment;filename=" + EXPORT_ZIP_NAME);
inStream = new BufferedInputStream(new FileInputStream(EXPORT_DIR + File.separatorChar + EXPORT_ZIP_NAME));
else {
response.setHeader("Content-Disposition", "attachment;filename=" + EXPORT_NAME);
inStream = new BufferedInputStream(new FileInputStream(EXPORT_DIR + File.separatorChar + EXPORT_NAME));
out.clearBuffer();
//outRes = response.getOutputStream( );
byte[] buf = new byte[4 * DATA_BLOCK_SIZE]; // 4K buffer
int bytesRead;
while ((bytesRead = inStream.read(buf)) != -1) {
outRes.write(buf, 0, bytesRead);
outRes.flush();
int byteBuf;
while ( (byteBuf = inStream.read()) != -1 ) {
out.write(byteBuf);
out.flush();
} catch (IOException ex) {
//ex.printStackTrace();
finally {
try {
if (inStream != null)
inStream.close();
if (outRes != null)
outRes.close();
} catch(IOException ex) {
//ex.printStackTrace();
%>
</body>
</html>
So I went to the API: http://java.sun.com/j2ee/1.4/docs/api/
Looked up ServletResponse, then looked for the getOutputStream() method. It says:
"Throws:
IllegalStateException - if the getWriter method has been called on this response"
You can call only one of the getWriter or getOutputStream methods, not both. You are calling both. When you use a JSP, a variable called 'out' is generated (a PrintWriter) from the the Writer you get when response.getWriter() is called. This is done before your code gets executed as one of the functions that occur when a JSP is translated to a Servlet. You then write to that out variable when you print the HTML in the JSP code.
This is best done in a Servlet, not a JSP, since there is no display and you require control over the servlet response.
Similar Messages
-
GetOutputStream() has already been called for this response
I have a problem with my servlet,
i compiled my code,it works normally but there is an error occured when it works.
The error is :
java.lang.IllegalStateException: getOutputStream() has already been called for this response
* at org.apache.catalina.connector.Response.getWriter(Response.java:607)*
* at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:196)*
* at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:125)*
* at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:118)*
* at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:179)*
* at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:116)*
* at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:76)*
* at org.apache.jsp.KaptchaExample_jsp._jspService(KaptchaExample_jsp.java:209)*
* at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)*
* at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*
* at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)*
* at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)*
* at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)*
* at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*
* at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)*
* at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)*
* at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)*
* at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)*
* at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)*
* at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)*
* at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)*
* at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)*
* at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)*
* at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)*
* at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)*
* at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)*
* at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)*
* at java.lang.Thread.run(Thread.java:534)*
here is my code :
Iterator iter = ImageIO.getImageWritersByFormatName(imageFormat);
* if( iter.hasNext() ) {*
* ImageWriter writer = (ImageWriter)iter.next();*
* ImageWriteParam iwp = writer.getDefaultWriteParam();*
* if ( imageFormat.equalsIgnoreCase("jpg") || imageFormat.equalsIgnoreCase("jpeg") ) {*
* iwp.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);*
* iwp.setCompressionQuality(imageQuality);*
* //writer.setOutput(ImageIO.createImageOutputStream(response.getWriter()));*
* IIOImage imageIO = new IIOImage(bufferedImage, null, null);*
* writer.write(null, imageIO, iwp);*
* response.flushBuffer();*
please help me,would u give me a solutions for my problem..i really appreciate if you want to give a solution.
Regards,
Dany FauziActually the stack trace indicates the the error is happening in KaptchaExample.jsp, not in a Servlet. I'm guessing that the code you've presented is in a scriptlet (i.e. inside the JSP in <% %> brackets). This is altogether the wrong place for it. JSPs are purely for generating HTML and to try and generate image responses in one is doomed to failure. Write a servlet class to generate your image file. If you want to embed a dynamically generated image in an HTML page, then you need to generate HTML which accesses the Servlet through the <img src=... tag, i.e. the browser retrieves the image data as a separate transaction.
The immediate source of the crash is that the JSP already opened the output stream in order to write HTML output, so it's too late to try and open it for the writing of image data. -
Tomcat3.3, JSP, getOutputStream() has already been called
In Tomcat 3.3a, I get an IllegalStateException....
getOutputStream() has already been called... error
when running a JSP page that renders an image.
<img src="image.jsp?image=name.gif">
I want to use JSP to keep everything JSP...and it works fine in Tomcat3.1. (actually, both Tomcat version work...
just that 3.3a gives the exception)
(Of course the servlet solution works fine in Tomcat3.3 ...which is my backup solution). The JSP code is.....
FileInputStream inputStream = new FileInputStream(path+img);
//System.out.println("inputStream.available()="+inputStream.available());
byte x[] = new byte[inputStream.available()];
inputStream.read(x);
inputStream.close();
response.setContentType("image/"+imgtype);
ServletOutputStream outs = response.getOutputStream();
outs.write(x);
outs.flush();
outs.close();
Any ideas???
PS.. I can't figure out how to change my old profile...
My proper email address is [email protected]Not sure why this doesn't work - obviously the outputStream has already been used in the JSP. You could look at the generated servlet code to determine where this occurs. Another idea is to reset the buffer before opening the stream.
Good Luck. -
ERROR: getOutputStream() has already been called for this response
<font size="2"><p align="left">I am trying to export a pdf from a jsp page using the crystal report viewer. The jsp is deployed in a .war archive on JBoss 4.0.4. The PDF comes up fine, but each time I make the request I get the error listed below from the JBOSS console. Can anyone explain what is going wrong? How do I make thie message go away?</p><p align="left"> </p><p align="left">16:33:50,966 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception</p></font><u><font size="2" color="#000080">java.lang.IllegalStateException</font></u><font size="2">: getOutputStream() has already been called for this response</font><font size="2"> <p align="left">at org.apache.catalina.connector.Response.getWriter(<u><font size="2" color="#000080">Response.java:599</font></u><font size="2">)at org.apache.catalina.connector.ResponseFacade.getWriter(</font></p></font><u><font size="2" color="#000080">ResponseFacade.java:195</font></u><font size="2">)</font><font size="2"> <p align="left">at org.apache.jasper.runtime.JspWriterImpl.initOut(<u><font size="2" color="#000080">JspWriterImpl.java:124</font></u><font size="2">)at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(</font></p></font><u><font size="2" color="#000080">JspWriterImpl.java:117</font></u><font size="2">)</font><font size="2"> <p align="left">at org.apache.jasper.runtime.PageContextImpl.release(<u><font size="2" color="#000080">PageContextImpl.java:191</font></u><font size="2">)at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(</font></p></font><u><font size="2" color="#000080">JspFactoryImpl.java:115</font></u><font size="2">)</font><font size="2"> <p align="left">at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(<u><font size="2" color="#000080">JspFactoryImpl.java:75</font></u><font size="2">)at org.apache.jsp.rptFBATAG_002dviewer_jsp._jspService(</font></p></font><u><font size="2" color="#000080">rptFBATAG_002dviewer_jsp.java:164</font></u><font size="2">)</font><font size="2"> <p align="left">at org.apache.jasper.runtime.HttpJspBase.service(<u><font size="2" color="#000080">HttpJspBase.java:97</font></u><font size="2">)at javax.servlet.http.HttpServlet.service(</font></p></font><u><font size="2" color="#000080">HttpServlet.java:810</font></u><font size="2">)</font><font size="2"> <p align="left">at org.apache.jasper.servlet.JspServletWrapper.service(<u><font size="2" color="#000080">JspServletWrapper.java:332</font></u><font size="2">)at org.apache.jasper.servlet.JspServlet.serviceJspFile(</font></p></font><u><font size="2" color="#000080">JspServlet.java:314</font></u><font size="2">)</font><font size="2"> <p align="left">at org.apache.jasper.servlet.JspServlet.service(<u><font size="2" color="#000080">JspServlet.java:264</font></u><font size="2">)at javax.servlet.http.HttpServlet.service(</font></p></font><u><font size="2" color="#000080">HttpServlet.java:810</font></u><font size="2">)</font><font size="2"> <p align="left">at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(<u><font size="2" color="#000080">ApplicationFilterChain.java:252</font></u><font size="2">)at org.apache.catalina.core.ApplicationFilterChain.doFilter(</font></p></font><u><font size="2" color="#000080">ApplicationFilterChain.java:173</font></u><font size="2">)</font><font size="2"> <p align="left">at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(<u><font size="2" color="#000080">ReplyHeaderFilter.java:96</font></u><font size="2">)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(</font></p></font><u><font size="2" color="#000080">ApplicationFilterChain.java:202</font></u><font size="2">)</font><font size="2"> <p align="left">at org.apache.catalina.core.ApplicationFilterChain.doFilter(<u><font size="2" color="#000080">ApplicationFilterChain.java:173</font></u><font size="2">)at org.apache.catalina.core.StandardWrapperValve.invoke(</font></p></font><u><font size="2" color="#000080">StandardWrapperValve.java:213</font></u><font size="2">)</font><font size="2"> <p align="left">at org.apache.catalina.core.StandardContextValve.invoke(<u><font size="2" color="#000080">StandardContextValve.java:178</font></u><font size="2">)at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(</font></p></font><u><font size="2" color="#000080">SecurityAssociationValve.java:175</font></u><font size="2">)</font><font size="2"> <p align="left">at org.jboss.web.tomcat.security.JaccContextValve.invoke(<u><font size="2" color="#000080">JaccContextValve.java:74</font></u><font size="2">)at org.apache.catalina.core.StandardHostValve.invoke(</font></p></font><u><font size="2" color="#000080">StandardHostValve.java:126</font></u><font size="2">)</font><font size="2"> <p align="left">at org.apache.catalina.valves.ErrorReportValve.invoke(<u><font size="2" color="#000080">ErrorReportValve.java:105</font></u><font size="2">)at org.apache.catalina.core.StandardEngineValve.invoke(</font></p></font><u><font size="2" color="#000080">StandardEngineValve.java:107</font></u><font size="2">)</font><font size="2"> <p align="left">at org.apache.catalina.connector.CoyoteAdapter.service(<u><font size="2" color="#000080">CoyoteAdapter.java:148</font></u><font size="2">)at org.apache.coyote.http11.Http11Processor.process(</font></p></font><u><font size="2" color="#000080">Http11Processor.java:869</font></u><font size="2">)</font><font size="2"> <p align="left">at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(<u><font size="2" color="#000080">Http11BaseProtocol.java:664</font></u><font size="2">)at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(</font></p></font><u><font size="2" color="#000080">PoolTcpEndpoint.java:527</font></u><font size="2">)</font><font size="2"> <p align="left">at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(<u><font size="2" color="#000080">MasterSlaveWorkerThread.java:112</font></u><font size="2">)<p>at java.lang.Thread.run(<u><font size="2" color="#000080">Thread.java:595</font></u><font size="2">)</font></p></font></p></font>
<p>Hi there,</p><p> This issue is the same as the one in the following thread:</p><p><u><strong><a href="/node/711">http://diamond.businessobjects.com/node/711</a> </strong></u></p><p>There are a few ideas in that thread to use as a work-around. </p><p>Regards,<br />Sean Johnson (CR4E Product Manager) </p>
-
IllegalStateException - response has already been commited
Hi all!
We are running WLS 5.1 sp7 on an NT box.
Our application consists of jsp pages with <jsp:include...>, servlets
and stateful/stateless beans. The only class that actually performs a
forward is a servlet that serves as a dispatcher. We are getting from
time to time an IllegalStateException - response has already been
commited exception. This phenomena is irregular and non reproducable.
Does anybody know if this has anything to do with a certain
configuration issue? Has anyone encountered a similar problem?
Is there a known workaround?
Any help would be highly appreciated.
Thanks,
Eran Gilboa
SHORE Technologies
You are getting the illegal state exception because somewhere between the
intercept of the request by a jsp/servlet and your
requestDispatcher.forward(request, response), a class along the way is
calling either the getInputStream() method or the getReader() method of
javax.servlet.ServletRequest. Once you call either of these methods to
read from the ServletInputStream() you may not be able to do a forward.
I am having the same problem see my post from today. I have no idea how
to get around it but I have an identical exception in wl6.0sp1 and that
is the cause and I have never seen anything like it.
Eran Gilboa wrote:
> Hi all!
> We are running WLS 5.1 sp7 on an NT box.
> Our application consists of jsp pages with <jsp:include...>, servlets
> and stateful/stateless beans. The only class that actually performs a
> forward is a servlet that serves as a dispatcher. We are getting from
> time to time an IllegalStateException - response has already been
> commited exception. This phenomena is irregular and non reproducable.
> Does anybody know if this has anything to do with a certain
> configuration issue? Has anyone encountered a similar problem?
> Is there a known workaround?
>
> Any help would be highly appreciated.
>
> Thanks,
>
> Eran Gilboa
> SHORE Technologies
-
HELP: java.lang.IllegalStateException: Response has already been committed
I have a little problem.
I'm trying to draw a graph is JSP. And I did it. I'm my computer works fine with no problems. But I have a server and when I try to run the program there it appears this error message.
My computer :
Pentium 4 1.6 GHz
O/S : Win2k
Apache 3.3.1
Tomcat 1.1.1.1
JDK 1.3.1.01
Oracle 9.0
And the server :
HP L-2000 Class Server
O/S : Unix
Apache 3.3.1
Tomcat 1.1.1.1
JDK 1.3.0.01
Oracle 9.0
And the error message is :
Error: 500
Location: /kmcp/sttssrch/Merchant/mstat-01-coupon-graph.jsp
Internal Servlet Error:
java.lang.IllegalStateException: Response has already been committed
at org.apache.tomcat.core.HttpServletResponseFacade.sendError
(HttpServletResponseFacade.java:157)
at org.apache.jasper.runtime.JspServlet.unknownException
(JspServlet.java:299)
at org.apache.jasper.runtime.JspServlet.service
(JspServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.handleRequest
(ServletWrapper.java:503)
at org.apache.tomcat.core.ContextManager.service
(ContextManager.java:559)
at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnect
ion(Ajp12ConnectionHandler.java:156)
at org.apache.tomcat.service.TcpConnectionThread.run
(SimpleTcpEndpoint.java:338)
at java.lang.Thread.run(Unknown Source)
And the library I use are :
import="java.awt.*, java.awt.image.*, com.sun.image.codec.jpeg.*, java.util.*, kmcp.*, java.sql.*,
java.text.*"
And when I declare a graph I use this command :
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics g = image.getGraphics();
Can anyone tell me what kind of problem and where and how can I solve it?
Thanks.
[email protected] ( is my e-mail address )Can anyone tell me what kind of problem and where and
how can I solve it?
Thanks.The most likely cause is that you are forwarding to or from another JSP or servlet after already sending output to the client. -
Java.lang.IllegalStateException: Response has already been committed
We got this error message attached to the downloaded file after calling FileDownloadRenderer. Does any one know what this means? This error prevents the PDF file to be opened by the reader but it works fine if the file type is zip.
Thanks,
--Sining fangHi Gabrielle,
Here is the stack dump. By the way, the FileDownloadRenderer() was called from an event handler, not from the pageBroker.
Thanks,
--Sining
<PRE>java.lang.IllegalStateException: Response is already committed!
<br> void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.EvermindHttpServletResponse.setContentType(java.lang.String)
<br> EvermindHttpServletResponse.java:1027
<br> void oracle.cabo.ui.ServletRenderingContext.prepareResponse(java.lang.String, boolean)
<br> void oracle.cabo.servlet.ui.UINodePageRenderer.renderPage(oracle.cabo.servlet.BajaContext, oracle.cabo.servlet.Page)
<br> void oracle.cabo.servlet.AbstractPageBroker.renderPage(oracle.cabo.servlet.BajaContext, oracle.cabo.servlet.Page)
<br> oracle.cabo.servlet.Page oracle.cabo.servlet.PageBrokerHandler.handleRequest(oracle.cabo.servlet.BajaContext)
<br> void oracle.cabo.servlet.UIXServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
<br> void oracle.cabo.servlet.UIXServlet.doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
<br> void javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
<br> HttpServlet.java:760
<br> void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
<br> HttpServlet.java:853
<br> void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
<br> ServletRequestDispatcher.java:721
<br> void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(javax.servlet.ServletRequest, javax.servlet.http.HttpServletResponse)
<br> ServletRequestDispatcher.java:306
<br> boolean com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.ApplicationServerThread, com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.EvermindHttpServletRequest, com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.EvermindHttpServletResponse, java.io.InputStream, java.io.OutputStream, boolean)
<br> HttpRequestHandler.java:767
<br> void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(java.lang.Thread)
<br> HttpRequestHandler.java:259
<br> void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.run()
<br> HttpRequestHandler.java:106
<br> void EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run()
<br> PooledExecutor.java:803
<br> void java.lang.Thread.run()
<br> Thread.java: -
BEA-000802 ExecuteRequest failed, Result has already been set.
Observed in the JMS server log attached error at the time consumers some JMS queues are disconnected. As a result, applications that use these queues stop working. The error occurs occasionally, without a specific reason. There are no known workaround this situation. What may have caused the error.
<Error> <Kernel> <BEA-000802> <ExecuteRequest failed
java.lang.IllegalStateException: Result has already been set.
java.lang.IllegalStateException: Result has already been set
at weblogic.messaging.kernel.KernelRequest.setResult(KernelRequest.java:88)
at weblogic.messaging.kernel.internal.ReceiveRequestImpl$SetResultThread.run(ReceiveRequestImpl.java:315)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)Observed in the JMS server log attached error at the time consumers some JMS queues are disconnected. As a result, applications that use these queues stop working. The error occurs occasionally, without a specific reason. There are no known workaround this situation. What may have caused the error.
<Error> <Kernel> <BEA-000802> <ExecuteRequest failed
java.lang.IllegalStateException: Result has already been set.
java.lang.IllegalStateException: Result has already been set
at weblogic.messaging.kernel.KernelRequest.setResult(KernelRequest.java:88)
at weblogic.messaging.kernel.internal.ReceiveRequestImpl$SetResultThread.run(ReceiveRequestImpl.java:315)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221) -
How do I get a refund on Export PDF that has ALREADY been agreed
On 1/21-1/22 I tried to 'renew' a subscription for Export PDF. By some error (maybe mine - I just dont understand the whole thing) my Bank was immediately charged for two subscriptions, each at a different price. I immediately "chat"ted with several reps (it was difficult to get onto the chat and find out how to cancel) and was assured that both would be cancelled and refunded. They weren't!
I waited a week. Was again frustrated by the chat hookup, and tried the 'cloud' retail product tel #, assuming it was wrong but that I could be switched to the correct one. Had a very pleasant chat, was assured that both would be cancelled and refunded, received 2 e-mails confirming the cancellations, each with a seperate "Case #". Felt pretty good! It had only taken me a week of reasonably diligent effort to get a very simple thing done! IT WASN"T DONE! (Yes, I apologize - I know I'm loud - but by now I've got steam coming out of my ears!)
Today I got an e-mail, telling me that the refund had been processed and the case # would be closed. I looked at my bank, and only one had been refunded! I reviewed all the other e-mails and the notes from the telephone calls and chats to be sure I hadn't misunderstood something. But, no I hadn't. I went to my Adobe on-line and looked up 'my orders' history. Sure enough one had been invoiced and refunded ( the lesser charge of the two) but the other had ONLY BEEN INVOICED - NOT CANCELLED. And it seems that every piece of this transaction generates a new "order" , "case" or some other "reference #" - none of which are tied together, except by the invoice amount, when it is mentioned - which it typically IS NOT.
My question, then, is : How can I get past this absolute frustration over every aspect of my interaction with Adobe and GET THIS TAKEN CARE OF?????????Hi Stacy,
What frustration? (Just kidding !)
As I mentioned, one of the two charges has been refunded. Credited by
Adobe on Jan 28, I believe I received it in my bank on Jan 30.
The other charge, $25.37 of order # AD011017507, has not been received
by my bank yet. But this can't be that much of a surprise, and has nothing
to do with "10 business days" for refunds to post.
To this minute, "My Orders" on Adobe website shows that the order #
AD011017507 was invoiced on January 22, but that no credit invoice has been
posted against this order to this moment!
Can you begin to understand the frustration of being unable, through
all attempts to untangle this mess, starting within one hour of the original
order, with I believe nine different "Chats", telephone calls and, finally
a "problem" posting, stretching over more than thirteen days. Of course
it doesn't make much sense to devote this much attention to less than $50
worth of stuff, but I do not let things like this dangle.
And can you imagine how loathe I am to deal with Adobe for fear of
some real problem?
At any rate, I would certainly be pleased if you can suggest a way for
me to extricate myself from this. Any help would be GREATLY appreciated!
Thanks for your time and any trouble,
Stephen Ellis
<removed by admin>
In a message dated 2/3/2014 4:08:59 P.M. Eastern Standard Time,
[email protected] writes:
Re: How do I get a refund on Export PDF that has ALREADY been agreed
created by StacySison (http://forums.adobe.com/people/StacySison) in
Adobe ExportPDF - View the full discussion
(http://forums.adobe.com/message/6082008#6082008) -
Hi there,
I recently had the following situation, where I changed the source of my CSV file in Power Query.
Once I had reloaded the file, it would then not load into Power Pivot. So I disabled the loading from Power Query into Power Pivot. I then enabled the loading to the Data Model. Which then successfully loaded the data into Power Pivot.
But once I went into Power Pivot, had a look, then saved the Excel file. Once saved I closed the Excel file. I then opened the Excel file again and all the sheets that interact with the Power Pivot data work fine.
But if I go and open Power Pivot I get the following error: Unable to load the tables in the Power Pivot Window – An Item with the Same Key has already been added.
This is what I get from the Call Stack
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Microsoft.AnalysisServices.Common.LinguisticModeling.SynonymModel.AddSynonymCollection(DataModelingColumn column, SynonymCollection synonyms)
at Microsoft.AnalysisServices.Common.LinguisticModeling.LinguisticSchemaLoader.DeserializeSynonymModelFromSchema()
at Microsoft.AnalysisServices.Common.SandboxEditor.LoadLinguisticDesignerState()
at Microsoft.AnalysisServices.Common.SandboxEditor.set_Sandbox(DataModelingSandbox value)
at Microsoft.AnalysisServices.XLHost.Modeler.ClientWindow.RefreshClientWindow(String tableName)
I would assume that the issue is with the synonyms and for some reason, when I disabled the loading of my data into the Power Pivot Model, it did not remove the associations to the actual table and synonyms.
If I renamed the table in Power Pivot it all works fine. So that was my work around. Fortunately I did have a copy of the Excel workbook before I made this change. So I could then go and add back in all the relevant data to my table.
Has anyone had this before and know how to fix it?
http://www.bidn.com/blogs/guavaqHi there
I can share the work book, if possible to send me an email address. As the workbook size is about 9Mb.
Thanks
Gilbert
http://www.bidn.com/blogs/guavaq -
Crawl Error GetVirtualServerPolicyInternal - An item with the same key has already been added
Hi,
I did an index reset and now I can't start any crawl. It's complaining "An item with the same key has already been added". Exception seems to from Microsoft.Office.Server.Search.Internal.Protocols.SharePoint2006.CSTS3Helper.GetVirtualServerPolicyInternal.
What should I check? Thanks.
The SharePoint item being crawled returned an error when requesting data from the web service. ( Error from SharePoint site: *** An item with the same key has already been added., CorrelationID: 9e69ff9c-f925-50bf-5110-d1b0e74c77bc; SearchID = 522CB441-0028-4E7D-BED4-4230D7ADD14B
04/22/2015 19:37:10.93 mssdmn.exe (0x1A34) 0x225C SharePoint Server Search Connectors:SharePoint
dm1k Medium Exception Type: System.ArgumentException *** Message : An item with the same key has already been added. *** StackTrace: at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean
add) at Microsoft.Office.Server.Search.Internal.Protocols.SharePoint2006.CSTS3Helper.GetVirtualServerPolicyInternal(String strStsUrl, WssVersions serverVersion, sPolicyUser[]& vUsers, sPolicyUser& anonymousUser, String&
strVersion, String[]& vServerWFEs, Boolean& fIsHostHeader, Boolean& fIsAllUsersNT, Boolean& fIncludeSiteIdInCompactURL) at Microsoft.Office.Server.Search.Internal.Protocols.SharePoint2006.CSTS3Helper.GetVirtualServerPolicy(String
strStsUrl, sPolicyUser[]& vUsers, sPolicyUser& anonymousUser, String& strVersion, String[]& vServerWFEs, Boolean& fIsHostHeader, Boolean... 7a91de3b-a271-43c3-9f1a-935558902623
04/22/2015 19:37:10.93* mssdmn.exe (0x1A34) 0x225C SharePoint Server Search Connectors:SharePoint
dm1k Medium ...& fIsAllUsersNT, Boolean& fIncludeSiteIdInCompactURL) 7a91de3b-a271-43c3-9f1a-935558902623
04/22/2015 19:37:10.93 mssdmn.exe (0x1A34) 0x225C SharePoint Server Search Connectors:SharePoint
fsa0 Monitorable GetVirtualServerPolicy fail. error 2147755542, strStsUrl
http://serverurl 7a91de3b-a271-43c3-9f1a-935558902623
04/22/2015 19:37:10.93 mssdmn.exe (0x1A34) 0x225C SharePoint Server Search Connectors:SharePoint
dvt6 High SetSTSErrorInfo ErrorMessage = Error from SharePoint site: *** An item with the same key has already been added., CorrelationID: ae5aff9c-2940-50bf-5110-da6764f258d7 hr = 80042616 [sts3util.cxx:6988]
search\native\gather\protocols\sts3\sts3util.cxx 7a91de3b-a271-43c3-9f1a-935558902623
04/22/2015 19:37:10.93 mssdmn.exe (0x1A34) 0x225C SharePoint Server Search Connectors:SharePoint
dvi3 High Couldn't retrieve server
http://serverurl policy, hr = 80042616 [sts3util.cxx:1865] search\native\gather\protocols\sts3\sts3util.cxx 7a91de3b-a271-43c3-9f1a-935558902623
04/22/2015 19:37:10.93 mssdmn.exe (0x1A34) 0x225C SharePoint Server Search Connectors:SharePoint
dvu0 High STS3::StoreCachedError: Object initialization failed. Message: "Error from SharePoint site: *** An item with the same key has already been added., CorrelationID: ae5aff9c-2940-50bf-5110-da6764f258d7"
HR: 80042616 [sts3util.cxx:7083] search\native\gather\protocols\sts3\sts3util.cxx 7a91de3b-a271-43c3-9f1a-935558902623
04/22/2015 19:37:10.93 mssdmn.exe (0x1A34) 0x225C SharePoint Server Search Connectors:SharePoint
dvg4 High Server serverurl security initialization failed, hr = 80042616 error Message Error from SharePoint site: *** An item with the same key has already been added., CorrelationID: ae5aff9c-2940-50bf-5110-da6764f258d7
[sts3util.cxx:1591] search\native\gather\protocols\sts3\sts3util.cxx 7a91de3b-a271-43c3-9f1a-935558902623
04/22/2015 19:37:10.93 mssdmn.exe (0x1A34) 0x225C SharePoint Server Search Connectors:SharePoint
dv5x High CSTS3Accessor::InitServer: Initialize STS Helper failed. Return error to caller, hr=80042616 [sts3acc.cxx:1932] search\native\gather\protocols\sts3\sts3acc.cxx 7a91de3b-a271-43c3-9f1a-935558902623
04/22/2015 19:37:10.93 mssdmn.exe (0x1A34) 0x225C SharePoint Server Search Connectors:SharePoint
dv3t High CSTS3Accessor::InitURLType fails, Url
http://serverurl, hr=80042616 [sts3acc.cxx:288] search\native\gather\protocols\sts3\sts3acc.cxx 7a91de3b-a271-43c3-9f1a-935558902623
04/22/2015 19:37:10.93 mssdmn.exe (0x1A34) 0x225C SharePoint Server Search Connectors:SharePoint
dvb1 Medium CSTS3Accessor::Init fails, Url
http://serverurl, hr=80042616 [sts3handler.cxx:337] search\native\gather\protocols\sts3\sts3handler.cxx 7a91de3b-a271-43c3-9f1a-935558902623
04/22/2015 19:37:10.93 mssdmn.exe (0x1A34) 0x225C SharePoint Server Search Connectors:SharePoint
dvb2 Medium CSTS3Handler::CreateAccessorExD: Return error to caller, hr=80042616 [sts3handler.cxx:355] search\native\gather\protocols\sts3\sts3handler.cxx 7a91de3b-a271-43c3-9f1a-935558902623
04/22/2015 19:37:10.93 mssdmn.exe (0x1A34) 0x225C SharePoint Server Search Crawler:FilterDaemon
e4ye High FLTRDMN: URL
http://serverurl Errorinfo is "Error from SharePoint site: *** An item with the same key has already been added., CorrelationID: ae5aff9c-2940-50bf-5110-da6764f258d7" [fltrsink.cxx:566] search\native\mssdmn\fltrsink.cxx
04/22/2015 19:37:10.93 mssearch.exe (0x1118) 0x0628 SharePoint Server Search Crawler:Gatherer Plugin
cd11 Warning The start address http://serverurl cannot be crawled. Context: Application 'Enterprise_Search_Service_Application', Catalog 'Portal_Content' Details: The SharePoint item being
crawled returned an error when requesting data from the web service. (0x80042616)
04/22/2015 19:37:10.99 NodeRunnerContent1-84b5adb7-0d6 (0x2090) 0x06B4 Search Fuzzy Name Search
ajyfa Unexpected CCANameProjector : Exception:Exception : Access to the path 'C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\CanonicalResources\ProjectionModels\EN_EN.mdl' is denied. encountered while attempting to
load the Projection Model Catalog C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\CanonicalResources\ProjectionModels\EN_EN.mdl for Language : en encountered while attempting to load the projection model. ab403221-f69c-43ef-a8cc-7df384f6a4b3
04/22/2015 19:37:10.99 NodeRunnerContent1-84b5adb7-0d6 (0x2090) 0x06B4 Search Fuzzy Name Search
ajyd9 Unexpected CCAMetadataProducer : Fuzzy metadata generation failed to load resource for language: en. ab403221-f69c-43ef-a8cc-7df384f6a4b3
04/22/2015 19:37:10.99 NodeRunnerContent1-84b5adb7-0d6 (0x2090) 0x06B4 Search Fuzzy Name Search
ajyed Monitorable CCAMetadataProducer : Fuzzy metadata generation failed for the current record. Check logs for more details. ab403221-f69c-43ef-a8cc-7df384f6a4b3
04/22/2015 19:37:11.00 NodeRunnerContent1-84b5adb7-0d6 (0x2090) 0x240C Search Fuzzy Name Search
ajyfa Unexpected CCANameProjector : Exception:Exception : Access to the path 'C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\CanonicalResources\ProjectionModels\EN_EN.mdl' is denied. encountered while attempting to
load the Projection Model Catalog C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\CanonicalResources\ProjectionModels\EN_EN.mdl for Language : en encountered while attempting to load the projection model. 2bbbeea9-aeb8-4497-a774-2927bd21ba98
04/22/2015 19:37:11.00 NodeRunnerContent1-84b5adb7-0d6 (0x2090) 0x240C Search Fuzzy Name Search
ajyd9 Unexpected CCAMetadataProducer : Fuzzy metadata generation failed to load resource for language: en. 2bbbeea9-aeb8-4497-a774-2927bd21ba98
04/22/2015 19:37:11.00 NodeRunnerContent1-84b5adb7-0d6 (0x2090) 0x240C Search Fuzzy Name Search
ajyed Monitorable CCAMetadataProducer : Fuzzy metadata generation failed for the current record. Check logs for more details. 2bbbeea9-aeb8-4497-a774-2927bd21ba98
04/22/2015 19:37:11.00 NodeRunnerContent1-84b5adb7-0d6 (0x2090) 0x10E4 Search Fuzzy Name Search
ajyfa Unexpected CCANameProjector : Exception:Exception : Access to the path 'C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\CanonicalResources\ProjectionModels\EN_EN.mdl' is denied. encountered while attempting to
load the Projection Model Catalog C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\CanonicalResources\ProjectionModels\EN_EN.mdl for Language : en encountered while attempting to load the projection model. e15da110-f86d-4e3d-8d73-a67dccaa82cd
04/22/2015 19:37:11.00 NodeRunnerContent1-84b5adb7-0d6 (0x2090) 0x10E4 Search Fuzzy Name Search
ajyd9 Unexpected CCAMetadataProducer : Fuzzy metadata generation failed to load resource for language: en. e15da110-f86d-4e3d-8d73-a67dccaa82cd
04/22/2015 19:37:11.00 NodeRunnerContent1-84b5adb7-0d6 (0x2090) 0x10E4 Search Fuzzy Name Search
ajyed Monitorable CCAMetadataProducer : Fuzzy metadata generation failed for the current record. Check logs for more details. e15da110-f86d-4e3d-8d73-a67dccaa82cd
04/22/2015 19:37:11.03 NodeRunnerContent1-84b5adb7-0d6 (0x2090) 0x240C Search Fuzzy Name Search
ajyfa Unexpected CCANameProjector : Exception:Exception : Access to the path 'C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\CanonicalResources\ProjectionModels\EN_EN.mdl' is denied. encountered while attempting to
load the Projection Model Catalog C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\CanonicalResources\ProjectionModels\EN_EN.mdl for Language : en encountered while attempting to load the projection model. 58d54385-497b-466d-9f02-aeba664bc1b6
04/22/2015 19:37:11.03 NodeRunnerContent1-84b5adb7-0d6 (0x2090) 0x240C Search Fuzzy Name Search
ajyd9 Unexpected CCAMetadataProducer : Fuzzy metadata generation failed to load resource for language: en. 58d54385-497b-466d-9f02-aeba664bc1b6
04/22/2015 19:37:11.03 NodeRunnerContent1-84b5adb7-0d6 (0x2090) 0x240C Search Fuzzy Name Search
ajyed Monitorable CCAMetadataProducer : Fuzzy metadata generation failed for the current record. Check logs for more details. 58d54385-497b-466d-9f02-aeba664bc1b6Hi,
For troubleshooting your issue, please take steps as below:
1. Try to crawl your content source using farm admin account.
2.
Disable loopback check .
3.Add reference SPS3s://WEB into your content source start addresses.
For more information, please refer to these blogs:
http://sharepoint.stackexchange.com/questions/5215/crawling-fails-with-404-error-message-but-the-iis-log-tell-a-different-story
http://www.cleverworkarounds.com/2011/07/22/troubleshooting-sharepoint-people-search-101/
http://blogs.msdn.com/b/biyengar/archive/2009/10/27/psconfig-failure-with-error-an-item-with-the-same-key-has-already-been-added.aspx
Best Regards,
Eric
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
'Connection has already been closed'. Random error connecting with a pool
Hi all,
I've got a problem I cannot solve, and really hope in someone's help...
The fact is: I'm working on a webapp which doesn't made use of frameworks or patterns or similars. I introduced the DAO pattern in order to organize and speed up the work. At the core of the new classes there is the DBDAO, and this is the way it obtains the connection:
protected Connection conn = null; ... protected Connection getConnection() { try { if (conn == null || conn.isClosed()) { Context ctx = new InitialContext(); javax.sql.DataSource ds=null; ds =(javax.sql.DataSource) ctx.lookup( "agespPool" ); conn = ds.getConnection(); conn.setAutoCommit(false); } } catch (Exception ne) ...
Every new class that needs to access the db extends DBDAO and retrieves the conn with this method. In order to make things work without changing all the code, I modified the old class named 'Connessione' and made it extend DBDAO. Here is its method:
public class Connessione extends DBDAO{ ... public static synchronized Connection getConnessione() throws Exception { return new Connessione().getConnection(); }
That's all. Finished with the code.
Now, if someone uses the new classes extending DBDAO, all goes well. But for some old function that still work with Connessione.getConnessione(), connection closes suddenly with no reason.
For example, calling a page with some combo box populated with a db connection, you catch a:
java.sql.SQLException: Connection has already been closed. at weblogic.jdbc.wrapper.PoolConnection.checkConnection(PoolConnection.java:63) at weblogic.jdbc.wrapper.ResultSetMetaData.preInvocationHandler(ResultSetMetaData.java:37) at weblogic.jdbc.wrapper.ResultSetMetaData_oracle_jdbc_driver_OracleResultSetMetaData.getColumnType(Unknown Source) at it.praxis.tim.agesp.pub.sql.PagingList.populate(PagingList.java:98) at it.praxis.tim.agesp.pub.sql.PagingList.executeSQL(PagingList.java:53) at jsp_servlet._jsp._todolist_new._richiesta.__listarichieste._jspService(__listarichieste.java:353) at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
or sometimes:
- 20080417141147: <E> HtmlSelect.createHtmlSelect(4) - Errore! java.sql.SQLException: Result set already closed - 20080417141147: <E> HtmlSelect.createHtmlSelect(7) - Errore! java.sql.SQLException: Connection has already been closed. - 20080417141147: <E> ERRORE: ricercaRichieste : java.sql.SQLException: Statement has already been closed
That is, the conn is closed while used to populate the combo box. I don't understand who closes it.
Moreover, that happens randomly: 1 or 2 times over 4 hits on the page. The other times, all goes well. Most of the other pages, all goes well. So I don't think I have to search for a bug in the code.
Now, I'm working with BEA WL 8.1 sp 5 and Oracle 9.2.0.1.0 .
The error turns out even if I work locally (with Tomcat 5.5.23).
The webapp made use of a custom driver beforehand, and I replaced it with oracle's driver.
I tried to set the Connection Pool with oracle.jdbc.driver.OracleDriver and oracle.jdbc.OracleDriver .
I left the default for the connection pool, and then tried to set (BEA):
Connection Reserve Timeout: -1
Test Created Connections: On
with no changes.
The connection suddenly and randomly closes.
Any help would be appreciated...
Many thanksthe thing that you are instantiating isn't a Connection object, it's a Connessione object. That's returning one that's either been stashed from a previous call, or
acquires one from the data sourcea new Connessione object means a call to getConnection that means a new Connection object. That code is synchronized, it has to be a new object.
It is entirely possible that conn is not null if other actions have taken place in your constructor. Even assuming it is null, we don't know anything about the
connection pool you're trying to use, though it looks like it's probably weblogic's one.The contructor doesn't know of the connection. As for the pool, it is weblogic's one.
And even assuming both of these cases, we have no particular reason to believe that you're calling the getConnessione() method instead of accidentally calling
getConnection() and thus no reason to believe that you're definitely carrying out the actions that you believe you're carrying out.I wrote that the problem comes out in the old code that once worked fine. That code only uses Connessione.getConnessione() .
Conversely we have an error message that says you're closing connections elsewhere. Clearly there's a bug. It's presumably in your assumptions. You're
arguing instead of checking them.If I have a wrapper logging the close() calls, I have to see every call logged. Even if there's a bug (but remember that the code worked fine with a previous custom datasource), why do you think I shouldn't see that close() logged?
I may be wrong, but I already searched in that code. I'm arguing after all the checks.
There is no other thread that can see that connHow do you know? I have that Connessione.getConnessione() in a jsp. It's synchronized. That gives a new connection. I see it passed only to an utility class that queries the db and reads the resultset.
Who do you think can access that connection? -
A system shutdown has already been scheduled error in Sliverlight app
We are getting Silverlight 5 script error:
Anerror
has occurred inthe
script on thispage
Error:
A system shutdown has already been scheduled
Currently this error occur when we are working in windows application and when I click menu to open Silverlight project
Our silver light project refer project dependency our parent project web application and child project Silverlight
application
Our project requirement is when I open website link outside then first call parent project login screen then after
login success then dashboard menu click and open child project Silverlight application all are done in outside website link
But, problem is when I open Windows application to Silverlight project directly child project then some time script
error coming
Parent Project Web Application and Child Project Silverlight Project and Set a Startup Project Parent Project requirement
Our issue facing in web application project not windows application when I click menu then pass id with directly child project Silverlight but
getting on script error.
Script Display:
When open in Silverlight Startup Page:
Project Solution
ParentWeb -à This is our main Project here all project dependent
ChildWebApp à
This is our Child Web Project and reference to silverlighr project
ChildWebDLL
ChildWebReport
ChildWebSL
ChildSQLModelhttps://social.msdn.microsoft.com/Forums/en-US/f9dc0cad-4024-4da1-b44d-9cd593abc9e4/an-item-with-the-same-key-has-already-been-added-error?forum=sqlreportingservices
-
Hello Everyone,
I would highly appreciate your wisdom and advice on this
functionality. Lets say I have two
movieclips on the stage(ClipA, ClipB). I would like user to
be able to click on any of them and, this click
will invode a createclip function which pretty much creates a
dynamic movieclip and loads
whatever I assign to it such other existing clips within the
library. The only problem I have
makeing the functionality work is that I would like to limit
the function call to one at a time.
So if the user clicks on ClipA, function createclip would get
invoke and will attach the assigned
movie clip. And when user clicks on ClipB, I would like to
end the function call that was invoked
by the ClipA and then then allow ClipB to invoke the
function.
Pretty much it would a logic like:
if(createClip = true)
end it;
else
createClip();
When a movie is attached, can it be unloaded or unattached?
I don't know how to write a function that would check if
function createClip() has
already been invoked. I would highly appreciate any direction
in this.If the objective is just to get a unique list of authors based on your key, you could use the REPLACE statement in MySQL which functions as an "insert on duplicate key update" type of construct.
[http://dev.mysql.com/doc/refman/5.0/en/replace.html|http://dev.mysql.com/doc/refman/5.0/en/replace.html]
Catching an exception to detect dupes is functional but not very elegant. If you use REPLACE then you know your statements will always work. The drawback is that the statement is not portable across databases. -
Hi all,
I have created one SP for sending mail with formatting the HTML code inside script whenever i am individually declaring it and printing its expected but the problem at time of executing SP its giving error like this
Msg 132, Level 15, State 1, Line 47
The label 'http' has already been declared. Label names must be unique within a query batch or stored procedure.
what is the possibilities to overcome this problem follwing is my stored procedure code
ALTER PROCEDURE [dbo].[USP_DataLoadMailsend_essRules]
AS
BEGIN
SET NOCOUNT ON;
SET XACT_ABORT ON;
BEGIN TRY
---BEGIN TRANSACTION T1
DECLARE @packagelogid INT
DECLARE @batchlogid INT
DECLARE @packagestatus CHAR(2)
select @batchlogid =19870
--print(@batchlogid)
DECLARE @script VARCHAR(MAX)
DECLARE @tableHTML VARCHAR(MAX)
DECLARE @mailheader VARCHAR(50)
DECLARE @count INT
DECLARE @recipients1 VARCHAR(50)
DECLARE @subject1 VARCHAR(200)
DECLARE @sql VARCHAR(MAX)
Declare @UserId varchar(Max)
Declare @Information varchar(max)
Declare @TableHTML1 varchar(max)
Declare @TableHTML2 varchar(max)
SET @mailheader = ''
SET @mailheader = (select case
WHEN FileUpload = 'F'
THEN 'BussinessRules is Aborted'
WHEN (InRule = 'S')
AND (
SELECT sum(isnull(ErrorRecords, 0)) tot
FROM abc.FileUploadSummary z
WHERE z.BatchId = bts.BatchId
GROUP BY BatchId
) > 0
THEN 'BussinessRules is Processed with Errors'
WHEN InRule = 'F'
THEN 'BussinessRules is Failed'
WHEN (InRule = 'S')
AND (
SELECT sum(isnull(ErrorRecords, 0)) tot
FROM abc.FileUploadSummary z
WHERE z.BatchId = bts.BatchId
GROUP BY BatchId
) = 0
THEN 'BussinessRules is Succeeded'
end
from abc..BatchStatus bts where BatchId=@batchlogid)
/* Selecting Person Mail as Recipient */
SELECT TOP 1 @recipients1 = EmailId FROM abc.PersonEmail
WHERE PersonId = ( SELECT TOP 1 personid FROM abc.FileUploadSummary WHERE BatchId = @batchlogid )AND EmailTypeId = 1
/* Selecting UserId*/
select top 1 @UserId=loginid from abc.FUS where BatchId=@batchlogid
/*Selecting Information about the Status */
Set @Information=
(select case
WHEN FileUpload = 'F'
THEN 'BussinessRules is Aborted'
WHEN (InRule = 'S')
AND (
SELECT sum(isnull(ErrorRecords, 0)) tot
FROM abc.FileUploadSummary z
WHERE z.BatchId = bts.BatchId
GROUP BY BatchId
) > 0
THEN 'BussinessRules is Processed with Errors'
WHEN InRule = 'F'
THEN 'BussinessRules is Failed'
WHEN (InRule = 'S')
AND (
SELECT sum(isnull(ErrorRecords, 0)) tot
FROM abc.FileUploadSummary z
WHERE z.BatchId = bts.BatchId
GROUP BY BatchId
) = 0
THEN 'BussinessRules is Succeeded'
end + N' <br> <B>BatchId= '+ convert(varchar(250),(select @batchlogid)) +'</B>'
from abc..BatchStatus bts where BatchId=@batchlogid )
/*Selecting the Error Reason*/
if exists (select 1 from BatchStatus where BatchId=@batchlogid and ( InRule='f'))
begin
set @TableHTML1 = '<table border=1><tr><th>Sr.No.</th><th><P>Error Reason :</th></tr>'+
cast((select td= ROW_NUMBER()over (order by (select 1)),'',
td=isnull(e.ErrorDescription, '')
from abc.x.tbPackageErrorLog e --50594
join abc.x.tbPackageLog p -- 10223
on p.PackageLogID=e.PackageLogID
where p.BatchLogID= @batchlogid FOR XML PATH('tr'), TYPE )
as NVarchar(max)) +'</table>'
-- print @tableHTML
if not exists (select 1 from BatchStatus where BatchId=@batchlogid and ( InRule='f'))
set @TableHTML2 = 'Error Reason :N/A'
end
-- insert into #tmp values ( @TableHTML1)
--select * from #tmp
Set @tableHTML= 'Hello '+@UserId+', <br>Information:'+isnull(@Information,'') +
'<Table Border=1><Tr><th>Sr No</th><th>Uploaded files </th>:'+
CAST ((select td= ROW_NUMBER()over(order by f.FileUploadId), '',
td = f.TableName , ''
from abc.FileUploadSummary F where BatchId=@batchlogid
FOR XML PATH('tr'), TYPE ) AS NVARCHAR(max) )
+'</table>'+
'Error Reason :'+isnull(isnull(@TableHTML1,'')+ isnull(@TableHTML2,''),'N/A')+ --concat (isnull(@TableHTML1,''),isnull(@TableHTML2,'')
'<br> Please login to Your Account for further Details..!'
+'<br>@Note: This is system generated message, Do not reply to this mail. <br>Regards,<br>'+
'Admin'
print @tableHTML
SET @sql = ' EXEC msdb.dbo.sp_send_dbmail @profile_name = ''DBA_mail_test''
,@recipients = ''' + isnull(@recipients1,'''') + ''',@subject = ''' + isnull(@mailheader,'''') + ''',
@body = ''' +isnull(@tableHTML,'''')+ ''',
@body_format = ''HTML'''
Exec(@sql)
END TRY
BEGIN CATCH
PRINT error_message()
-- Test whether the transaction is uncommittable.
-- IF (XACT_STATE()) = - 1
-- ROLLBACK TRANSACTION --Comment it if SP contains only select statement
DECLARE @ErrorFromProc VARCHAR(500)
DECLARE @ErrorMessage VARCHAR(1000)
DECLARE @SeverityLevel INT
SELECT @ErrorFromProc = ERROR_PROCEDURE()
,@ErrorMessage = ERROR_MESSAGE()
,@SeverityLevel = ERROR_SEVERITY()
--INSERT INTO dbo.ErrorLogForUSP (
-- ErrorFromProc
-- ,ErrorMessage
-- ,SeverityLevel
-- ,DateTimeStamp
--VALUES (
-- @ErrorFromProc
-- ,@ErrorMessage
-- ,@SeverityLevel
-- ,GETDATE()
END CATCH
END
please help me to solve this problem
Niraj SevalkarThis is no string http in your procedure. Then again the error message points to a line 47 outside a stored procedure. I can't tell it is outside, since there is no procedure name.
But I see that you have this piece of dynamic SQL:
SET @sql = ' EXEC msdb.dbo.sp_send_dbmail @profile_name = ''DBA_mail_test''
,@recipients = ''' + isnull(@recipients1,'''') + ''',@subject = ''' + isnull(@mailheader,'''') + ''',
@body = ''' +isnull(@tableHTML,'''')+ ''',
@body_format = ''HTML'''
Exec(@sql)
Why is this dynamic SQL at all? Why not just make plain call to sp_send_dbmail?
EXEC msdb.dbo.sp_send_dbmail @profile_name = 'DBA_mail_test'
,@recipients = @recipients1, @subject = @mailheader, @body = @tableHTML
Erland Sommarskog, SQL Server MVP, [email protected]
Maybe you are looking for
-
I want to send my Excel files as .pdf by email. I need to know if Acrobat program is best for me. I purchased a PDF file this morning and I don't think I need that. From what I have seen, The Acrobat file is more what I need. If so, then I would
-
JDBC Statement.executeBatch() sometimes retrun NULL????
WHY???? DataBase is ORACLE8.1.7 i use PreparedStatement to executeBatch() and DatabaseMetaData.supportsBatchUpdates() = true but sometimes executeBatch() = NULL !!!! is this respect with ORACLE parameter?
-
Lost HDD space after reinstall of OS X
I recently purchased a Mac Mini (Mid 2011) used. The previous owner failed to restore to factory settings. Being a good neighbor, I looked for a way to restore and rid the Mac of their info. I pressed the (command + R) shortcut and then it had a worl
-
Using JAXR to query Data - from JUDDI
Dear friends - I am beginning to work on juddi. I am trying to Query the registry from my code to get some data. But I am unable to do so. I am getting the following exception:- log4j:WARN No appenders could be found for logger (javax.xml.soap.Messag
-
I'm receiving a number of emails that say " mail delivery system", and they are not in my sent items. So I've tried to do the virus scan and nothing is coming up. Now the "real" emails I need to send to clients are not going through because I've used