6 Replies Latest reply: Aug 23, 2012 2:17 AM by 957439 RSS

    java.sql.SQLRecoverableException Io exception Size Data Unit (SDU) mismatch

    810581

      Hi,


      I'm using database Oracle RAC 11.1.0.7 (2-nodes), tomcat 6.0.20 with jdbc driver in version 11.1.0.7.

      Failover connection from tomcat to 2-nodes database works fine except one "special" case.
      Tomcat application started to loose connection because of SDU mismatch.
      After that tomcat was trying to reconnect to database. This operation has failed.
      Number of procceses at database has reached maximum and only restart of tomcat helped to solve a problem.

      Below I sent all details:

      W-2010-11-02 13:16:17.557: Failed to send trade report update:Connection is closed
      I-2010-11-02 13:16:17.557: Failed to process trade reports: Exception IO: Size Data Unit (SDU) mismatch
      java.sql.SQLRecoverableException: Exception IO: Size Data Unit (SDU) mismatch
      at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:101)
      at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:521)
      at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:791)
      at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:855)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
      at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1377)
      at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:387)
      at om.face.gateway.tradereport.TradeReportDatabase.spTradeReportCollGet(TradeReportDatabase.java:763)
      at om.face.gateway.tradereport.TradeReportMatcher.getOutgoingPendingTradeReports(TradeReportMatcher.java:318)
      at om.face.gateway.tradereport.TradeReportMatcher.matchTradeReports(TradeReportMatcher.java:85)
      at om.face.gateway.tradereport.TradeReportMatcher.process(TradeReportMatcher.java:61)
      at om.util.AbstractProcess.run(AbstractProcess.java:88)
      at java.lang.Thread.run(Unknown Source)
      Caused by: oracle.net.ns.NetException: Size Data Unit (SDU) mismatch
      at oracle.net.ns.Packet.receive(Packet.java:264)
      at oracle.net.ns.DataPacket.receive(DataPacket.java:92)
      at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:172)
      at oracle.net.ns.NetInputStream.read(NetInputStream.java:117)
      at oracle.net.ns.NetInputStream.read(NetInputStream.java:92)
      at oracle.net.ns.NetInputStream.read(NetInputStream.java:77)
      at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1034)
      at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1010)
      at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:588)
      at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:183)
      at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:780)
      ... 10 more

      Thank you in advise for help

      Ana

        • 1. Re: java.sql.SQLRecoverableException Io exception Size Data Unit (SDU) mismatch
          833049
          We start seeing the same error after recent JDBC driver upgrade to ojdbc6.jar, implementation-version 11.2.0.2.0. We are using Oracle 10g Enterprise Edition Release 10.2.0.4.0, JBoss 4.0.5, and JDK 1.6.

          The error occurs a couple of times per day. Sometimes it is followed with three other exceptions,
          java.sql.SQLRecoverableException: IO Error: Invalid Packet Lenght
          java.sql.SQLRecoverableException: IO Error: Bad packet type
          java.sql.SQLRecoverableException: Closed Connection

          I've checked library and classpath and I don't find conflict settings. Does anyone have some idea why it happens?

          Thanks,
          Jeff

          Edited by: user1016739 on Jan 20, 2011 5:28 PM

          Edited by: user1016739 on Jan 20, 2011 5:35 PM
          • 2. Re: java.sql.SQLRecoverableException Io exception Size Data Unit (SDU) mismatch
            838377
            the same exception occurs to me as well. seems it occurs randomly, i.e. not all the time. i'm using ojdbc6.jar. if you found a solution can you please share it with us?
            thanks.
            • 3. Re: java.sql.SQLRecoverableException Io exception Size Data Unit (SDU) mismatch
              Joe Weinstein-Oracle
              Someone needs to open an official Oracle thin driver support case.
              • 4. Re: java.sql.SQLRecoverableException Io exception Size Data Unit (SDU) mismatch
                836548
                Hope this below links helps you :

                http://www.vamsipavan.com/blog/javasqlsqlexception-io-exception-invalid-packet-lenght/
                • 5. Re: java.sql.SQLRecoverableException Io exception Size Data Unit (SDU) mismatch
                  863042
                  This error can be misleading, we saw this issue with the SQL that was being used,
                  recheck the sql string being sent and if there is a semi colon try removing it,

                  Using JDK 1.6
                  JDBC 11.1.0.7


                  Example below causes the error:

                  String testquery="select count(distinct users) from userstable where userid = ‘1’ ; ”;
                  Statement stmt = conn.createStatement();
                  ResultSet rset = stmt.executeQuery(testquery);


                  This fixes it:

                  String testquery="select count(distinct users) from userstable where userid = ‘1’ ”;
                  Statement stmt = conn.createStatement();
                  ResultSet rset = stmt.executeQuery(testquery);

                  Another Example below causes the error:

                  String testquery="select select count(distinct users) from userstable where userid = ‘1’ ; ”;
                  Statement stmt = conn.createStatement();
                  ResultSet rset = stmt.executeQuery(testquery);
                  • 6. Re: java.sql.SQLRecoverableException Io exception Size Data Unit (SDU) mismatch
                    957439
                    Hi

                    I faced similar issue ,

                    I was using java 6 , ojdbc6.jar - and my simple application to connect to db on my 32 bit machine worked fine .

                    On deployment of same code on AWS-EC2 machine (64 bit , Ubuntu 12.4) , I got this error


                    java -jar oraconnect.jar
                    java.sql.SQLException: Size Data Unit (SDU) mismatch
                    java.sql.SQLException: Size Data Unit (SDU) mismatch
                    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:412)
                    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531)
                    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221)
                    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
                    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
                    at java.sql.DriverManager.getConnection(DriverManager.java:582)
                    at java.sql.DriverManager.getConnection(DriverManager.java:185)
                    at com.impetus.basic.aerisOraConnect.main(aerisOraConnect.java:15)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:597)
                    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
                    Caused by: oracle.net.ns.NetException: Size Data Unit (SDU) mismatch
                    at oracle.net.ns.Packet.processHeader(Packet.java:359)
                    at oracle.net.ns.Packet.receive(Packet.java:293)
                    at oracle.net.ns.DataPacket.receive(DataPacket.java:103)
                    at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:230)
                    at oracle.net.ns.NetInputStream.read(NetInputStream.java:175)
                    at oracle.net.ns.NetInputStream.read(NetInputStream.java:100)
                    at oracle.net.ns.NetInputStream.read(NetInputStream.java:85)
                    at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:122)
                    at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:78)
                    at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1179)
                    at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1155)
                    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:279)
                    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
                    at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:366)
                    at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:752)
                    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:359)
                    ... 12 more


                    My oracle is

                    Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
                    With the Partitioning, OLAP and Oracle Data Mining options
                    JServer Release 9.2.0.7.0 - Production


                    I was able to get around by using classes12.jar instead of ojdbc6.jar

                    Thanks
                    Shilpi