Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SAXReader.readStream error - 'Nested exception: null'

 
Rajesh So
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have to deal with a strange error.

The XML file (Request file) is read from a FTP using SAXReader.readStream(ftpDirectory, filename);

The production system throws the following error. This error occurs only in rare circumstances. We don't know at what circumstance this error happens, except that the request XML file has a file size of 692736 bytes.
org.dom4j.DocumentException has a message 'Nested exception: null'. The developer who wrote this code has not written the print stack trace. The developer has foresaw this problem and has made a retry attempt to get the stream from start.
I could not reproduce the problem.

May I know what this error is and how to reproduce this problem.

Regards,
Rajesh

Note: I incorrectly posted the content in another .Thread. Sorry for that
 
Rajesh So
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The code that is likely to throw the exception is as follows :



I have made some guesses. Could the problem be that there is a possible memory leak or out of memory?
Your suggestions will be very useful

Thanks,
Rajesh
 
g tsuji
Ranch Hand
Posts: 669
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you should inform the forum which libraries you are using? SAXReader.readStream() is not in dom4j? What is ftp? What is ftp.getBinaryFile()? They don't seem to suggest you are not using Apache's commons-net neither... so what are they?

"Nested Exception: null" seems inviting you to check whether the "InputStream is" is null or something? before proceeding further...
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
g tsuji wrote:"Nested Exception: null" seems inviting you to check whether the "InputStream is" is null or something? before proceeding further...

Actually it's more likely that the code has tried to print out the nested exception when there is no nested exception.
Something like
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic