- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
TRWTF is JiBX.
Admin
The real WTF is not leaving a gap between the class name and the error message. It makes the system output look messy.
Admin
Someone needs to inform Brian that System.exit does not shut down the Application Server.
Admin
I finally understand why Java's security model is so torturous:
It's to protect everyone else against people who write code like this.
Admin
Calling System.exit on a webserver? I've seen a lot of crap in my time but that's a new one on me, great job.
Admin
It is not that hard to create and install your own SecurityManager that prevents System.exit from executing. But this would surely have been mentioned by the OP if it had been done.
Admin
You see that is really a DOS attack vector. Therefor CERT will be issuing an alert on that, requiring that the application be upgraded. within 24 hours.
Admin
That's horrible- everyone knows that the right way to deal with a server issue is to show an error dialog box.
Admin
Please feature this comment. It's the funniest thing I've read on these stories in the last 3 weeks.
Admin
I for one think every language should have a System.crash() or equivalent for just this kind of opportunity for overreaction.
Admin
i've had to deal with a few of those. An ex co-worker of mine thought it was a good idea to do a System.exit when various errors occured instead of handling it....those were fun to debug when they would randomly happen at first and we didn't know thats what was going on. We have since removed those and handle them more gracefully.
Admin
Now I see the problem: it should be log.fatal instead of log.info.
Seriously, though. How do we know that this is NOT the write thing to do here? What if this is a short lived application that exists only to call that service? What if it is called by a process that checks the error code when complete and does something to handle that accordingly? If an external application is supposed to do something, exceptions do not propagate outside that process. Brian may realize this when he is older.
Admin
Admin
The ideal way to handle the errors would be to have ITAPPMONROBOT bring a hammer down on the server.
Admin
Agreed - this code needs to be refactored to include that gap. This is difficult to maintain and would only just pass a code review.
Admin
Admin
I worked with a guy like that once - his response to getting an exception on a java web service was to kill the process. When I asked him about it (he just checked it in one day), he gave me some song and dance about unknown states.
Admin
Such as his future employment state at your company?
Admin
System.releaseMagicSmoke();
Admin
You know what, despite how shitty the "handling" of this exception is I would still rather have this x1000 in production code than some mysterious try/catch swallowing exceptions silently buried deep in one layer or another.
Admin
Admin
It is swallowing the actual response code, it is swallowing the URL it was trying to connect to, it is swallowing the actual query parameters.
So this is almost as shitty as it can get.
Admin
Agreed. I never sais it was good, I just said that any logging is better than no logging. At least in this case you know where it's happening (class name), and a loose idea as to why as well ("INVALID RESPONSE CODE"). Better than "hmm, that's wierd. It just shuts down... Let's try it again".
I would never advocate that this is the desired method for error handling, but it's less worse, and you can't really disagree with that...
Admin
Gee! Big red switch done in JVM. What a concept!
Admin
Almost the exact opposite of a silent fail. The only things missing are a klaxon and a hammer to the forehead and we're there. A beaut.
Admin
Admin
Admin
Everyone's focusing on the error handling WTF (poorly log & then ungracefully die).
By my reading, TRWTF is that if the request comes back with anything other than 200 OK, then the app dies. Because no one could ever get a 4xx or 500 error, right?
Maybe the same coder wrote the other side of the service with EXQUISITE error handling that ALWAYS produces a 200 OK response, CAREFULLY logs the errors, and passes the error back as a payload inside the ALWAYS successful http response to the calling service, which handles it PERFECTLY via pastWxHourly.
Admin
Admin
Real programmers code with butterflies.
Admin
It should exec 'shutdown -h now' instead
Admin
Phew!! Thank goodness for that - Waiter, bring me a cigar to enjoy during the next story!!
Admin
Nobody's bothered to comment on TRWTF as you've pointed it out because it's too obvious. Which is why QJ's comment (3rd or 4th, early on) was so funny, because it picked up on something utterly blatantly trivial. Sorry, didn't think this needed explaining.
Admin
Time to dust off and port that old assembler instruction from the mainframe days - HCF
Admin
Patch applied, the PR about the poorly-formatted log message have been resolved.
Admin
TRWTF is that it fails on redirects ^^
Admin
Well, not if it's a well-designed application server, at least. In an off-the-shelf server, hosted apps generally can't affect the container itself - but there's no reason someone couldn't build their own 'lightweight' app server that doesn't care for such constraints...
Admin
Some systems did:
BRS 131B
Extra credit: Tell us what the system was. This was a standard system call, but you needed privilege to use it (after they patched the system where you could work around it!).
Admin
President Madagascar, someone just got a 500 error in Brazil!
Admin
No, it halts the JVM on which the app server is running on instead :)
This is what JBoss does when you call System.exit(1) in a servlet.
Admin
What's the point of working when such an error occurred? I can't take it any more!
Admin
"The application's crashed, boss. Can't do anything, boss. I'm gonna go home."
Admin
Hey, fine work.
I say! I haven't seen any further instances of this error message since you did that fix. You must have fixed the bug! I'm putting you up for a commendation. Expect a payrise and a promotion presently. I wish your colleagues were as efficient and responsive to our demands.
Admin
Admin
Admin
Not enough restoration to initial state. To be really safe, it should call System.reboot().
Admin
I go out drinking with Alex last night and he still not in?
He a man not able to handle sake.
Admin
Are you serius? I have seen lot of websites built making usage of java technology which were super fast.
Admin
Add another WTF to this - this story has been bypassed on the home page, but you can navigate to here from the next day or previous day's story.
Admin
That is on Jboss 5.1.0.GA on a Java 6 JVM. I guess you must have only just graduated then?