Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to get more info on an IO exception

Reply
Thread Tools

How to get more info on an IO exception

 
 
alejandrina
Guest
Posts: n/a
 
      08-27-2007
Hi all,

We have a process that occassionally throws an I/O Exception when
trying to lock a Linux file for writing.

java.io.IOException: Input/output error
at sun.nio.ch.FileChannelImpl.lock0(Native Method)
at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl .java:
882)
at java.nio.channels.FileChannel.tryLock(FileChannel. java:962)
at
com.pdx.science.utils.SyncFileWriter.write(SyncFil eWriter.java:5
at
com.pdx.science.pm.learning.PMResultRecorder.recor d(PMResultRecorder.java:
49)
at
com.pdx.science.pm.learning.SVMModelSelector.proce ssValueSet(SVMModelSelector.java:
279)
at
com.pdx.science.pm.learning.SVMModelSelector.proce ss(SVMModelSelector.java:
17
at
com.pdx.science.pm.learning.SVMModelSelector.run(S VMModelSelector.java:
134)
at
com.pdx.science.pm.learning.SVMModelSelector.main( SVMModelSelector.java:
589)


We'd love to know what is actually happening (network error, NFS
error...) Is there any more information that can be obtained from the
I/O Exception? How does one get it?

Thanks,

Alejandrina

 
Reply With Quote
 
 
 
 
Martin Gregorie
Guest
Posts: n/a
 
      08-27-2007
alejandrina wrote:
>
> We'd love to know what is actually happening (network error, NFS
> error...) Is there any more information that can be obtained from the
> I/O Exception? How does one get it?
>

As the error is in native code I'd guess that the OS might tell you more
that filters up through Exceptions. Have you looked at the system
logs, /var/log/messages in particular?


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
 
Reply With Quote
 
 
 
 
alejandrina
Guest
Posts: n/a
 
      08-28-2007
On Aug 27, 3:53 pm, Martin Gregorie <mar...@see.sig.for.address>
wrote:
> alejandrina wrote:
>
> > We'd love to know what is actually happening (network error, NFS
> > error...) Is there any more information that can be obtained from the
> > I/O Exception? How does one get it?

>
> As the error is in native code I'd guess that the OS might tell you more
> that filters up through Exceptions. Have you looked at the system
> logs, /var/log/messages in particular?
>
> --
> martin@ | Martin Gregorie
> gregorie. | Essex, UK
> org |



Nothing there that we can see. I wanted to see if there was a
mechanism to "unwrap" the exception to get more info, but I guess
there is no such thing.

 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      08-29-2007
On Mon, 27 Aug 2007 11:36:34 -0700, alejandrina <>
wrote, quoted or indirectly quoted someone who said :

>We'd love to know what is actually happening (network error, NFS
>error...) Is there any more information that can be obtained from the
>I/O Exception? How does one get it?


I suppose you could discover the precise class of the IOExceptions you
are getting by dumping e.getClass in your catch block. , then add a
catch clause for that particular class ahead of the general
IOException catch,, then you have access to any additional fields or
methods it has.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
Knute Johnson
Guest
Posts: n/a
 
      08-29-2007
alejandrina wrote:
> Hi all,
>
> We have a process that occassionally throws an I/O Exception when
> trying to lock a Linux file for writing.
>
> java.io.IOException: Input/output error
> at sun.nio.ch.FileChannelImpl.lock0(Native Method)
> at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl .java:
> 882)
> at java.nio.channels.FileChannel.tryLock(FileChannel. java:962)
> at
> com.pdx.science.utils.SyncFileWriter.write(SyncFil eWriter.java:5
> at
> com.pdx.science.pm.learning.PMResultRecorder.recor d(PMResultRecorder.java:
> 49)
> at
> com.pdx.science.pm.learning.SVMModelSelector.proce ssValueSet(SVMModelSelector.java:
> 279)
> at
> com.pdx.science.pm.learning.SVMModelSelector.proce ss(SVMModelSelector.java:
> 17
> at
> com.pdx.science.pm.learning.SVMModelSelector.run(S VMModelSelector.java:
> 134)
> at
> com.pdx.science.pm.learning.SVMModelSelector.main( SVMModelSelector.java:
> 589)
>
>
> We'd love to know what is actually happening (network error, NFS
> error...) Is there any more information that can be obtained from the
> I/O Exception? How does one get it?
>
> Thanks,
>
> Alejandrina
>


Did getCause() have any info?

--

Knute Johnson
email s/nospam/knute/
 
Reply With Quote
 
Andreas Leitgeb
Guest
Posts: n/a
 
      08-29-2007
Roedy Green <> wrote:
> On Mon, 27 Aug 2007 11:36:34 -0700, alejandrina <>
> wrote, quoted or indirectly quoted someone who said :
>>We'd love to know what is actually happening (network error, NFS
>>error...) Is there any more information that can be obtained from the
>>I/O Exception? How does one get it?

