JRuby-Rack problems

Have switched from goldspike to jruby-rack 0.9.2, and overall it’s
working OK. Using it with JBoss 4.0.5 with embedded Tomcat 5.5. Also
using jruby 1.1.4.

A couple of problems:

  1. If the contaxt pathname of the app server contains a directory
    beginning with a numeral, such as:
    …/Jboss/4.0/server/default/deploy… then jruby-rack incorrectly chops
    off the slash and the numeral, so it ends up as
    …/jboss.0/server/default/deploy…

  2. (This was a problem under goldspike too). I’m using redmine under
    jruby. The app is packaged as redmine.war, and is therefore deployed
    under a context of /redmine. I’d like all the public files to be placed
    under WEB-INF/public. What is happening is that when redmine formulates
    up its pages with references to various graphics, stylesheets and js,
    these URL’s are being resolved literally to be based off the context
    root, e.g. /redmine/images/arrow.png and this is where these files must
    be placed for it to work. The setting of public.root or files.prefix
    (either default value or explicitly set to /WEB-INF/public) does not
    seem to work for these resources? Otherwise, all the dynamic stuff seems
    to work fine. Actually, what happens is that I have to have these files
    in two places, once off the context root, and also in /WEB-INF/public
    otherwise some of the redmine stuff can’t find what it wants!

Thanks…

On Sun, Sep 21, 2008 at 5:24 PM, [email protected] wrote:

Have switched from goldspike to jruby-rack 0.9.2, and overall it’s working
OK. Using it with JBoss 4.0.5 with embedded Tomcat 5.5. Also using jruby
1.1.4.

A couple of problems:

  1. If the contaxt pathname of the app server contains a directory beginning
    with a numeral, such as: …/Jboss/4.0/server/default/deploy… then
    jruby-rack incorrectly chops off the slash and the numeral, so it ends up as
    …/jboss.0/server/default/deploy…

Interesting bug, even though it appeared in both Goldspike and
JRuby-Rack. Can you give some more details?

resources? Otherwise, all the dynamic stuff seems to work fine. Actually,
what happens is that I have to have these files in two places, once off the
context root, and also in /WEB-INF/public otherwise some of the redmine
stuff can’t find what it wants!

/WEB-INF is a protected URL under the Java Servlet spec, so no
appserver will ever serve anything under there. That’s why Warbler
pulls everything out into the war root for you.

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Nick S. wrote:

jruby-rack incorrectly chops off the slash and the numeral, so it ends up as
…/jboss.0/server/default/deploy…

Interesting bug, even though it appeared in both Goldspike and
JRuby-Rack. Can you give some more details?

No no - goldspike was fine on this one - it has arisen since switching
to jruby rack. It’s quite simple to test…what more detail can I give
you on this? I start up the server and it barfs as soon as rails tries
to load the first config file. (The path name is logged in the
exception, showing the ‘corruption’ to that has happened to the
context). I’m guessing there is some sort of regex thing that is being
run over the context path that picks up the /4 and thinks that means
something. Put an alpha letter in front of it and it works fine, i.e.
/R4.0

what happens is that I have to have these files in two places, once off the
context root, and also in /WEB-INF/public otherwise some of the redmine
stuff can’t find what it wants!

/WEB-INF is a protected URL under the Java Servlet spec, so no
appserver will ever serve anything under there. That’s why Warbler
pulls everything out into the war root for you.

Ok I remember now what the issue actually is…I expressed it the wrong
way around. Yes, the public files are correctly served from the location
under the root directory of the war.

The problem is that certain rails templates in redmine (but other apps
would do the same sort of thing) are accessing some of these files
directly (i.e. server-side), and when that happens, they are not found
because the files are not under /WEB-INF/public where the templates are
looking for them. Is this the true purpose of public.root setting, to in
effect redirect local server-side rails requests to where the public
files are now located?

Thanks///

OK I’ll check this out some more. Redmine is still between rails 2.0.2
and 2.1.1 so I doubt if they are using this new setting yet.
May have to hack my copy…

Do you have enough to investigate the other issue?

On Sun, Sep 21, 2008 at 9:09 PM, [email protected] wrote:

server-side rails requests to where the public files are now located?
It’s probably something that needs to be fixed in Redmine. In Rails
2.1, a new setting Rails.public_path was introduced for this purpose.
JRuby-Rack correctly sets it to the root of the war file so that
static assets can be found. Redmine must be making the assumption that
Rails.public_path == RAILS_ROOT/public, which is not the case here.

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Yes it’s quite odd. It’s the number and the preceding slash. I have a
better eclipse setup for debugging jruby now so I might be able to check
this out myself…

On Sun, Sep 21, 2008 at 9:52 PM, [email protected] wrote:

OK I’ll check this out some more. Redmine is still between rails 2.0.2 and
2.1.1 so I doubt if they are using this new setting yet.
May have to hack my copy…

Do you have enough to investigate the other issue?

For now, I guess. I probably won’t be looking at it immediately but
I’ll file it away. Nothing off the top of my head to make me think of
why the number in the filename is getting munged.

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

For what it’s worth, I also experienced the
directory-beginning-with-a-numeral issue, which I described in the
thread
here[1]. I didn’t do enough experimenting to realize that the specific
problem was the directory starting with a numeral, but when I
reinstalled
tomcat I didn’t have a directory starting with a numeral in the path,
and
that fixed the problem.
It would be great to get this bug fixed, but for the time being, just
work
around it by installing to a new directory, without a numeral in the
path.

  • Myron

[1]
http://groups.google.com/group/jruby-users/browse_thread/thread/18804939e2dcfe16/156738263100520e