« Return to Thread: Jruby/Rails 2/Tomcat 5.5

Re: Jruby/Rails 2/Tomcat 5.5

by Lenny Marks :: Rate this Message:

Reply to Author | View in Thread

I filed a bug report for this: 

https://rubyforge.org/tracker/index.php?func=detail&aid=17450&group_id=2014&atid=7857

-lenny

On Jan 24, 2008, at 12:03 AM, Lenny Marks wrote:

I also ran into this when I was getting started deploying into Tomcat. Anytime there was a problem during rails initialization I'd see that error looping in the logs. Contrary to the 'See the logs for more details' message I couldn't find any additional logging information in the server log(catalina.out) or any of the rails log files. As a quick fix I wound up applying the patch below to rails-integration to print the stack trace which did show me the underlying problem which was usually obvious once I could see full stack trace(In one case it was that I was developing on a Mac which was shielding some case sensitivity typos in require statements). I could swear I tried passing the original exception to the (String msg, Throwable rootCause) constructor of ServletException but that didn't dump the entire stack trace to the logs.  Anyway, I think there is an issue with Goldspike swallowing exceptions. I'm guessing the Rails logging isn't usable before the Rails initialization is complete.



Index: src/main/java/org/jruby/webapp/RailsFactory.java

===================================================================

--- src/main/java/org/jruby/webapp/RailsFactory.java    (revision 877)

+++ src/main/java/org/jruby/webapp/RailsFactory.java    (working copy)

@@ -135,6 +135,7 @@

                 log("Rails init time: " + (System.currentTimeMillis() - startTime) + "ms");^M

             }^M

         } catch (RaiseException e) {^M

+            e.printStackTrace();^M

             logRubyException("Failed to load Rails", e);^M

             throw new ServletException("Could not load Rails. See the logs for more details.");^M

         }^M


-lenny


On Jan 23, 2008, at 11:07 PM, Nick Sieger wrote:


On Jan 23, 2008 4:27 PM, Crall, Dennis P <dennis-crall@...> wrote:


Hello all,


I'm trying to deploy a Rails 2.0.2 app to Jruby. I'm using Warbler .9.2,

Goldspike 1.5 snapshot, and Jruby 1.1RC1 (I've also tried 1.0.3). The war

looks good. All my gems are present. I can view the Rails index.html page.

But I can't see any of the dynamic pages. Tomcat returns:


503 The server is currently overloaded, please try again later


In the log files, I see the following error:


javax.servlet.ServletException: Could not load Rails.

    See the logs for more details.

    at org.jruby.webapp.RailsFactory.makeObject(RailsFactory.java:139)

    at org.jruby.webapp.util.CustomObjectPool.addObjectInternal

        (CustomObjectPool.java:111)

    at org.jruby.webapp.util.CustomObjectPool.access$200

        (CustomObjectPool.java:15)

    at org.jruby.webapp.util.CustomObjectPool$PoolSizeManager.run

        (CustomObjectPool.java:193)


Is this a configuration that generate a working war file? If not, what is

the recommended configuration for Rails 2? I know support of Rails 2 isn't

solid yet, but it seems like some people have been successful.


Is the error meaningful to anyone?


Can you look a bit further up in the log file to see if there's a Ruby message?


/Nick


 « Return to Thread: Jruby/Rails 2/Tomcat 5.5