Forum: JRuby 500 Error Misbehavior in Servlet Containers

Posted by Jamie Jackson (Guest)
on 2012-09-17 21:21
(Received via mailing list)
Hi Folks,

FWIW: ruby -v = jruby 1.6.7.2 (ruby-1.9.2-p312) (2012-05-01 26e08ba)
(OpenJDK 64-Bit Server VM 1.6.0_24) [linux-amd64-java]

I'm working on custom 404/500 error messages in my Rails 3.2 app, but
first, I seem to be getting buggy behavior with standard error messages.

In WEBrick, everything behaves as expected: I get an error message in 
the
browser.

On GlassFish, when a 500 error is encountered (triggered, for instance, 
by
<%= nonexistent_var %> in a view), the error *is* recorded in the
server.log; however, no response seems to be returned to the browser.

Here's the same thing with wget:

jamie@icf109118-Ubuntu:~/Documents/Aptana_Studio_3_Workspace/r32$ wget 
-S "
http://icf109118-ubuntu:8080/r32/"
--2012-09-17 15:14:45--  http://icf109118-ubuntu:8080/r32/
Resolving icf109118-ubuntu (icf109118-ubuntu)... 127.0.1.1
Connecting to icf109118-ubuntu (icf109118-ubuntu)|127.0.1.1|:8080...
connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  X-Request-Id: 9c9be822cc04e5b84512b1410ad6067e
  X-Runtime: 0.045000
  Date: Mon, 17 Sep 2012 19:14:45 GMT
  X-Rack-Cache: miss
  Content-Type: text/html;charset=utf-8
  Content-Length: 643
Length: 643 [text/html]
Saving to: `index.html'

 0% [

 ] 0           --.-K/s   in 30s

2012-09-17 15:15:15 (0.00 B/s) - Connection closed at byte 0.


Do I need to file a bug?

Thanks,
Jamie
Posted by Jamie Jackson (Guest)
on 2012-09-19 17:41
(Received via mailing list)
Posted by Benjamin Browning (Guest)
on 2012-09-19 17:55
(Received via mailing list)
Have you checked to ensure there's not some GlassFish configuration 
setting that would hide the 500 error from the user?

Have you tested this application in another JRuby web server to see if 
it's a JRuby bug or something specific to GlassFish?

Ben
Posted by Jamie Jackson (Guest)
on 2012-09-19 18:04
(Received via mailing list)
Hi Ben,

> Have you tested this application in another JRuby web server to see if
it's a JRuby bug or something specific to GlassFish?

I know it works under JRuby in WEBrick, but did you mean another servlet
container? I can try Tomcat now.

Thanks,
Jamie
Posted by Jamie Jackson (Guest)
on 2012-09-19 19:07
(Received via mailing list)
500s seem to behave the same way in Tomcat7.

jamie@icf109118-Ubuntu:~/Documents/Aptana_Studio_3_Workspace/r32$ wget 
-S
http://localhost:8080/r32/home/barf
--2012-09-19 13:04:23--  http://localhost:8080/r32/home/barf
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Server: Apache-Coyote/1.1
  X-Request-Id: 680c47ecb85f6c8f5c68ee0c5e7775fd
  X-Runtime: 8.875000
  Date: Wed, 19 Sep 2012 17:04:40 GMT
  X-Rack-Cache: miss
  Content-Type: text/html;charset=utf-8
  Content-Length: 643
Length: 643 [text/html]
Saving to: `barf.1'

 0% [

 ] 0           --.-K/s   in 21s

2012-09-19 13:05:01 (0.00 B/s) - Connection closed at byte 0.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.