Issue Details (XML | Word | Printable)

Key: DIRMINA-143
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Walter Tam
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
MINA

SocketAcceptor.bind() should fillInStackTrace() before rethrowing exception

Created: 09/Dec/05 10:39 AM   Updated: 26/May/09 12:47 AM
Return to search
Component/s: None
Affects Version/s: 0.8.1
Fix Version/s: 0.9.1

Time Tracking:
Not Specified

Resolution Date: 24/Jan/06 12:39 PM


 Description  « Hide
When SocketAcceptor.bind() encounters an exception returned from the bind request, it simply rethrows. The resulting stack trace is from the underlying registration thread which is not very helpful when debugging the cause. Other similar places like SocketAcceptor.unbind(), DatagramAcceptor.unbind() does a fillInStackTrace() before re throwing.

Also it will be helpful in this case to add the port number that failed to the message

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Niklas Therning added a comment - 09/Dec/05 04:23 PM
How about wrapping the original exception in a new IOException instead of using fillInStackTrace()? The message of the new exception would then indicate the port which couldn't be bound to. Or will that be too messy?

There might be a philosophy behind using fillInStackTrace() instead of wrapping? I usually prefer wrapping since then I won't miss out on any info that could be useful. Sometimes it can become very messy. In this case, however, I think it will be ok.

Walter Tam added a comment - 10/Dec/05 02:08 AM
Wrapping would be the logical choice. However in this case the IOException being thrown does not support wrapping. A possible solution is to throw a subclass of IOException with a constructor that takes a Throwable arguemnt.

Trustin Lee added a comment - 10/Dec/05 01:38 PM
I think it's not that messy. Good idea. What about creating our own exceptions which extends IOException and wrap throws exceptions?

Trustin Lee added a comment - 23/Jan/06 01:55 PM
We will fix it in MINA 0.9.1.

Trustin Lee added a comment - 24/Jan/06 12:39 PM
I checked in the fix.