Oracle Blob using Java help (Error: JVM_recv in socket input stream read )
I am trying to insert a record with Blob column (size of image 'mg.jpg' about 15KB) and I get the runtime error:
[java] java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read
[java] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
[java] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
[java] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
[java] at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2061)
[java] at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
[java] at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
[java] at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
[java] at test.ProvisioningParser.TestBlob.main(Unknown Source)
This is what code looks like: I am not sure what's wrong, any help appreciated. Thanks!
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("jdbc:oracle:thin:@VALUED-20606295:1521:dbbook","jvending","jvending");
java.util.zip.ZipInputStream zip = new java.util.zip.ZipInputStream(new java.io.FileInputStream(new java.io.File("D:\\work\\mywork\\source\\test\\ProvisioningParser\\test.par"))) ;
int len = 0 ;
java.util.zip.ZipEntry entry = null;
do{
entry = zip.getNextEntry();
if (entry != null){
if (entry.getName().equalsIgnoreCase("mg.jpg")){
len = (int)entry.getSize();
break;
}while(entry!=null) ;
stmt = con.prepareStatement( "Insert into icon (parid, clientbundleid, id, iconfile ) values ( ?,?,?,?)"
stmt.setString(1,"101");
stmt.setString(2,"101");
stmt.setInt(3,1);
stmt.setBinaryStream( 4, zip, len);
stmt.setQueryTimeout(0);
stmt.executeUpdate();
con.close();
catch(Exception e){
e.printStackTrace();
}Thanks,
Rashmi
As a guess what you are doing with that zip stuff is very odd.
You do realize that it is just going to put some binary data into the blob right? And the methods that is going to use will not necessarily create a 'complete' zip file?
If you want a zip file then just load the file, dont use the zip classes.
And if you want part of a zip file, (and want to store the parts as a zip) then extract it from the file and create another zip entity using a byte stream rather than a file.
Finally I suspect your error with the blob occurs because you do not close the statement. But at any rate you should figure out how to do the blob code independent of the zip stuff.
And what oracle driver version are you using? Some of the older ones need oracle specific handling for blobs.
Similar Messages
-
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. -
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 -
IOException: Connection reset by peer: JVM_recv in socket input stream read
hi
I encountered a problem : a program throw out an exception:java.io.IOException: Io exception:
Connection reset by peer: JVM_recv in socket input stream read.
I tried my best to resolve it ,but unfortunately,i didn't know what caused the exception.
the following is my application environment:
I have two PC(Win2000os),one is a server which installed oracle9.2.0.2 and jdeveloper9.0.3,the another is a
client which only intalled jdeveloper9.0.3.Two days ago,i performed a web application on my client with
jdeveloper,and it includes some JSP and a javabean files.JSP Page finished uploading client xml file to a
folder on server and the javabean finished loading the xml file into a xmltype column.I can make sure the
connection is established and the javabean is OK,beacause my some jsp page can successfully use
<jsp:usebean> tag and use the javabean's some other public interfaces,except the interface that finishs
loading the xml file into a xmltype(clob) column.
Then i do many tests!I changed the javabean to a java class incluse a main method beacause it is easy to
debug.Finally i found the following code caused the exception:
public CLOB writetoClob( CLOB clob, InputStream is )throws SQLException, IOException {
InputStreamReader reader = new InputStreamReader( is );
Writer writer = clob.getCharacterOutputStream( );
char[] buffer = new char[clob.getChunkSize( )];
int charsRead;
for ( charsRead = reader.read( buffer ); charsRead > -1;charsRead = reader.read( buffer ) ) {
writer.write( buffer, 0, charsRead );
writer.close();
return clob;
when it runs to writer.close(),the exception is caused!
Then i copy the java class to the server,it runs ok!
That is to say ,the same code,the different result!
But when i run my web application on server with jdeveloper Embedded OC4J Server and a jsp page loaded javabean
and run to mentioned code ,the same exception occured!
I checked the application log in event viewer,the descriptions was:
The data buffer created for the "AppleTalk" service in the "C:\WINNT\system32\atkctrs.dll" library is not
aligned on an 8-byte boundary. This may cause problems for applications that are trying to read the
performance data buffer. Contact the manufacturer of this library or service to have this problem corrected or
to get a newer version of this library.
I search some some resolution about this exception with web and someone sayed :
This basically means that a network error occurred while the client was receiving data from the server. But
what is really happening is that the server actually accepts the connection, processes the request, and sends a
reply to the client. However, when the server closes the socket, the client believes that the connection has
been terminated abnormally because the socket implementation sends a TCP reset segment telling the client to
throw away the data and report an error.
Sometimes, this problem is caused by not properly closing the input/output streams and the socket connection.
Make sure you close the input/output streams and socket connection properly. If everything is closed properly,
however, and the problem persists, you can work around it by adding Thread.sleep(1000) before closing the
streams and the socket. This technique, however, is not reliable and may not work on all systems.
In general,the following information is conclution:
Web application runs error both on client and on server.
If it was changed to a client java class,it only run ok on server!
i have done anything that i can do now,i feel depressed very much!
how can i resolve the problem!
Any a little help will be appreciated!
regards!
Thanks
Jiawei ZHAOHow can i solve the problem.
Thanks in advance!
Jiawei Zhao -
JDBC Connection reset by peer: JVM_recv in socket input stream read
Hey Guys,
Has anyone seen this issue? We get this error in our Weblogic app logs at times and no one is able to login to our application. Our database server and SQL server seem fine at a high level. Any ideas what is causing this?
com.s1.arch.persistence.exception.PersistenceException weblogic.jdbc.mssqlserver4.TdsException: I/O exception while talking to the server, java.net.SocketException: Connection reset by peer: JVM_recv in socket input stream read
Thanksplease make sure that there is no Firewall between your servers and DB server. this message usually happen when there is a fire wall between the servers. if yes please make sure that the connection time on fire wall is longer than the time needed to complete an operation another thing that you need to check if you have a fire wall which is to make sure that Oracle DBMS return the request to the same port that it is listening to (1521 default).
-
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) -
Connection reset by peer: JVM_recv in socket input stream read
Dear All,
We are facing a very unusual problem. In our application, there is a functionality to transfer files to a FTP server using java FTPClient.
Now while transferring set of files, few times it throws the error:
Connection reset by peer: JVM_recv in socket input stream read
This error comes irregularly.
Can you suggest the reason for this.
Regards,
Akhilwhich platform are you using? which ip stack , ipv4 or ipv6?
try to set -Djava.net.preferIPv4Stack="true" when startup,
it will use ipv4 stack instead of default ipv6 on solaris. -
JVM_recv in socket input stream read
I have Oracle 8.0.5.0 and can connect if I use SQL-Worksheet etc..
When I try to connect using java I get an error:
JVM_rec in socket input stream read...
I'm usind JDK1.2.2 and classes111.zip...
Strange thing is that on another box with the same setup, everything works....
Any ideas???I don't see any know reproducable bugs on this, but does this reproduce with 9.0.5.2 of JDeveloper? The error simply means that the connection between the database and the jdbc driver got cut before the driver thought it should end.
Rob
Team JDev -
SocketException during reads - JVM_recv in socket input stream read
I am getting a SocketException when a Java applet talks to our
WebLogic 7.0 server. The catch is that it only occurs at one site
(that has very high T1 utilization, although latency is only ~60 ms)
Our setup is such that the calls hit an Alteon load balancer, which
then sends the request out to one of 4 IIS clustered servers, where it
then is sent to one of 2 WL clustered servers. I figured latency
would be the cause, but on IIS and on WL, the timeouts are set to
several hundred seconds, so I am not quite seeing where the connection
is being reset. To be honest, I really don't know if it is WL that is
killing the connection, as nothing abnormal shows up in the WL log. I
have seen similar problems in this group, though, although the stack
traces never follow the same path mine does. I do have the following
call stack from the Java plug-in console, though. Any ideas would be
greatly appreciated.
java.net.SocketException: Connection reset by peer: JVM_recv in socket
input stream read
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source)
at sun.plugin.net.protocol.http.HttpURLConnection.getInputStream(Unknown
Source)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderFields(Unknown
Source)
at sun.plugin.net.protocol.http.HttpURLConnection.checkCookieHeader(Unknown
Source)
at sun.plugin.net.protocol.http.HttpURLConnection.getInputStream(Unknown
Source)
at org.xxxx.abstracts.Controller.sendRequest(Controller.java:39)
at org.xxxx.data.DataMediator.getDataNode(DataMediator.java:46)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Also, here is my code, although I can't see anything on the client
side that seems off:
public Object sendRequest( Object request, URL receiver ) throws
Exception{
Object response = null;
URLConnection con = null;
ObjectOutputStream out = null;
ObjectInputStream in = null;
try {
con = receiver.openConnection();
con.setDoInput(true);
con.setDoOutput(true);
con.setUseCaches(false);
con.setDefaultUseCaches(false);
con.setAllowUserInteraction(false);
out = new ObjectOutputStream(con.getOutputStream());
out.writeObject(request);
out.flush();
out.close();
in = new ObjectInputStream(con.getInputStream());
response = in.readObject();
in.close();
} catch (ClassCastException e) {
if( out != null ){
out.close();
if( in != null ){
in.close();
} catch (Exception e) {
if( out != null ){
out.close();
if( in != null ){
in.close();
throw e;
return response;There is a known bug on earlier 1.3.1 releases with sockets on Windows 2k
and XP. I don't remember all the details.
Peace,
Cameron Purdy
Tangosol, Inc.
http://www.tangosol.com/coherence.jsp
Tangosol Coherence: Clustered Replicated Cache for Weblogic
"Keith Patrick" <[email protected]> wrote in message
news:[email protected]...
I'm getting the exception on the client, which is an XP machine, while
the server is Win2K. I can't recall which, but either the applet or
the server runs 1.3x while the other runs 1.4. I discounted that
factor, though, as the problem only occurs on one site, which on all
others it works fine.
"Cameron Purdy" <[email protected]> wrote in message
news:<[email protected]>...
Exception is in the applet or on the server?
Would one of those by any chance be running on W2K with JDK 131_01 orolder?
>>
Peace,
Cameron Purdy
Tangosol, Inc.
http://www.tangosol.com/coherence.jsp
Tangosol Coherence: Clustered Replicated Cache for Weblogic
"Keith Patrick" <[email protected]> wrote in message
news:[email protected]...
I am getting a SocketException when a Java applet talks to our
WebLogic 7.0 server. The catch is that it only occurs at one site
(that has very high T1 utilization, although latency is only ~60 ms)
Our setup is such that the calls hit an Alteon load balancer, which
then sends the request out to one of 4 IIS clustered servers, where it
then is sent to one of 2 WL clustered servers. I figured latency
would be the cause, but on IIS and on WL, the timeouts are set to
several hundred seconds, so I am not quite seeing where the connection
is being reset. To be honest, I really don't know if it is WL that is
killing the connection, as nothing abnormal shows up in the WL log. I
have seen similar problems in this group, though, although the stack
traces never follow the same path mine does. I do have the following
call stack from the Java plug-in console, though. Any ideas would be
greatly appreciated.
java.net.SocketException: Connection reset by peer: JVM_recv in socket
input stream read
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source)
at
sun.plugin.net.protocol.http.HttpURLConnection.getInputStream(Unknown
Source)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderFields(Unknown
Source)
atsun.plugin.net.protocol.http.HttpURLConnection.checkCookieHeader(Unknown
Source)
atsun.plugin.net.protocol.http.HttpURLConnection.getInputStream(Unknown
Source)
at org.xxxx.abstracts.Controller.sendRequest(Controller.java:39)
at org.xxxx.data.DataMediator.getDataNode(DataMediator.java:46)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Also, here is my code, although I can't see anything on the client
side that seems off:
public Object sendRequest( Object request, URL receiver ) throws
Exception{
Object response = null;
URLConnection con = null;
ObjectOutputStream out = null;
ObjectInputStream in = null;
try {
con = receiver.openConnection();
con.setDoInput(true);
con.setDoOutput(true);
con.setUseCaches(false);
con.setDefaultUseCaches(false);
con.setAllowUserInteraction(false);
out = new ObjectOutputStream(con.getOutputStream());
out.writeObject(request);
out.flush();
out.close();
in = new ObjectInputStream(con.getInputStream());
response = in.readObject();
in.close();
} catch (ClassCastException e) {
if( out != null ){
out.close();
if( in != null ){
in.close();
} catch (Exception e) {
if( out != null ){
out.close();
if( in != null ){
in.close();
throw e;
return response; -
JVM_recv in socket input stream read (code=10004)
Whilst trying to get a file listing from an FTP server (by sending FTP commands directly to the server according to RFC959)
I got..
JVM_recv in socket input stream read (code=10004)
What does this mean? Any idea why it is caused, the socket should be open as far as I am concerned - could something external be affecting it?Platform/JVM? I'd guess Windows - 10004 looks like WSAEINTR, from WinSock. (Here's some specifics that may help:
http://support.ipswitch.com/kb/WSK-19980714-EM08.htm ) -
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); -
How To Store pdf or doc file in Oracle Database using Java Jdbc?
can any one help me out How To Store pdf or doc file in Oracle Database using Java Jdbc in JSP/Serlet? i tried like anything. using blob also i tried. but i am able 2 store images in DB not files. please if u know or else if u have some code like this plz send that to me, and help me out plz. i need that urgent.
Hi.. i am not getting error, But i am not getting the original contents from my file. i am getting all ASCII vales, instead of my original data. here i am including my code.
for Adding PDF in DB i used image.jsp
Database table structure (table name. pictures )
Name Null? Type
ID NOT NULL NUMBER(11)
IMAGE BLOB
<%@ page language="java" import="java.util.*,java.sql.*,java.io.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.135:1521:orcl","scott","tiger");
PreparedStatement ps,pstmt,psmnt;
ps = con.prepareStatement("INSERT INTO pictures VALUES(?,?)");
File file =
new File("D:/info.pdf");
FileInputStream fs = new FileInputStream(file);
ps.setInt(1,4);
ps.setBinaryStream(2,fs,fs.available());
int i = ps.executeUpdate();
if(i!=0){
out.println("<h2>PDF inserted successfully");
else{
out.println("<h2>Problem in image insertion");
catch(Exception e){
out.println("<h2>Failed Due To "+e);
%>
O/P: PDF inserted successfully
i tried to display that pdf using servlet. i am giving the code below.
import java.io.IOException;
import java.sql.*;
import java.io.*;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class DispPDF extends HttpServlet {
* The doGet method of the servlet. <br>
* This method is called when a form has its tag value method equals to get.
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
public void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
//response.setContentType("text/html"); i commented. coz we cant use response two times.
//PrintWriter out = response.getWriter();
try{
InputStream sPdf;
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.135:1521:orcl","scott","tiger");
PreparedStatement ps,pstmt,psmnt;
psmnt = con.prepareStatement("SELECT image FROM pictures WHERE id = ?");
psmnt.setString(1, "4"); // here integer number '4' is image id from the table.
ResultSet rs = psmnt.executeQuery();
if(rs.next()) {
byte[] bytearray = new byte[1048576];
//out.println(bytearray);
int size=0;
sPdf = rs.getBinaryStream(1);
response.reset();
response.setContentType("application/pdf");
while((size=sPdf.read(bytearray))!= -1 ){
//out.println(size);
response.getOutputStream().write(bytearray,0,size);
catch(Exception e){
System.out.println("Failed Due To "+e);
//out.println("<h2>Failed Due To "+e);
//out.close();
OP
PDF-1.4 %âãÏÓ 2 0 obj <>stream x+är á26S°00SIá2PÐ5´1ôÝ BÒ¸4Ü2KüsSSS4C²ê Pkø$VãGÒU×713CkW )(Ü endstream endobj 4 0 obj <>>>/MediaBox[0 0 595 842]>> endobj 1 0 obj <> endobj 3 0 obj <> endobj 5 0 obj <> endobj 6 0 obj <> endobj xref 0 7 0000000000 65535 f 0000000325 00000 n 0000000015 00000 n 0000000413 00000 n 0000000168 00000 n 0000000464 00000 n 0000000509 00000 n trailer <<01b2fa8b70ac262bfa939cc786f8770c>]/Root 5 0 R/Size 7/Info 6 0 R>> startxref 641 %%EOF
plz help me out. -
XSLT Mapping : RFC Lookup using java helper class
Hi All,
I am doing RFC Lookup in xslt mapping using java helper class. I have found blog for the same (http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/05a3d62e-0a01-0010-14bc-adc8efd4ee14) However this blog is very advanced.
Can anybody help me with step by step approach for the same?
My basic questions are not answered in the blog as:
1) where to add the jar file of the java class used in xslt mapping.
I have added zip file of XSLT mapping in imported archived and using that in mapping.
Thanks in advace.
Regards,
RohanHi,
Can u please have look at this in detail , u can easily point out yourself the problem...
http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/content.htm
Please observe the line,
xmlns:javamap="java:com.company.group.MappingClass
in XSLT mapping..
The packagename of class and class name and XSLT namespace should be matching...
Babu
Edited by: hlbabu123 on Sep 29, 2010 6:04 PM -
Oracle developer needs Java help
I develop applications in Oracle 8i on NT4. As part of a trigger, I need to perform an update to an extremely large table which takes many minutes. Because it's tied to a web page, I can't wait for the update to complete. Oracle natively doesn't support system calls -- I use the Shell() command in VB -- but Oracle DOES support Java stored procedures. I'm hoping that a Java stored procedure will be able to spawn/execute a new process/program specified by a command line instruction (ie: "C:\SQLPLUS.EXE SCOTT/TIGER @update.sql") and return immediately - without waiting for the process to complete. There doesn't need to be any handle for or call back from the process - just fire and forget. Can anyone provide me some direction, or better some existing Java code that does this? THANKS!
Hi "todmcg",
I'm not sure that I have understood your question correctly, but here goes anyway...
Yes you can create a java stored procedure and have a trigger execute that procedure. In order to execute system commands in java, you usually use the "exec()" method of class "java.lang.Runtime". It is also easy to spawn new threads using java. So yes, you can have your java stored procedure execute a system command in a background thread.
In my opinion, the Oracle documentation explains very well how to create a java stored procedure. The documentation is available from:
http://tahiti.oracle.com
Also, examples of how to call system commands from java stored procedures are available at this Web site:
http://asktom.oracle.com
You may also find relevant information at:
http://metalink.oracle.com
and
http://technet.oracle.com
Of-course, you can also use JDBC from your java stored procedure to execute your "update.sql" script -- without the need to execute a system command.
Basic code skeleton:
[NOTE: Untested and may contain syntax errors.]
public class SystemCommand implements Runnable {
private static String cmd;
public void run() {
Runtime runtime = Runtime.getRuntime();
runtime.exec(cmd);
public static void execCommand(String cmd) {
this.cmd = cmd;
new Thread(new SystemCommand()).start();
}Hope this helps you.
Good Luck,
Avi. -
Running unix command using java shows error
Hi All,
I am trying to run UNIX move command using Java exec method but its throwing error, unable to rename. Here below is the code i am trying to run to move all files from one directory to another directory. source and destination directory exists.
public class Demo
public static void main(String args[])
try
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec("mv /home/demo1/* /home/demo2");
int exitVal = proc.waitFor();
System.out.println("Process exitValue: " + exitVal);
} catch (Throwable t)
t.printStackTrace();
}if i give "mv /home/demo1 /home/demo2" in exec method, its working, with * character its giving problem.
Please help me in resolving the problem.
Thank youCharacters like *, >, &, |, etc. are interpreted by the command shell--that is by the bash, zsh, etc. programs. When you execute a command with ProcessBuilder or Runtime.exec, you're not going through one of those shells, so their interpretation of those characters is not available.
In your code, the character * is being delivered directly to the mv command (which doesn't think * is anything special), as opposed to being turned into a list of files and directories as it would be when it's interpreted by the shell. The mv command doesn't know anything about the * character being special.
If you want to have those shell interpretations, you need to execute the command through a shell. One example is like so, but a) you'll want to read up on the methods in exec() that take arrays of String, and b) you'll want to read up on ProcessBuilder, and c) you'll need to check your shell's man pages to see the exact syntax and arguments.
runtime.exec("/bin/bash -c 'mv x/* y'");
Maybe you are looking for
-
Intermittent Non-Fatal Lock Ups
Once every other day or so my Christmas 2008 MBP (10.5.8 / 2.53 GHz Core 2 Duo / 4GB DDR3) with the ~300GB 5,400 rpm HDD locks up. When I'm using the computer (not that hard) about 5 open Safari tabs, iTunes, Word08, Stickies and preview open the com
-
Itunes won't install drivers to import and burn cd's
it refuses to. i have no idea why. i have the latest version. i don't have any other cd burning software. i have unstalled and reinstalled. does anyone have an idea why? i am very frustrated! Windows XP
-
Can't install any .PKG or .MPKG files with Mountain Lion.
Some weeks ago I found out, that I can't install anymore any programmes that are packed in .PKG or .MPKG files. Whenever I double click one of theese files, or when I try the "open with" option, I get a system response from TextEdit.App . . . I tried
-
Custom RSS file from XMP metadata
I am attempting to create a custom RSS file (.mrss) that references XMP metadata from Premiere. The CDN that we use references that RSS file in order to publish all of our uploaded assets correctly, and if I could automate that process it would save
-
What is the t.code of accounting key creation in TAX
hi all anybody can tell me what is the t.code of accounting key creation in TAX regards kalai