Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NullPointerException while trying to get BLOB object

 
Sachin Deokar
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a pdf file stored in Oracle DB as a Blob and trying to retrieve using a TO. I have copied below the setter and getter method from the TO and also the logs.

Could you please help me try to figure out why am I getting a NullPointerException.

As you can see in the logs the setter method stores the blob object and prints the size as 30. The getter method passes the null check and prints the object.toString() but when it comes to this.docBlob.length() an exception is thrown.

Also, to add flex calls a servlet which calls a spring service to get the pdf from the database. The TO with pdf populated from DB is returned by the service method to the servlet.

Thanks in advance.


Logs:


Regards,
Sachin Deokar
 
Rob Spoor
Sheriff
Pie
Posts: 20669
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you close the result set that produced the Blob object? Because the Blob may need it.
 
Sachin Deokar
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Spring's DAORowmapper to populate the TO from resultset which I believe cloeses the resultset as well.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic