• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

NullPointerException while trying to get BLOB object

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic