« Return to Thread: Having Trouble Deploying JRuby on Rails app to Tomcat 6
I'm able to run my rails applications inside different context paths than root, with jruby-rack (which warbler uses) and jetty-rails. Curiously, it required no extra effort!Would you mind testing your app in jetty-rails? Perhaps it fixes something without even realizing it.--
On Tue, Jun 10, 2008 at 11:20 AM, Myron Marston <myron.marston@...> wrote:Thanks for the tip. I may try this next, but regardless of whether or not there's a way to get my rails app working without it running as the root app, I'd still like to deploy it as the root app. Rails has some internal logic that assumes it is running as a root app, so I feel like I'll probably run into more things down the road that don't work right if it's not the root app.
Thanks,
MyronOn Tue, Jun 10, 2008 at 11:03 PM, Juan Pablo Tarquino <jtarquino@...> wrote:
Hi,
Whenever possible don't use relative paths in your rails app. Use instead
RAILS_ROOT + '/' + filename. If you can't avoid using relative paths, you
don't have to make you rails app a ROOT app; instead you can put the
contents of the folder public into the folder webapps of your tomcat. That
problem happened to me when using Jmaki and forced me to take the
"resources" folder that was in the my rails app's public folder and move it
to the "webapps" folder of tomcat (which is basicaly the root folder for
tomcat) without me having to make my app a root app.
I guess for you, you could just move the images folder to the webapps
folder.
Best regards,
Juan
> http://localhost:8084/$YOUR_APP_NAME<http://localhost:8080/$YOUR_APP_NAME
On Tue, June 10, 2008 2:30 am, Myron Marston wrote:
> I'm developing a JRuby on Rails app using netbeans 6.1. I'm trying to
> deploy to Tomcat 6. I've installed warbler as a plugin, and it's
> generated my WAR file. I copied it to $TOMCAT_HOME/webapps and I can
> access it in my browser at
> >just fine. However, none of my images show on the page, and after doing
> some research on Google, it's clear that my app needs to run as the root
> webapp in Tomcat because of some of the logic used by the rails asset
> tags.
>
>
> This is my first time using Tomcat, so I'm not quite sure how to
> configure Tomcat to make my app run as the root. Googling the topic gave
> me several things to try (e.g. renaming my war as ROOT.war and removing
> the existing ROOT webapp; creating a ROOT.xml file in
> $CATALINA_HOME/conf/[enginename]/[hostname]/ with a docBase element
> pointing to my war file), but none of these are working. In each case, I
> get a java.lang.OutOfMemoryError. Here's the stack trace:
>
> Jun 10, 2008 2:25:30 PM org.apache.catalina.core.ApplicationContext log
> SEVERE: Exception caught
> org.jruby.rack.RackInitializationException: IO error --
> builtin/java/exceptions from
> file:/C:/Users/Myron/.netbeans/6.1/apache-tomcat-6.0.16_base/webapps/ROOT
> /WEB-INF/lib/jruby-complete-1.1.2.jar!/META-INF/jruby.home/lib/ruby/site_
> ruby/1.8/builtin/javasupport.rb:47:in
> `file:/C:/Users/Myron/.netbeans/6.1/apache-tomcat-6.0.16_base/webapps/ROOT
> /WEB-INF/lib/jruby-complete-1.1.2.jar!/META-INF/jruby.home/lib/ruby/site_
> ruby/1.8/builtin/javasupport.rb' from
> file:/C:/Users/Myron/.netbeans/6.1/apache-tomcat-6.0.16_base/webapps/ROOT
> /WEB-INF/lib/jruby-complete-1.1.2.jar!/META-INF/jruby.home/lib/ruby/site_
> ruby/1.8/builtin/javasupport.rb:1
>
>
> at
> org.jruby.rack.DefaultRackApplicationFactory.newRuntime(DefaultRackApplic
> ationFactory.java:85)
> at
> org.jruby.rack.DefaultRackApplicationFactory.createApplication(DefaultRac
> kApplicationFactory.java:144)
> at
> org.jruby.rack.DefaultRackApplicationFactory.newApplication(DefaultRackAp
> plicationFactory.java:44)
> at
> org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackAp
> plicationFactory.java:52)
> at
> org.jruby.rack.PoolingRackApplicationFactory.getApplication(PoolingRackAp
> plicationFactory.java:92)
> at
> org.jruby.rack.DefaultRackDispatcher.process(DefaultRackDispatcher.java:3
> 1)
> at org.jruby.rack.RackFilter.doFilter(RackFilter.java:51) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicat
> ionFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilte
> rChain.java:206)
> at
> org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFil
> ter.java:196)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicat
> ionFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilte
Best regards,> rChain.java:206)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve
> .java:233)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve
> .java:175)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
> 128)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
> 102)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.j
> ava:109)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:28
> 6)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844
> )
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(H
> ttp11Protocol.java:583)
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> at java.lang.Thread.run(Thread.java:619) Caused by:
> org.jruby.exceptions.RaiseException: IO error --
> builtin/java/exceptions Caused by: java.lang.OutOfMemoryError: Java heap
> space
>
> Not sure if this helps, but here's my environment:
> Windows Vista
> MySQL 5
> Netbeans 6.1
> Rails 2.1
> JRuby 1.1.2
> Tomcat 6.0.16
>
>
> Anyone know how to get this to work?
>
>
> Thanks,
> Myron
>
>
Juan Pablo Tarquino
Westwood Christian School
http://www.westwoodchristian.org
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
Fabio Kung
http://www.fabiokung.com
Caelum - Ensino e Soluções em Computação
http://www.caelum.com.br
« Return to Thread: Having Trouble Deploying JRuby on Rails app to Tomcat 6
| Free embeddable forum powered by Nabble | Forum Help |