cancel
Showing results for 
Search instead for 
Did you mean: 

TDS JDBC Null Pointer Exception

0 Kudos
2,037

Hi,

We have an application using Sybase ASA 7 and we access the database from a Java JDBC connection. Occassionally we see a Null Pointer Exception being kicked out by the JDBC driver reporting something about a TDS error. The following is what is reported but we have no idea where to start looking. It is having a significant effect on our application:

java.lang.NullPointerException: 
Aug 31 09:43:51 2011:   at com.sybase.timedio.InStreamMgr.moreData(InStreamMgr.java)
Aug 31 09:43:51 2011:   at com.sybase.timedio.Dbio.doRead(Dbio.java)
Aug 31 09:43:51 2011:   at com.sybase.timedio.InStreamMgr.readIfOwner(InStreamMgr.java)
Aug 31 09:43:51 2011:   at com.sybase.timedio.InStreamMgr.doRead(InStreamMgr.java)
Aug 31 09:43:51 2011:   at com.sybase.tds.TdsProtocolContext.getChunk(TdsProtocolContext.java)
Aug 31 09:43:51 2011:   at com.sybase.tds.PduInputFormatter.readPacket(PduInputFormatter.java)
Aug 31 09:43:51 2011:   at com.sybase.tds.PduInputFormatter.read(PduInputFormatter.java)
Aug 31 09:43:51 2011:   at com.sybase.tds.TdsInputStream.read(TdsInputStream.java)
Aug 31 09:43:51 2011:   at com.sybase.tds.TdsInputStream.readUnsignedByte(TdsInputStream.java)
Aug 31 09:43:51 2011:   at com.sybase.tds.Tds.nextResult(Tds.java)
Aug 31 09:43:51 2011:   at com.sybase.jdbc.ResultGetter.nextResult(ResultGetter.java)
Aug 31 09:43:51 2011:   at com.sybase.jdbc.SybStatement.nextResult(SybStatement.java)
Aug 31 09:43:51 2011:   at com.sybase.jdbc.SybStatement.queryLoop(SybStatement.java)
Aug 31 09:43:51 2011:   at com.sybase.jdbc.SybCallableStatement.executeQuery(SybCallableStatement.java)
Aug 31 09:43:51 2011:   at com.sybase.jdbc.SybConnection.isClosed(SybConnection.java)
Aug 31 09:43:51 2011:   at powersoft.powerj.db.java_sql.Transaction.isConnected(Transaction.java)
Aug 31 09:43:51 2011:   at digtrack.digtrackpkg.TicketBean.getTicket(TicketBean.java)
Aug 31 09:43:51 2011:   at digtrack.digtrackpkg._sk_digtrackpkg_Ticket.invoke(_sk_digtrackpkg_Ticket.java:308)

Has anyone ever run into this before? It doesn't look like anything in our code that causes this. We call the DB out of a Java Jaguar (gulp) component.

jeff_albion
Advisor
Advisor
0 Kudos

From the stack trace, it seems that you're using jConnect and calling "Connection.isClosed()" from your code.

The error arises due to the fact that in order for the jConnect driver to execute the "isClosed()" functionality, it has issued a "SELECT" (against the jConnect metadata system information) on the SQL Anywhere database server. While reading from this internal result set, there was a NullPointerException thrown.


Support for SQL Anywhere 7 has been end-of-life'd, as has the support for jConnect 4.5/5.5 (which was the version of jConnect released with ASA 7), so your options to pursue this issue may be limited.

Which exact version of SQL Anywhere (dbsrv7 -v) are you using? Which version of jConnect?

Accepted Solutions (0)

Answers (0)