<meta name='google-adsense-platform-account' content='ca-host-pub-1556223355139109'/> <meta name='google-adsense-platform-domain' content='blogspot.com'/> <!-- data-ad-client=ca-pub-4320963827702032 --> <!-- --><style type="text/css">@import url(https://www.blogger.com/static/v1/v-css/navbar/3334278262-classic.css); div.b-mobile {display:none;} </style> </head><body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d7256432\x26blogName\x3dThe+Frustrated+Programmer\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLACK\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttps://frustratedprogrammer.blogspot.com/search\x26blogLocale\x3den_US\x26v\x3d2\x26homepageUrl\x3dhttp://frustratedprogrammer.blogspot.com/\x26vt\x3d4213664491834773269', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe", messageHandlersFilter: gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER, messageHandlers: { 'blogger-ping': function() {} } }); } }); </script>
| Friday, July 02, 2004

Are you kidding me?!?!?! What a waste of an hour!

Man.. that is so lame.. whats worse is the contructor for JspException takes a cause, but assigns it to rootCause, and doesn't pass it to its parent class, so your left thinking your doing the right thing..grrr

Here is the code in my error.jsp to display the exception.


ByteArrayOutputStream ostr = new ByteArrayOutputStream();
exception.printStackTrace(new PrintStream(ostr));
out.print(ostr);
ostr.reset();

if( exception instanceof JspException ) {
Throwable rootCause = ((JspException)exception).getRootCause();
if( rootCause != null ) {
out.println("");
out.println("Root cause:");
rootCause.printStackTrace(new PrintStream(ostr));
out.print(ostr);
}
}


Here is a link to a more detailed solution (except it doesn't mention the above problem.
http://jroller.com/page/prpatel?anchor=handling_the_three_kinds_of

I filed a bug with Sun after searching and finding nothing related. We'll see how it goes...

Update: Well, this happens with ServletException, NamingException (and all its children), plus a slew of others.

Update: I submitted the bug to Sun. Here's my response so far :)

************************************************
Your report has been assigned an internal review ID of: 282419

This review ID is NOT visible on the "Java Developer Connection" (JDC).

[...]