File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Io exception: Invalid Packet Lenght Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Io exception: Invalid Packet Lenght" Watch "Io exception: Invalid Packet Lenght" New topic
Author

Io exception: Invalid Packet Lenght

Monty Guppy
Ranch Hand

Joined: Sep 15, 2001
Posts: 49
Hi,
I am doing multitreading when running Weblogic on Unix. While connecting to Oracle (9i running on UNIX), I get the above exception (note the incorrect spelling). It happens intermittently, and is generally seen when a second thread is started before the first one is released. Basically I execute a Stored Proc, but when this exception occurs, it results in the truncating of the number of records returned by the first thread.
Here is some code snippet:
public final static Connection getOracleConnection()
{
java.sql.Connection oracleConnection = null;Context ctx = null;
Hashtable ht = new Hashtable();SQLEngine sqlEngine = new SQLEngine();
ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
try {
ctx = new InitialContext(ht);
DataSource ds = (DataSource) ctx.lookup ("java:comp/env/rptx\\oradb");
oracleConnection = ds.getConnection();
}catch
-----
I call the connection through my thread like this.....
java.sql.Connection connection = null;
connection = SQLEngine.getOracleConnection();
--------------
John Haselden
Greenhorn

Joined: Feb 26, 2004
Posts: 1
I've had an identical problem (same typo also) and it appears to be caused by using an incorrect driver: ie using an Oracle 8i driver against a 9i database.
Raghu Shree
Ranch Hand

Joined: Mar 18, 2005
Posts: 143
Hi,
I also have exactly same problem. But I can't find a solution.
Please give me your solutions.

Regds
Raghu


Raghu J<br />SCJP 1.4<br /> <br />The Wind and waters are always<br />on the side of the ablest navigators.<br /><a href="http://groups.yahoo.com/group/scjp_share" target="_blank" rel="nofollow">SCJP Group</a><br /><a href="http://groups.yahoo.com/group/JavaBeat_SCWCD" target="_blank" rel="nofollow">SCWCD Group</a>
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Io exception: Invalid Packet Lenght
 
Similar Threads
JNDI problems
Io exception: Invalid Packet Lenght
DataSource objects caching
NameNotFoundException ??
Oracle JDBC connection using JNDI lookup