This is a Warbler question and I couldn’t find a place for just Warbler
questions, so I’m asking here (please tell me where I should post if
this is the wrong place).
I have successfully used Warbler to deploy a Merb app. into Websphere -
however, I don’t seem to be able to get the context root of the
Websphere containter to be honored.
So my app. is named “merb_test”, and when I request http://localhost:8080/merb_test/, instead of getting the default root
route result, I get an error that says that the controller “merb_test”
is not found. Clearly the Merb app. is attempting to serve up
“/merb_test” instead of “/”.
I created a custom web.xml file in MERB_ROOT/config, and I set the
“public.root” param to be “/merb_test”. I thought for sure that this
would fix it, but it doesn’t seem to help.
Is there something in the warble.rb file that I should be setting
perhaps? Or is “public.root” not the correct context-param to set?
I’ll start reading the source to the servlet next.
Thanks,
Wes
Here is my web.xml file:
rails.env
production
public.root
/merb_test
RackFilter
org.jruby.rack.RackFilter
RackFilter
/*
So my app. is named “merb_test”, and when I request
Or is “public.root” not the correct context-param to set?
This is a known issue with Merb apps where I haven’t found out yet how
to automatically set the path prefix, because I don’t know the context
root until the first request. You may be able to correct manually
yourself by setting :path_prefix in your config/init.rb file:
Merb::Config.use do |c|
c[:path_prefix] = ‘/merb_test’
…
end
to automatically set the path prefix, because I don’t know the context
root until the first request. You may be able to correct manually
yourself by setting :path_prefix in your config/init.rb file:
Merb::Config.use do |c|
c[:path_prefix] = ‘/merb_test’
…
end
/Nick
Nick,
That works like a charm.
As to your comment about automatically setting the path prefix, is there
something about Rails apps. that makes this a non-issue.
It seems to me that regardless of whether you use Rails or Merb or
whatever, you’re always going to have this context - root issue when
dealing with a JEE container. I assume that Goldspike just assumes that
the context root of your Java Web app. will be the name of the Rails app
itself. Couldn’t you just assume that and then direct users to modify
the Merb::Config “path_prefix” key to be something else if they need
to? After all, they’re deploying into the JEE container, and so they
will definitely know which context root is in play for their WAR
deployed app, right?
As to your comment about automatically setting the path prefix, is there
something about Rails apps. that makes this a non-issue.
Yes – basically Rails looks for an environment variable
RAILS_RELATIVE_URL_ROOT and uses it on every request, so I can
automatically ensure it’s set to the right value, and there doesn’t
need to be any user intervention.
With Merb, I haven’t yet found a way to do the same thing. It seems
that if path_prefix isn’t set at startup time, it doesn’t take effect.
Actually I went ahead with WAS Community Edition 2.1 since I’m on Mac OS
X and that seemed like the simplest install (which it was - I didn’t
want to have to shoehorn a Linux specific distro into Mac OS X). WASCE
is basically an IBM wrapper around Apache Geronimo.
It’s a calculated risk, but I figure these Web apps. that we’re building
are (theoretically) purely JEE compliant, and don’t use app. server
specific features, so most likely there won’t be any issue for us to
deploy an app. against WAS 6.1 (which is what we’ll do in production).
Wes
Joseph A. wrote:
>
that if path_prefix isn't set at startup time, it doesn't take effect.
/Nick
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.