> I suppose you could discover the precise class of the IOExceptions you
> are getting by dumping e.getClass in your catch block. , then add a
> catch clause for that particular class ahead of the general
> IOException catch,, then you have access to any additional fields or
> methods it has.


In case this doesn't work out (that is: the getClass() also returns
just IOException), then maybe further information is just an
ioExc.getCause() away

 
Reply With Quote
 
alejandrina
Guest
Posts: n/a
 
      08-29-2007
On Aug 28, 11:38 pm, Knute Johnson <nos...@rabbitbrush.frazmtn.com>
wrote:
> alejandrina wrote:
> > Hi all,

>
> > We have a process that occassionally throws an I/O Exception when
> > trying to lock a Linux file for writing.

>
> > java.io.IOException: Input/output error
> > at sun.nio.ch.FileChannelImpl.lock0(Native Method)
> > at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl .java:
> > 882)
> > at java.nio.channels.FileChannel.tryLock(FileChannel. java:962)
> > at
> > com.pdx.science.utils.SyncFileWriter.write(SyncFil eWriter.java:5
> > at
> > com.pdx.science.pm.learning.PMResultRecorder.recor d(PMResultRecorder.java:
> > 49)
> > at
> > com.pdx.science.pm.learning.SVMModelSelector.proce ssValueSet(SVMModelSelector.java:
> > 279)
> > at
> > com.pdx.science.pm.learning.SVMModelSelector.proce ss(SVMModelSelector.java:
> > 17
> > at
> > com.pdx.science.pm.learning.SVMModelSelector.run(S VMModelSelector.java:
> > 134)
> > at
> > com.pdx.science.pm.learning.SVMModelSelector.main( SVMModelSelector.java:
> > 589)

>
> > We'd love to know what is actually happening (network error, NFS
> > error...) Is there any more information that can be obtained from the
> > I/O Exception? How does one get it?

>
> > Thanks,

>
> > Alejandrina

>
> Did getCause() have any info?
>
> --
>
> Knute Johnson
> email s/nospam/knute/


I did a test with a manufactured IOEception. getCause() returned the
exception message. And of course now that we have a catch for
IOException, the app is not failing, so I don't know what a real
IOException yields...

 
Reply With Quote
 
Knute Johnson
Guest
Posts: n/a
 
      08-29-2007
alejandrina wrote:
>> Did getCause() have any info?
>>

> I did a test with a manufactured IOEception. getCause() returned the
> exception message. And of course now that we have a catch for
> IOException, the app is not failing, so I don't know what a real
> IOException yields...


Sometimes it is just magic. I've got a program in the field that has
been running 24/7 for the last year. Then all of a sudden it starts
having problems. I make about six changes, requiring me to stay up to
all hours because they can't have it down in the daytime, and then it
stops just as mysteriously as it started.

And if it is running on Windows...

--

Knute Johnson
email s/nospam/knute/
 
Reply With Quote
 
alejandrina
Guest
Posts: n/a
 
      08-30-2007
On Aug 29, 5:42 pm, Knute Johnson <nos...@rabbitbrush.frazmtn.com>
wrote:
> alejandrina wrote:
> >> Did getCause() have any info?

>
> > I did a test with a manufactured IOEception. getCause() returned the
> > exception message. And of course now that we have a catch for
> > IOException, the app is not failing, so I don't know what a real
> > IOException yields...

>
> Sometimes it is just magic. I've got a program in the field that has
> been running 24/7 for the last year. Then all of a sudden it starts
> having problems. I make about six changes, requiring me to stay up to
> all hours because they can't have it down in the daytime, and then it
> stops just as mysteriously as it started.
>
> And if it is running on Windows...
>
> --
>
> Knute Johnson
> email s/nospam/knute/


Yes, it's not quite software "engineering", eh?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
get CPU info, RAM info ilya Java 43 04-19-2010 03:23 PM
Exception of type 'System.Web.HttpUnhandledException' wasthrown.Exception has been thrown by the target of an invocation.System.WebSystem.Exception jobs ASP .Net 1 11-16-2007 05:57 PM
while executing my client program i get the exception javax.naming.LinkException: [Root exception is javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundException: remaining if plz anybody know how to solve this problem then mahesh Java 0 03-08-2007 12:26 PM
How to get the Operating System info like ( Wireless info, Wireless connection) Vasanth Perl 0 06-28-2004 08:56 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57