Newbie tomcat deployment issue

Dear JRubyists,

i’m deploying a JRuby app under tomcat locally to attempt to repro an
error i’m seeing on a stax.net deployment. Normally, i test under jetty
– and the app works like a charm under jetty – so tomcat is a little
new to me. i’ve copied the exploded war dir to CATALINA_BASE/webapps.
However, the JRuby app can’t route the url with the context path.

Essentially, i need to once and for all convince the app that
myApp-SNAPSHOT-1.0/path should map to /path. What’s the best way to
accomplish this?

Best wishes,

–greg

Lucius M. wrote:

Dear JRubyists,

i’m deploying a JRuby app under tomcat locally to attempt to repro an
error i’m seeing on a stax.net deployment. Normally, i test under jetty
– and the app works like a charm under jetty – so tomcat is a little
new to me. i’ve copied the exploded war dir to CATALINA_BASE/webapps.
However, the JRuby app can’t route the url with the context path.

Essentially, i need to once and for all convince the app that
myApp-SNAPSHOT-1.0/path should map to /path. What’s the best way to
accomplish this?

Best wishes,

–greg

Just as a quick follow up. The actual error – which is clearly coming
from the ruby app – is

No route matches “/myAPP-SNAPSHOT-1.0/” with {:method=>:get}

i’ve tried munging map.root and also modifying
config.action_controller.asset_host . If these are the way to control
the behavior, clearly i don’t understand what values to supply. :wink:

On Wed, Jun 30, 2010 at 1:43 PM, Lucius M. [email protected]
wrote:

myApp-SNAPSHOT-1.0/path should map to /path. What’s the best way to

i’ve tried munging map.root and also modifying
config.action_controller.asset_host . If these are the way to control
the behavior, clearly i don’t understand what values to supply. :wink:

Normally JRuby-Rack takes care of this for you – the option you want
is ENV[‘RAILS_RELATIVE_URL_ROOT’]. It should be set somewhere early in
startup so that Rails can calculate routes and asset paths based on it
automatically.

The other option is to deploy your app as ROOT.war in Tomcat, which
gets rid of the leading path element altogether.

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Can you try renaming your war file to ROOT.war as nick suggests and
see if it works then?

Jay

On Wed, Jun 30, 2010 at 6:04 PM, Lucius M. [email protected]
wrote:

Best wishes,

the behavior, clearly i don’t understand what values to supply. :wink:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Dear Nick,

Thanks! i tried that by placing

ENV[‘RAILS_RELATIVE_URL_ROOT’] = ‘magritte-SNAPSHOT-1.0/’

in environment.rb

just after the requires section. i get exactly the same error.

Best wishes,

–greg

Nick S. wrote:

On Wed, Jun 30, 2010 at 1:43 PM, Lucius M. [email protected]
wrote:

myApp-SNAPSHOT-1.0/path should map to /path. What’s the best way to

i’ve tried munging map.root and also modifying
config.action_controller.asset_host . If these are the way to control
the behavior, clearly i don’t understand what values to supply. :wink:

Normally JRuby-Rack takes care of this for you – the option you want
is ENV[‘RAILS_RELATIVE_URL_ROOT’]. It should be set somewhere early in
startup so that Rails can calculate routes and asset paths based on it
automatically.

The other option is to deploy your app as ROOT.war in Tomcat, which
gets rid of the leading path element altogether.

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Ok I have a few more questions:

You mention it’s a Jruby App… is it a Rails app? It appears so but
I just wanted to be sure.
If it’s a rails app. What versions of jruby-rack and warbler are you
using?

you mention you copy the “exploeded” war to webapps… You can copy
the warfile to webapps and startup tomcat and it will explode the war
file for you. I’m not sure it matters which way you do it.

What kind of database are you using? what is your database.yml like?
When we use Tomcat at work we deploy using JNDI to point to the
database. If this is the case for you the jdbc driver needs to be in
the Tomcat lib directory.

here is another question… when you are launching your app locally
with webrick or jetty are you running in production mode? or
development mode?

(sorry if these questions seem silly but I’m trying to build a picture
in my head)

Thanks!
Jay

On Wed, Jun 30, 2010 at 7:03 PM, Lucius M. [email protected]
wrote:

accessing the db – which is a completely new behavior not seen either

–greg

the behavior, clearly i don’t understand what values to supply. :wink:
  http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

dear Lucius,

all classes are there but can not be found then my plain guess is that
you somehow have some classes in two classloaders - the
Thread.currentThread.getContextClassloader and tje the
jruby-classloader. this can happen if you require ‘jarfiles’. to avoid
this I personally avoid any of such require and just make sure all
classes are there (webrick) in classpath or in the WEB-INF/lib. well
that does not explain the difference between jetty and stax.net but
maybe it is something.

with regards
Kristian

On Thu, Jul 1, 2010 at 4:33 AM, Lucius M. [email protected]
wrote:

accessing the db – which is a completely new behavior not seen either

–greg

the behavior, clearly i don’t understand what values to supply. :wink:
  http://xircles.codehaus.org/manage_email


Kristian Meier + Saumya Sharma + Sanuka Meier
Vadakkethu House,
Edayanmula West PO - 689532,
Pathanamthitta District, Kerala, INDIA

tel: +91 468 2319577

protect your privacy while searching the net: www.ixquick.com

         _=_
       q(-_-)p
        '_) (_`
        /__/  \
     _(<_   / )_
  (__\_\_|_/__)

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Dear Jay,

When i move it to ROOT it almost works. Here’s my problem. i’m trying to
figure out why the app which works perfectly when launched under
webbrick or when run under jetty on my local servers fails to work
properly when deployed to AMZN through stax.net. My aim is to get my
local deployment to match as closely as possible the stax,net deployment
so that i can exactly repro the error i’m seeing there. When i move the
app to ROOT on my local tomcat installation it fails in a completely
different way than it does on stax.net. It seems to have trouble
accessing the db – which is a completely new behavior not seen either
on the stax deployment or on local deployments using webbrick or jetty.

The error i’m getting in the stax deployment is a no class defn found
despite

  1. the fact that i’ve verified that the class is in the jar i expect it
    to be and
  2. the jar is in lib and warbler picks it up and and puts it in the
    right place in the war file
  3. there is no other version of the class to be found in any of the
    other jars in the war.

Again, when i take that war file and deploy through jetty on a local
server, the app works just fine.

The place where this exception occurs is deep inside 3rd party code that
i can’t really put logging statements into. That’s why it’s important
for me to attempt to repro this locally where i have more visibility
into what’s happening.

Best wishes,

–greg

Jay McGaffigan wrote:

Can you try renaming your war file to ROOT.war as nick suggests and
see if it works then?

Jay

On Wed, Jun 30, 2010 at 6:04 PM, Lucius M. [email protected]
wrote:

Best wishes,

the behavior, clearly i don’t understand what values to supply. :wink:

� �http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email