EOFException opening input stream in servlet
We are getting intermittent EOFException opening input stream in the servlet.
Out application contains applet running in the browser and accessing servlet. It writes binary data to the output stream (opened from URLConnection) and on server side servlet reads data from the input stream opened from http request object. It worked fine until we moved ear to different box. Now sometime (not always) we get EOFException on the server side opening input stream.
Any suggestions on cause of the problem?
We are running WL 8.1.5
Thanks,
Ed
You have to use WDResource and related classes for reading/writing the files on portal app server.
For getting some Idea, look at this wiki.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a4d71?quicklink=index&overridelayout=true
-Yugandhar Reddy
Similar Messages
-
When using URLConnection read input stream error
hi,
In my applet I build a URLConnection, it connect a jsp file. In my jsp file I refer to a javaBean. I send two objects of request and response in jsp to javaBean. In javabean return output stream to URLConnect. At that time a error happened.WHY???(Applet-JSP-JAVABean)
Thanks.
My main code:
APPLET:(TestApplet)
URL url = new URL("http://210.0.8.120/jsp/test.jsp";
URLConnection con;
con = url .openConnection();
con = servlet.openConnection();
con.setDoInput( true );
con.setDoOutput( true );
con.setUseCaches( false );
con.setRequestProperty( "Content-Type","text/plain" );
con.setAllowUserInteraction(false);
ObjectOutputStream out;
out = new ObjectOutputStream(con.getOutputStream());
Serializable[] data ={"test"};
out.writeObject( data );
out.flush();
out.close();
//until here are all rigth
ObjectInputStream in = new ObjectInputStream( con.getInputStream() );//happened error
JSP:
TestBean testBean = new TestBean ();
testBean .execute(request, response);
JAVABEAN:
public void execute( HttpServletRequest request,
HttpServletResponse response )
ObjectInputStream in = new ObjectInputStream( request.getInputStream() );
String direct = (String) in.readObject();
System.out.prinltn("direct");
ObjectOutputStream out = new ObjectOutputStream( response.getOutputStream() );
SerializableSerializable[] data ={"answer"};
out.writeObject( data );
out.flush();
out.close();
Error detail:
java.io.StreamCorruptedException: invalid stream header
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:729)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:251)
at TestApplet.postObjects(TestApplet.java:172)you have to pay attention to the sequence of opening the streams.
The following example is: client sends a string to server, and servlet sends a response string back.
client side:
URL url = new URL( "http://152.8.113.149:8080/conn/servlet/test" );
URLConnection conn = url.openConnection();
System.out.println( "conn: " + conn );
conn.setDoOutput( true );
conn.setDoInput( true );
conn.setUseCaches( false );
conn.setDefaultUseCaches (false);
// send out a string
OutputStream out = conn.getOutputStream();
ObjectOutputStream oOut = new ObjectOutputStream( out );
oOut.writeObject( strSrc );
// receive a string
InputStream in = conn.getInputStream();
ObjectInputStream oIn = new ObjectInputStream( in );
String strDes = (String)oIn.readObject();server side
// open output stream
OutputStream out = res.getOutputStream();
ObjectOutputStream oOut = new ObjectOutputStream( out );
// open input stream and read from client
InputStream in = req.getInputStream();
ObjectInputStream oIn = new ObjectInputStream( in );
String s = (String)oIn.readObject();
System.out.println( s );
// write to client
oOut.writeObject( s + " back" ); I have the complete example at http://152.8.113.149/samples/app_servlet.html
don't forget to give me the duke dollars. -
Convert result set into input stream
Hi,
I have result set with me having 93 columns with 1 lac rows. I want to download the result set as xls file.
Because of the data set size is large, i'm not able to hold the data in java object. So i'm trying to convert result set to input stream and giving this input stream to servlet output stream by specifying the contentType as text/xls.
I'm not able to convert result set into input stream.
Could you provide a solution here...
Thanks,
Rajesh1 - JDBC is the wrong way to extract this data. It's like "What's the fastest way
to copy the Oxford English Dictionary using tweets?" I would research the
DBMS's bulk extract functionality.
2 - Are you dead-set absolutely sure you need to do this at all? What can you
do with the data all in one flat file that you cannot do with SQL access to the
data?
3 - If you want to convert all the columns into one (not that it's a huge
win or anything), you can use the DBMS's conversion and concatenation
functionality in your SQL. So instead of
"select col1, col2, col3, .... from MyBigTable"
do (change this to whatever conversion function syntax and concat syntax your DBMS needs)
"select convert(col1, varchar) concat ' ' concat convert(col2, varchar) concat ' ' concat convert(col3, varchar) ... from MyBigTable"
so the result set you get is a single column.
Joe -
ExecTask - java.io.EOFException: Unexpected end of ZLIB input stream
BOXI 3.1 FP 7 deployed on AIX environment with all the lang packs. Trying to install SP2 on AIX, when it comes to deploying the war files, AnalyticalReporting, the install encounters error. This error appears to be with size of the war file. Anyone came across this issue?
2010-03-30 10:10:00,633 Target - Target "expand_and_package" started.
2010-03-30 10:10:00,634 Delete - Deleting directory /export/home/Business_Objects/global/deployment/workdir/tomcat55/resources/web/AnalyticalReporting
2010-03-30 10:10:00,798 Mkdir - Created dir: /export/home/Business_Objects/global/deployment/workdir/tomcat55/resources/web/AnalyticalReporting
2010-03-30 10:10:00,828 Mkdir - Created dir: /export/home/Business_Objects/global/deployment/workdir/tomcat55/resources/AnalyticalReporting
2010-03-30 10:19:32,016 *ExecTask - java.io.EOFException: Unexpected end of ZLIB input stream
2010-03-30 10:19:32,016 ExecTask - at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java(Compiled Code))
2010-03-30 10:19:32,017 ExecTask - at java.util.zip.InflaterInputStream.read(InflaterInputStream.java(Compiled Code))
2010-03-30 10:19:32,017 ExecTask - at java.util.zip.ZipInputStream.read(ZipInputStream.java(Compiled Code))
2010-03-30 10:19:32,017 ExecTask - at sun.tools.jar.Main.extractFile(Main.java(Compiled Code))
2010-03-30 10:19:32,017 ExecTask - at sun.tools.jar.Main.extract(Main.java(Compiled Code))
2010-03-30 10:19:32,025 ExecTask - at sun.tools.jar.Main.run(Main.java:228)
2010-03-30 10:19:32,025 ExecTask - at sun.tools.jar.Main.main(Main.java:944)
2010-03-30 10:19:32,051 ExecTask - Result: 1
2010-03-30 10:19:32,162 Echo - Adding 'webiApplet/**' to the content to bundle with AnalyticalReporting's war file
2010-03-30 10:19:32,302 Jar - error while reading original manifest: Error opening zip file /export/home/Business_Objects/global/deployment/workdir/tomc
at55/application/AnalyticalReporting.war
2010-03-30 10:19:35,354 Jar - Building jar: /export/home/Business_Objects/global/deployment/workdir/tomcat55/application/AnalyticalReporting.war
2010-03-30 10:20:29,036 Zip - Building zip: /export/home/Business_Objects/global/deployment/workdir/tomcat55/resources/AnalyticalReporting.zip
2010-03-30 10:23:58,561 Mkdir - Created dir: /export/home/Business_Objects/global/deployment/workdir/tomcat55/resources/web/AnalyticalReporting/WEB-INF
2010-03-30 10:23:58,564 Copy - Copying 1 file to /export/home/Business_Objects/global/deployment/workdir/tomcat55/resources/web/AnalyticalReporting/WEB-I
NF
2010-03-30 10:23:58,597 Delete - Deleting directory /export/home/Business_Objects/global/deployment/workdir/tomcat55/resources/AnalyticalReporting
2010-03-30 10:35:00,636 Target - Target "expand_and_package" finished.Hi,
Don't know which of this factors solved the problem:
1. Error server:
AIX 5.2
jdk 1.3.17 (minimum from docu: 1.3.11)
$ORACLE_HOME wasn't in the begining of $PATH
2. success server:
AIX 5.3
jdk 1.4.02
$ORACLE_HOME is now in the begining of $PATH
cheers Lao De -
Java.io.EOFException: Unexpected end of ZLIB input stream
Hi,
I am reading .gz file in servlet and writing it in output stream. It works fine for smaller files. For larger file when I reading file and writing output I am getting exceptions as below in order.
8/6/09 9:52:28:953 CDT] 00000029 ServletWrappe E SRVE0068E: Could not invoke the service() method on servlet /WEB-INF/pages/TilesTemplate/layouttemplate.jsp. Exception thrown : java.lang.IllegalStateException: SRVE0199E: OutputStream already obtained
at com.ibm.ws.webcontainer.srt.SRTServletResponse.getWriter(SRTServletResponse.java:489)
at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:170)
at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:163)
at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:227)
---- Begin backtrace for Nested Throwables
java.lang.IllegalStateException: SRVE0199E: OutputStream already obtained
at com.ibm.ws.webcontainer.srt.SRTServletResponse.getWriter(SRTServletResponse.java:489)
at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:170)
at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:163)
*[8/6/09 9:52:28:625 CDT] 00000029 SystemErr R java.io.EOFException: Unexpected end of ZLIB input stream*
*[8/6/09 9:52:28:656 CDT] 00000029 SystemErr R at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:238)*
*[8/6/09 9:52:28:656 CDT] 00000029 SystemErr R at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:157)*
*[8/6/09 9:52:28:656 CDT] 00000029 SystemErr R at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:109)*
*[8/6/09 9:52:28:656 CDT] 00000029 SystemErr R at java.io.FilterInputStream.read(FilterInputStream.java:110)*
*[8/6/09 9:52:28:656 CDT] 00000029 SystemErr R at sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:325)*
*[8/6/09 9:52:28:656 CDT] 00000029 SystemErr R at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:223)*
*[8/6/09 9:52:28:656 CDT] 00000029 SystemErr R at java.io.InputStreamReader.read(InputStreamReader.java:208)*
*[8/6/09 9:52:28:656 CDT] 00000029 SystemErr R at java.io.BufferedReader.fill(BufferedReader.java:153)*
*[8/6/09 9:52:28:656 CDT] 00000029 SystemErr R at java.io.BufferedReader.readLine(BufferedReader.java:316)*
*[8/6/09 9:52:28:656 CDT] 00000029 SystemErr R at java.io.BufferedReader.readLine(BufferedReader.java:379)*
*[8/*My suggestion would be to run your code as a plain old Java application. Why use a servlet environment to test the problem? There's just too many things going on. So first see if it works the same way in a Java application. If it does, or if it doesn't, you then know where to go next.
-
Open an input stream to a socket
How many times I can open an input stream to a socket? If I create more than one an input stream to a socket, does this affect anything?
Thanks.Generally low level classes do not have high level logic. Socket is a low level class, it's only logic is to connect you to something, and allow you to read and write to that thing (through the socket) using streams. Being able to connect multiple times or setting marks on your stream is a higher level of logic. Putting to much logic is low level classes tends to reduce re-useablility (making unmarkable streams markable as nothing to do with sockets and can be re-used upon any streams that do not support to be marked) and sometimes performances (having marks means having a buffer means having a potential big memory allocation in your Socket that you do not control).
So in your case, since you are not really interested in re-connecting a socket, you should rather go for a wrapping InputStream that provides marking capabilities over the streams used by the socket class itself.
Socket socket = getSocket();
// this one does not support to be marked
InputStream stream = socket.getInputStream();
// but now it does :)
stream = new BufferedInputStream( stream ); -
Jon,
I believe that this error is similar to a "connection reset by peer". It is
a Window specific error. I believe it indicates that something has happened
on the other end of the socket such that the socket has gone bad.
I think that this should only occur when people reset their connection
before the reply is sent. I don't believe that it is indicative of any
serious problem other than this communication failure caused by the client.
I've opened an issue to catch and squelch these spurious exceptions rather
than logging them. For now I think it is safe to ignore them.
Regards,
Adam
"Jon Mountjoy" <[email protected]> wrote in message
news:[email protected]...
Hi Guys,
Using weblogic 5.1 (downloaded pretty soon after announcement) on windows
2000 (yes I know not certified there yet) and using jdk1.2.2-001.
I have a pretty standard setup - a connection pool (5) to a sqlserver
(remote) machine.
A pretty standard multithreaded servlet - grabs a connection, does aselect,
calls dbkona to dump output, releases connection.
It runs fine - browser returns result. When I push 'reload' on browser,say
10 times very quickly, I get the following errors. It is sometimes a
combination of these:
1- Mon May 08 13:34:41 GMT+00:00 2000:<E> <HTTP> Connection failure
java.net.SocketException: ReadFile on fd=1912 failed with err=64
at weblogic.socket.NTSocketMuxer.initiateIO(Native Method)
at weblogic.socket.NTSocketMuxer.read(NTSocketMuxer.java, Compiled
Code)
2- Mon May 08 13:40:42 GMT+00:00 2000:<D> <ListenThread> Problem
accepting connecti on java.net.SocketException: Connection reset by peer:
JVM_recv in socket input stream read
Now I can get rid of (1) by switching off native IO!! This also stoppedIO
exceptions that were being raised by the servlet when it tried to outputto
the output stream. (2) persists.
I have changed nothing else in the properties.
(1) sounds like I may need to up the number of file descriptors open?
(2) I don't know. Is my server too loaded? I am running on a 600Mhzusing
64Mb heap for the server with 300Mb swap available...
Regards,
Jon
More substantial excerpts:
Mon May 08 13:40:42 GMT+00:00 2000:<D> <ListenThread> Problem accepting
connection
java.net.SocketException: Connection reset by peer: JVM_recv in socketinput
stream read
at java.net.SocketInputStream.socketRead(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java, Compiled Code)
at weblogic.socket.ResettableSocket.getPrefix(ResettableSocket.java,
Compiled Code)
at weblogic.socket.JVMSocketT3.claimSocket(JVMSocketT3.java, CompiledCode)
at weblogic.socket.JVMSocketT3.claimSocket(JVMSocketT3.java, CompiledCode)
at weblogic.socket.JVMSocketManager.accept(JVMSocketManager.java,Compiled
Code)
at
weblogic.t3.srvr.ListenThread$RJVMListenRequest.execute(ListenThread.java,
Compiled Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
Mon May 08 13:35:31 GMT+00:00 2000:<E> <HTTP> Connection failure
java.net.SocketException: ReadFile on fd=1980 failed with err=64
at weblogic.socket.NTSocketMuxer.initiateIO(Native Method)
at weblogic.socket.NTSocketMuxer.read(NTSocketMuxer.java, Compiled Code)
at weblogic.socket.MuxableSocketHTTP.requeue(MuxableSocketHTTP.java,
Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java,
Compiled Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
Mon May 08 13:35:31 GMT+00:00 2000:<E> <HTTP> Connection failure
java.net.SocketException: ReadFile on fd=1760 failed with err=64
at weblogic.socket.NTSocketMuxer.initiateIO(Native Method)
at weblogic.socket.NTSocketMuxer.read(NTSocketMuxer.java, Compiled Code)
at weblogic.socket.MuxableSocketHTTP.requeue(MuxableSocketHTTP.java,
Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java,
Compiled Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
Mon May 08 13:35:31 GMT+00:00 2000:<E> <HTTP> Connection failure
java.net.SocketException: ReadFile on fd=1908 failed with err=64
at weblogic.socket.NTSocketMuxer.initiateIO(Native Method)
at weblogic.socket.NTSocketMuxer.read(NTSocketMuxer.java, Compiled Code)
at weblogic.socket.MuxableSocketHTTP.requeue(MuxableSocketHTTP.java,
Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java,
Compiled Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)We are seeing the same error since switching to sp11 (we had been using
sp10). Haven't seen it in Solaris though. What is causing it?
Wed May 08 12:01:48 EDT 2002:<E> <HTTP> Connection failure
java.net.SocketException: ReadFile on fd=3640 failed with err=64
at weblogic.socket.NTSocketMuxer.initiateIO(Native Method)
at weblogic.socket.NTSocketMuxer.read(NTSocketMuxer.java:259)
at weblogic.socket.MuxableSocketHTTP.requeue(MuxableSocketHTTP.java:178)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:280)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
"John Slaman" <[email protected]> wrote in message
news:[email protected]..
>
I'm getting a error as follows:
Mon Apr 22 19:04:10 EDT 2002:<E> <HTTP> Connection failure
java.net.SocketException: ReadFile on fd=2368 failed with err=64
at weblogic.socket.NTSocketMuxer.initiateIO(Native Method)
at weblogic.socket.NTSocketMuxer.read(NTSocketMuxer.java, Compiled Code)
at weblogic.socket.MuxableSocketHTTP.requeue(MuxableSocketHTTP.java,Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java,Compiled Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
I have no idea as to the cause. It's been posted in the archives before -but with
no particular solution.
I'm using WLS 5.1 SP11, JDK 1.2.2_007. Win2000.
Does anybody know the cause/solution?
Thanks.
"Jon Mountjoy" <[email protected]> wrote:
Hi,
I have noticed that applying the service pack helps things quite a bit.
I no longer get NT muxer errors etc etc. just the "connection reset by
peer"
every now and again.
As I am repeatedly hitting the server from one browser, your 'connection
going bad' scenario probably
applies quite well.
(btw. before the SP, the errors seemed to crop up more just before/during
a
GC.)
Jon -
Hi Guys,
Using weblogic 5.1 (downloaded pretty soon after announcement) on windows
2000 (yes I know not certified there yet) and using jdk1.2.2-001.
I have a pretty standard setup - a connection pool (5) to a sqlserver
(remote) machine.
A pretty standard multithreaded servlet - grabs a connection, does a select,
calls dbkona to dump output, releases connection.
It runs fine - browser returns result. When I push 'reload' on browser, say
10 times very quickly, I get the following errors. It is sometimes a
combination of these:
1- Mon May 08 13:34:41 GMT+00:00 2000:<E> <HTTP> Connection failure
java.net.SocketException: ReadFile on fd=1912 failed with err=64
at weblogic.socket.NTSocketMuxer.initiateIO(Native Method)
at weblogic.socket.NTSocketMuxer.read(NTSocketMuxer.java, Compiled
Code)
2- Mon May 08 13:40:42 GMT+00:00 2000:<D> <ListenThread> Problem
accepting connecti on java.net.SocketException: Connection reset by peer:
JVM_recv in socket input stream read
Now I can get rid of (1) by switching off native IO!! This also stopped IO
exceptions that were being raised by the servlet when it tried to output to
the output stream. (2) persists.
I have changed nothing else in the properties.
(1) sounds like I may need to up the number of file descriptors open?
(2) I don't know. Is my server too loaded? I am running on a 600Mhz using
64Mb heap for the server with 300Mb swap available...
Regards,
Jon
More substantial excerpts:
Mon May 08 13:40:42 GMT+00:00 2000:<D> <ListenThread> Problem accepting
connection
java.net.SocketException: Connection reset by peer: JVM_recv in socket input
stream read
at java.net.SocketInputStream.socketRead(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java, Compiled Code)
at weblogic.socket.ResettableSocket.getPrefix(ResettableSocket.java,
Compiled Code)
at weblogic.socket.JVMSocketT3.claimSocket(JVMSocketT3.java, Compiled Code)
at weblogic.socket.JVMSocketT3.claimSocket(JVMSocketT3.java, Compiled Code)
at weblogic.socket.JVMSocketManager.accept(JVMSocketManager.java, Compiled
Code)
at
weblogic.t3.srvr.ListenThread$RJVMListenRequest.execute(ListenThread.java,
Compiled Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
Mon May 08 13:35:31 GMT+00:00 2000:<E> <HTTP> Connection failure
java.net.SocketException: ReadFile on fd=1980 failed with err=64
at weblogic.socket.NTSocketMuxer.initiateIO(Native Method)
at weblogic.socket.NTSocketMuxer.read(NTSocketMuxer.java, Compiled Code)
at weblogic.socket.MuxableSocketHTTP.requeue(MuxableSocketHTTP.java,
Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java,
Compiled Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
Mon May 08 13:35:31 GMT+00:00 2000:<E> <HTTP> Connection failure
java.net.SocketException: ReadFile on fd=1760 failed with err=64
at weblogic.socket.NTSocketMuxer.initiateIO(Native Method)
at weblogic.socket.NTSocketMuxer.read(NTSocketMuxer.java, Compiled Code)
at weblogic.socket.MuxableSocketHTTP.requeue(MuxableSocketHTTP.java,
Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java,
Compiled Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
Mon May 08 13:35:31 GMT+00:00 2000:<E> <HTTP> Connection failure
java.net.SocketException: ReadFile on fd=1908 failed with err=64
at weblogic.socket.NTSocketMuxer.initiateIO(Native Method)
at weblogic.socket.NTSocketMuxer.read(NTSocketMuxer.java, Compiled Code)
at weblogic.socket.MuxableSocketHTTP.requeue(MuxableSocketHTTP.java,
Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java,
Compiled Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)I have exactly the same problem running on Windows NT 4.0 (SP4) Weblogic 5.1 and
JDK1.2.2-001.
java.net.SocketException: ReadFile on fd=1048 failed with err=64
at weblogic.socket.NTSocketMuxer.initiateIO(Native Method)
at weblogic.socket.NTSocketMuxer.read(NTSocketMuxer.java, Compiled Code)
at weblogic.socket.MuxableSocketHTTP.requeue(MuxableSocketHTTP.java, Compiled
Code)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java, Compiled
Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
Jon Mountjoy wrote:
Hi Guys,
Using weblogic 5.1 (downloaded pretty soon after announcement) on windows
2000 (yes I know not certified there yet) and using jdk1.2.2-001.
I have a pretty standard setup - a connection pool (5) to a sqlserver
(remote) machine.
A pretty standard multithreaded servlet - grabs a connection, does a select,
calls dbkona to dump output, releases connection.
It runs fine - browser returns result. When I push 'reload' on browser, say
10 times very quickly, I get the following errors. It is sometimes a
combination of these:
1- Mon May 08 13:34:41 GMT+00:00 2000:<E> <HTTP> Connection failure
java.net.SocketException: ReadFile on fd=1912 failed with err=64
at weblogic.socket.NTSocketMuxer.initiateIO(Native Method)
at weblogic.socket.NTSocketMuxer.read(NTSocketMuxer.java, Compiled
Code)
2- Mon May 08 13:40:42 GMT+00:00 2000:<D> <ListenThread> Problem
accepting connecti on java.net.SocketException: Connection reset by peer:
JVM_recv in socket input stream read
Now I can get rid of (1) by switching off native IO!! This also stopped IO
exceptions that were being raised by the servlet when it tried to output to
the output stream. (2) persists.
I have changed nothing else in the properties.
(1) sounds like I may need to up the number of file descriptors open?
(2) I don't know. Is my server too loaded? I am running on a 600Mhz using
64Mb heap for the server with 300Mb swap available...
Regards,
Jon
More substantial excerpts:
Mon May 08 13:40:42 GMT+00:00 2000:<D> <ListenThread> Problem accepting
connection
java.net.SocketException: Connection reset by peer: JVM_recv in socket input
stream read
at java.net.SocketInputStream.socketRead(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java, Compiled Code)
at weblogic.socket.ResettableSocket.getPrefix(ResettableSocket.java,
Compiled Code)
at weblogic.socket.JVMSocketT3.claimSocket(JVMSocketT3.java, Compiled Code)
at weblogic.socket.JVMSocketT3.claimSocket(JVMSocketT3.java, Compiled Code)
at weblogic.socket.JVMSocketManager.accept(JVMSocketManager.java, Compiled
Code)
at
weblogic.t3.srvr.ListenThread$RJVMListenRequest.execute(ListenThread.java,
Compiled Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
Mon May 08 13:35:31 GMT+00:00 2000:<E> <HTTP> Connection failure
java.net.SocketException: ReadFile on fd=1980 failed with err=64
at weblogic.socket.NTSocketMuxer.initiateIO(Native Method)
at weblogic.socket.NTSocketMuxer.read(NTSocketMuxer.java, Compiled Code)
at weblogic.socket.MuxableSocketHTTP.requeue(MuxableSocketHTTP.java,
Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java,
Compiled Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
Mon May 08 13:35:31 GMT+00:00 2000:<E> <HTTP> Connection failure
java.net.SocketException: ReadFile on fd=1760 failed with err=64
at weblogic.socket.NTSocketMuxer.initiateIO(Native Method)
at weblogic.socket.NTSocketMuxer.read(NTSocketMuxer.java, Compiled Code)
at weblogic.socket.MuxableSocketHTTP.requeue(MuxableSocketHTTP.java,
Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java,
Compiled Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
Mon May 08 13:35:31 GMT+00:00 2000:<E> <HTTP> Connection failure
java.net.SocketException: ReadFile on fd=1908 failed with err=64
at weblogic.socket.NTSocketMuxer.initiateIO(Native Method)
at weblogic.socket.NTSocketMuxer.read(NTSocketMuxer.java, Compiled Code)
at weblogic.socket.MuxableSocketHTTP.requeue(MuxableSocketHTTP.java,
Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java,
Compiled Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code) -
Unexpected end of ZLIB input stream error while compiling
Hello
I am getting errors when i run RMIC and JAR apps in the same window, i've tried to close and open the input stream in between, tried delaying between the two , tried /I paramaeter, any one ?
Rmic stage pass OK
but i get Unexpected end of ZLIB input stream exception i some of the file on the jar stage :
Main batch :
start /B %SWIFT_LOCAL_HOME%\scripts\rmicAll.bat
start /B %SWIFT_LOCAL_HOME%\scripts\create_jar.bat
Jar exception :
adding: CVS/(in = 0) (out= 0)(stored 0%)
adding: CVS/Entries(in = 383) (out= 168)(deflated 56%)
adding: CVS/Repository(in = 13) (out= 15)(deflated -15%)
adding: CVS/Root(in = 60) (out= 60)(deflated 0%)
java.io.EOFException: Unexpected end of ZLIB input stream
at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:223)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:141)
at java.util.zip.ZipInputStream.read(ZipInputStream.java:146)
at sun.tools.jar.Main.update(Main.java:508)
at sun.tools.jar.Main.run(Main.java:184)
at sun.tools.jar.Main.main(Main.java:1022)
C:\Eclipse_Workspace\Swift\scripts>date /T 1>>C:\Eclipse_Workspace\Swift\swift_build.txt
C:\Eclipse_Workspace\Swift\scripts>time /T 1>>C:\Eclipse_Workspace\Swift\swift_build.txt
C:\Eclipse_Workspace\Swift\scripts>echo Swift.jar Build Time : 1>C:\Eclipse_Workspace\Swift\swift_build.txt
C:\Eclipse_Workspace\Swift\scripts>"C:\Program Files\Java\jdk1.6.0_02\bin\jar" -uvf C:\Eclipse_Workspace\Swift\jars\swift.jar -C C:\Eclipse_Workspace\Swift swift_build.txt
java.io.EOFException: Unexpected end of ZLIB input stream
at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:223)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:141)
at java.util.zip.ZipInputStream.read(ZipInputStream.java:146)
at sun.tools.jar.Main.update(Main.java:508)
at sun.tools.jar.Main.run(Main.java:184)
at sun.tools.jar.Main.main(Main.java:1022)You seem to be adding the contents of CVS directories to the jar file. CVS directories contain internal information used by CVS. This suggests to me that you are either deliberately doing something really really strange, or you are doing something stupid out of ignorance.
The CVS directories suggest you are making a jar from your source code. Generally you compile the source code 'tree' and place the output (.class files etc) in another tree and create the jar from that second tree.
And PaulMiner is correct, you'll definitely need to change 'start' to 'call'. Do that first, then take a look at what is source code, and what it is that you want in your jar file and make sure it is all sensible, I suspect it isn't. -
Is there any way to mark/reset (or something comparable) an input stream that does not support the actual mark/reset methods? I'm using a DataInputStream, which contains a FileInputStream, and I've gotten an IOException saying mark/reset is not supported. Is there any other way to do it?
I'm basically just reading bytes of binary data from a file, and I want to include a feature to reset and start reading again from the beginning. here's some of my code:
public static void readWithDelay() {
byte buf[] = new byte[100000];
byte skipbytes[] = new byte[2];
int length = 0, prevtime, time, lastprevtime=0, num=0, timecheck,skiplength=0;
long period, filesize=0, bytecount = 0;
double val = 0.0;
try {
begin = System.currentTimeMillis();
// open the .pgem file stream
try {
binfile = new DataInputStream(new FileInputStream(getFname()));
} catch (Exception e) {
JOptionPane.showMessageDialog(new JFrame(), "File not Found. Try Again.", "Open File error", JOptionPane.ERROR_MESSAGE);
try {
File file = new File(getFname());
filesize = file.length();
} catch (Exception e) {
e.printStackTrace();
try {
// open the socket to socket on localhost
Socket socket = new Socket(getText(), port); // 1222 is TagBrowsers port
socket.setTcpNoDelay(true); // Disable TCP Nagle algorithm
socketOutputStream = new DataOutputStream(socket.getOutputStream());
} catch (UnknownHostException u) {
JOptionPane.showMessageDialog(new JFrame(), "Host Not Found. Defaulting to localhost", "Socket error", JOptionPane.ERROR_MESSAGE);
Socket socket = new Socket("localhost", 1222); // 1222 is TagBrowsers port
socket.setTcpNoDelay(true); // Disable TCP Nagle algorithm
socketOutputStream = new DataOutputStream(socket.getOutputStream());
bos = new BufferedOutputStream(socketOutputStream, 10000);
// loop copying file to output buffer until endfile
rate=rate/10;
start();
begin = System.currentTimeMillis();
//binfile.mark(500000000); <<<<<Tried to mark it here>>>>
for (int i=0;i<24;i++) {
buf[i] = binfile.readByte();
bytecount++;
time = ((buf[6] & 0xff) << 24) | ((buf[7] & 0xff) << 16) | ((buf[8] & 0xff) << 8) | (buf[9] & 0xff);
length = ((buf[14] & 0xff) << 8) | (buf[15] & 0xff);
for (int i=24;i<24+length;i++) {
buf[i] = binfile.readByte();
bytecount++;
prevtime = time;
try { // While !end of file
while (true && !stopXfer) {
while (prevtime == time) {
while (pause)
Thread.sleep(15);
bos.write(buf,0,24 + length);
prevtime = time;
for (int i=0;i<24;i++) {
buf[i] = binfile.readByte();
bytecount++;
time = ((buf[6] & 0xff) << 24) | ((buf[7] & 0xff) << 16) | ((buf[8] & 0xff) << 8) | (buf[9] & 0xff);
length = ((buf[14] & 0xff) << 8) | (buf[15] & 0xff);
for (int i=24;i<24+length;i++) {
buf[i] = binfile.readByte();
bytecount++;
/* if (rewind) {
binfile.reset(); <<<<Reset here>>>>>
rewind = false;
while (fastforward) {
binfile.skip(14);
bytecount+=24;
skipbytes[0] = binfile.readByte();
skipbytes[1] = binfile.readByte();
skiplength = ((skipbytes[0] & 0xff) << 8) | (skipbytes[1] & 0xff);
binfile.skip(8+skiplength);
bytecount+=10+length;
val = (double)(bytecount)/(double)(filesize);
updateDelayProgress((int)(val*100));
//System.out.println(bytecount);
// if times are out of order, flush buffer right away
if (time < prevtime || time==lastprevtime) {
period = 0;
bos.flush();
timecheck = prevtime;
prevtime = time;
if (lastprevtime > prevtime)
prevtime = lastprevtime;
period = (long) (time - prevtime);
try {
bos.flush();
stop();
if (period < elapsedTime || period > 750)
period=elapsedTime;
val = (double)(bytecount)/(double)(filesize);
updateDelayProgress((int)(val*100));
Thread.sleep((int)(rate*(period - elapsedTime)));
reset();
start();
} catch(InterruptedException ie){
System.out.println("Problem with thread");
System.exit(1);
prevtime = time;
lastprevtime = time;
timecheck = time;
} catch (EOFException e) {
} catch (SocketException s) {
System.out.println("Transmission ended");
} catch (Exception e) {
e.printStackTrace();
// Close input stream and display dialog with total duration of the read and transfer
try {
minutes = (((System.currentTimeMillis() - begin)/1000) / 60);
seconds = (((System.currentTimeMillis() - begin)/1000) % 60);
binfile.close();
bos.close();
JOptionPane.showMessageDialog(new TBCGUI(), "Read completed in " + minutes + " minutes, " + seconds + " seconds");
getFrame().validate();
} catch (Exception e) {
System.err.println(e);
e.printStackTrace();
} catch (Exception e) {}
} -
Sending Control-Z to Input Stream
Hi everyone,
I'm writing an interface to a command line program, and
one of it's features is that it will accept "forms" through
standard input. The default is that notepad will open
when the command is typed, and you can edit the form
through there.
To accept the form through standard input, you have to
send it the form, and then tell it the form is complete.
This is done using the CTRL-Z keypress, at least when
typing the form in with the keyboard.
I need to do this with Java.
There is another post which poses the same question at
http://forum.java.sun.com/thread.jsp?forum=1&thread=3050
so I attempted that solution.. and that didn't work.
I had the system print out the form as it was being written,
and the form displayed properly, followed by what was
supposed to be a CTRL-Z character, which appeared
on screen (DOS Window) as an arrow pointing right.
Here is the code constructing the form and adding what i've been told is "ctrl-z":
new StringBuffer(form+System.getProperty("line.separator")).append(CTRL_Z).append(System.getProperty("line.separator")))CTRL_Z is defined as:
public static final char CTRL_Z = 26;Does anyone have any other suggestions that might be able to help me?
If you need more information/code provided, I can do so.
Thanks for any help!
Kefka.You can't actually send anything to an input stream. But let's suppose you have an output stream somewhere that is connected to the standard input of this command line program. Try sending a byte, not a character, that contains 26 to it (yes, ctrl-z is indeed 26). This has a better chance of working than the character idea, because Java is going to translate your character-26 from Unicode to bytes using your system's default encoding. And I can't predict what that might end up as. But it will leave the byte 26 alone and just send it... I hope. Can't guarantee this.
-
How to get file input stream from the client machine by JSF Fileupload API?
Dear Friends,
How to get the file input stream from the client machine by JSF HtmlFileupload or fileupload API. At present, if i execute the file upload code in the client machine, it is able to get the local path of the file and looking for the file in server machine. So i am getting FileNotFoundException.
E.g., If a file is located at client machine at following location means "C:\Test\Test.txt",
uploadClass.getFileuploadComponent().getFilename().toString() returns "C:\Test\Test.txt". But it is looking for that file in server and throwing FileNotFoundException.
Please post your replies soon.
Thanks,
JPDepends on which version of JSF you're using. If JSF 1.2, I wouldn't even bother trying to hack this into JSF itself unless you can use something like Seam 2 or richfaces.
http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/rich_fileUpload.html
http://docs.jboss.org/seam/2.2.1.CR3/reference/en-US/html/controls.html#d0e29259 (look for s:fileUpload)
But if I were you, a simple non-jsf form with a servlet works best for taking file uploads.
As for JSF 2.0, there are other ways of getting it done.
http://balusc.blogspot.com/2009/12/uploading-files-with-jsf-20-and-servlet.html -
How to read a file as an input stream after it's posted in an HTML form ?
Hello,
I want to read client file after it's posted in an HTML form. But, I don't want to upload it to filesystem or database. I want to read posted file as an input stream. How can I do that ?
thanks in advance...A couple of things. If you have a FILE field in your form, the enctype of the form must be multipart/form-data. Check this link
http://www.htmlhelp.com/reference/html40/forms/form.html
Also, when a file is uploaded you cannot use the regular methods to get at the name/value pairs or the file itself. You'll have to use a utility like MultiPartRequest or write your own based on the RFC for Multipart requests.
http://www.servlets.com/cos/javadoc/com/oreilly/servlet/MultipartRequest.html
You will need some temporary file system to store this and then delete it when you are done with it.
hth -
JVM_recv in socket input stream error
I've opened a socket and I'm able to access the OutputStream. However, when I try to wrap a ObjectInputStream around the socket's InputStream, I get this error:
SocketException: Connection reset by peer: JVM_recv in socket input stream read.
What should I be looking for?
LarryHere's the code which appears to be relevant, with some commentary on what happens when it is run. Large portions of (hopefully) irrelevant code have been snipped.
Client:
COMMENT: Start a server using RMI. This appears to
COMMENT: succeed, since a message printed by this
COMMENT: server does appear.
try {
DistLrnRemoteData dlrd =
(DistLrnRemoteData)Naming.lookup(
"//"+personHost+
"/DistanceLearningData");
dlrd.activatePersonServer(); // Get server going
catch (Exception e) {
System.err.println(e);
COMMENT: This line is NOT printed, so apparently
COMMENT: there is no Exception.
System.err.println("Unable to initialize remote Person server");
e.printStackTrace(System.err);
Person result = new Person();
int count = 10;
boolean opened = false;
Socket gpsocket = null;
while (!opened) {
try {
COMMENT: The client attempts to open the socket
COMMENT: here. The server never seems to accept it,
COMMENT: but this call appears to succeed. There is
COMMENT: no Exception. The server is running code
COMMENT: from the class RemoteDataServer, so the
COMMENT: port should be the same. The testing was
COMMENT: done with a single host acting as both
COMMENT: client and server, so there isn't any firewall
COMMENT: or network outage problem.
gpsocket = new Socket(personHost,
RemoteDataServer.personReadPort);
opened = true;
catch (IOException ioe) {
count--;
if (count <= 0) {
COMMENT: This line is NOT printed, so apparently there
COMMENT: is no IOException when the Socket is
COMMENT: created. Nor does an UnknownHostException
COMMENT: or SecurityException stop the program.
System.err.println(ioe);
ioe.printStackTrace(System.err);
result = null;
return result;
try {
Thread.sleep(1000);
catch (InterruptedException ie) {
System.err.println(ie);
ie.printStackTrace(System.err);
// Read the serialized object
try {
COMMENT: No problem with the next line, which attempts
COMMENT: to access the OutputStream of the socket.
MyStringWriter msw = new MyStringWriter(
gpsocket.getOutputStream());
COMMENT: The next line causes the message.
ObjectInputStream ois =
new ObjectInputStream(gpsocket.getInputStream());
msw.write(personRealName);
// Now read the resulting Person.
try {
result = (Person)(ois.readObject());
catch (ClassNotFoundException cnfe) {
System.err.println(cnfe);
cnfe.printStackTrace(System.err);
System.exit(4);
catch (IOException ioe) {
System.err.println(ioe);
ioe.printStackTrace(System.err);
result = null;
Server:
public void activateFocusServer() throws java.rmi.RemoteException {
String [] cmd = new String[2];
cmd[0] = new String("java");
cmd[1] = new String("RemoteDataServer");
try {
COMMENT: FORTE's Output window shows a message
COMMENT: from this process
Process dbserver =
Runtime.getRuntime().exec(cmd); // Server will self-destruct
// after a timeout period
catch (IOException ioe) {
COMMENT: This message is never printed
System.err.println(ioe);
ioe.printStackTrace(System.err);
RemoteDataServer:
public RemoteDataServer() {
try {
...many different servers started here...
ServerSocket PersonReadSocket = new ServerSocket(personReadPort);
PersonReadListener prl = new PersonReadListener(PersonReadSocket);
prl.start();
catch (IOException ioe) {
COMMENT: This message is never printed.
System.err.println(ioe);
ioe.printStackTrace(System.err);
COMMENT: PersonReadListener is an inner class:
class PersonReadListener extends java.lang.Thread {
private Thread BaseThread;
private ServerSocket theSocket;
/** Creates an object to listen for PersonRead requests
* @param ss The server socket to listen with
public PersonReadListener(ServerSocket ss) {
theSocket = ss;
/** Initializes the thread to listen for PersonRead requests
public void start() {
BaseThread = new Thread(this);
BaseThread.start();
/** The code for the server to listen for PersonRead requests
public void run() {
while(true) {
try {
COMMENT: This code doesn't have access to System.err
COMMENT: so a file is created to print debugging output
PrintWriter debug = new PrintWriter(new FileWriter("person.debug"));
COMMENT: The next line IS printed, so the server gets
COMMENT: this far.
debug.println("Waiting for connection for person's name");
debug.close();
PersonReadClientConnection someone =
new PersonReadClientConnection(theSocket.accept());
COMMENT: If the previous "debug.close" line is
COMMENT: commented out and the next two lines are
COMMENT: uncommented, the next line is NOT
COMMENT: printed, so apparently the accept nevers
COMMENT: happens! Why does the accept fail, but
COMMENT: the client's socket creation succeed?
// debug.println("Accepted a connection");
// debug.close();
someone.start();
catch (IOException ioe) {
COMMENT: These lines are NOT printed
System.err.println(ioe);
ioe.printStackTrace(System.err); -
Io exception: Connection reset by peer: JVM_recv in socket input stream read
We are developing a new J2EE app using JDev, OC4J, servlets, and EJBs. We have determined that our firewall is closing database connections that have been idle for 1 hour. This is a security requirement that cannot be changed. When we try to use these idle connections in both stateless and entity beans, we consistently receive this or a similar error message:
"ServletSACategoryList: Error invoking EJB procedure. Exception: java.sql.SQLException: StatelessSysAdminBean::getCategoryList - Io exception: Connection reset by peer: JVM_recv in socket input stream read "
Environment:
Oracle 9iAS 9.0.2.0.0
Database: Oracle 8.1.7
JDBC 8.1.7
JDK 1.3
JDev 9.0.2.829
We are using the ejb-location attribute within data-sources.xml for JNDI lookup of the DataSource. Here is what this file looks like:
<data-sources>
<data-source
class="oracle.jdbc.pool.OracleDataSource"
name="jdbc/OracleDS"
location="jdbc/OracleCoreDS"
xa-location="jdbc/xa/OracleXADS"
ejb-location="jdbc/OraclePoolDS"
url="jdbc:oracle:thin:@###.###.#.###:1521:dev1"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="????????"
password="????????"
max-connections="4"
wait-timeout="20"
min-connections="1"
inactivity-timeout="60"
connection-retry-interval="1"
max-connect-attempts="3"
/>
</data-sources>
After calling getConnection() on the Connection object in my stateless bean, I have tried checking if the Connection object is null or isClosed(), I have caught any Exception, and looped to try again, but nothing has worked.
Please respond to [email protected] or directly to this post if you can help in any way.
Thank you,
- RobHi Robert,
If you don't mind, I can only offer a few suggestions for things
to try -- I'm afraid I don't have a solution for you. Of-course,
you may have already tried these things, so please excuse me if
this is the case.
Firstly, your "data-sources.xml" file looks "different". Have
you read the "Data Sources" chapter of the "Oracle9iAS Containers
for J2EE Services Guide, Release 2 (9.0.2)"? It is accessible
from here:
http://otn.oracle.com/docs/products/ias/doc_library/90200doc_otn/web.902/a95879/ds.htm#1004903
Also, have you tried running OC4J in "debug" mode? This web
page has more details:
http://kb.atlassian.com/content/atlassian/howto/orionproperties.jsp
I get the impression from the information you have supplied,
that you may not be explicitly closing your database connections
in your code. It looks to me like you are obtaining a database
connection in your session bean, and then keeping it for the
lifetime of that bean. Is that correct? I think it's better
to obtain a connection when you need to interact with the database,
and then close the connection immediately after completing the
interaction with the database (but that's just my opinion).
Lastly, if you haven't already discovered them, these web sites
may also be of help:
http://www.orionserver.com
http://www.orionsupport.com
http://www.elephantwalker.com
Hope this helps you.
Good Luck,
Avi.
Maybe you are looking for
-
Need to read Hex data format for Handheld device. (SAP AII RFID )
Hello, we developed a custom screens for packing, unpacking, tag commission.. etc for handheld device for my client. the Serial number field type is /ain/barcode. Its working fine. but for the new system need to read the Hex format. I created a new
-
Custom Duty is a part of costing of an item
Hi Experts, How can i enter the custom duty in the GRPO and Invoice , make it a part of item cost but not credit the Vendor account.(custom would be a part of item cost). Regards
-
Photo Booth and Stickies?
I just updated to the Snow Leopard and now my Photo Booth and Stickies say that I can't use their version with this update. I've gone searching in the App store and looked around on the Apple site and can't seem to find the updates for these 2 progra
-
Wireless not working, iPhone 4S, upgraded to OS6, any suggestions?
wireless not working, iPhone 4S, upgraded to OS6, any suggestions?
-
Hi, I'm little bit confused about what Javacard programmer do, when his code raises an exception. I mean, when it happens in JavaSE, it's very simple to see exception reason with getStackTrace() or getMessage(). but JavaCard's Exception class does no