Rails + JRuby + Weblogic + no such file to load -- rack

Running a Ruby on Rails (2.3.5) app on WebLogic (10.3) using JRuby (1.4)
is throwing the following error:

Application initialization failed: no such file to load – rack
from
C:/wamp/bin/weblogic/server10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/myapp/5pvyjy/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/vendor/rack.rb:1
from
C:/wamp/bin/weblogic/server10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/myapp/5pvyjy/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/vendor/rack.rb:22:in
require' from C:/wamp/bin/weblogic/server10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/myapp/5pvyjy/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/jruby/rack/booter.rb:22:inboot!’
from
C:/wamp/bin/weblogic/server10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/myapp/5pvyjy/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/jruby/rack/boot/rack.rb:9
from
C:/wamp/bin/weblogic/server10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/myapp/5pvyjy/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/jruby/rack/boot/rack.rb:1:in
`load’
from :1

The same app is running fine on Tomcat. Does anybody have faced similar
error? Any advise is appreciated.

-Satynos

On Fri, Dec 11, 2009 at 4:06 PM, Saty N. [email protected] wrote:

Running a Ruby on Rails (2.3.5) app on WebLogic (10.3) using JRuby (1.4)
is throwing the following error:

Application initialization failed: no such file to load – rack
 from

This is the classic useless error that jruby-rack still sometimes
throws. Is this all the information you have? Does the application
work ok at command line (using mongrel or glassfish gem or something)?

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I think is is a gem dependency error of Rails 2.3.5.

Do you have Rack 1.0.1?

Try jruby -S gem install rack

On 16.12.09 18:25, Charles Oliver N. wrote:

  • Charlie

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

Christian S. wrote:

I think is is a gem dependency error of Rails 2.3.5.

Do you have Rack 1.0.1?

Try jruby -S gem install rack

On 16.12.09 18:25, Charles Oliver N. wrote:

  • Charlie

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

I already have rack 1.0.1 installed.

  • Satynos

Charles Nutter wrote:

On Fri, Dec 11, 2009 at 4:06 PM, Saty N. [email protected] wrote:

Running a Ruby on Rails (2.3.5) app on WebLogic (10.3) using JRuby (1.4)
is throwing the following error:

Application initialization failed: no such file to load – rack
 from

This is the classic useless error that jruby-rack still sometimes
throws. Is this all the information you have? Does the application
work ok at command line (using mongrel or glassfish gem or something)?

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Application is running fine at command line using mongrel/webrick and
works fine on tomcat. Its giving the error mentioned only when using
weblogic.

  • Satynos

Hi,

I remember similar error discussed on IRC not so long ago, that time
with Tomcat, and it was permisisons related.

Take a look:
http://www.ruby-forum.com/topic/160184#773962

There might be similar problem with WebLogic.

If it turns out that this is a permissions problem, please let us
know so that we could improve things on JRuby side and test the fix
with you :slight_smile:

Thanks,
–Vladimir

On Wed, Dec 16, 2009 at 6:35 PM, Saty N. [email protected] wrote:

work ok at command line (using mongrel or glassfish gem or something)?
weblogic.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On Wed, Dec 16, 2009 at 06:35:38PM +0100, Saty N. wrote:

work ok at command line (using mongrel or glassfish gem or something)?

Application is running fine at command line using mongrel/webrick and
works fine on tomcat. Its giving the error mentioned only when using
weblogic.

Thats pretty much the same problem we have here with jetty and tomcat in
our
installation. I was able to reproduce it with a minimal installation
(described
in my post a weeek ago):
Subject: Rails 2.3.5, tomcat Ok, jetty strange error
Rails 2.3.5, tomcat Ok, jetty strange error - JRuby - Ruby-Forum

Saty, try the my minimal working example:
GitHub - retoo/phonebook_jror_example: Example JRoR Application

Does it work in weblogic? or tomcat? What error does it produce?

Cheers,
Reto


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Reto, folks,

If there is a simple reproducible test case with minimal application,
please don’t hesitate file bugs against JRuby, with the exact
specified steps to reproduce. Once the problem is clear and
reproducible, it will be much easier/faster to fix and verify.

Thanks,
–Vladimir

On Wed, Dec 16, 2009 at 7:19 PM, Reto S.
[email protected] wrote:

throws. Is this all the information you have? Does the application
Subject: Rails 2.3.5, tomcat Ok, jetty strange error


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

Reto:

I tried the sample phone book sample application, it works in Tomcat
just by copying the war file into the webpps folder of tomcat. It also
works in glassFish through Netbeans 6.8. But its failing in Weblogic
with the same error as mentioned previously (please see below too):

Application initialization failed: no such file to load – rack
from
C:/bea/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/Phonebook/f6lg0m/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/vendor/rack.rb:1
from
C:/bea/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/Phonebook/f6lg0m/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/vendor/rack.rb:22:in
require' from C:/bea/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/Phonebook/f6lg0m/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/jruby/rack/booter.rb:22:inboot!’
from
C:/bea/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/Phonebook/f6lg0m/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/jruby/rack/boot/rack.rb:9
from
C:/bea/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/Phonebook/f6lg0m/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/jruby/rack/boot/rack.rb:1:in
`load’
from :1

===================================================================
Vladimir S.:

I have installed Jruby on my windows machine using the installer. I am
not quite familiar in downloading and working with the source. If you
can briefly provide the steps, I can definitely try that.

-Satynos

Ah, I see the bug already filed for this issue, good :slight_smile:

http://jira.codehaus.org/browse/JRUBY-4353

Saty, will you be able to test the latest dev version from JRuby’s
master branch?

–Vladimir

On Wed, Dec 16, 2009 at 7:25 PM, Vladimir S. [email protected]
wrote:

On Wed, Dec 16, 2009 at 7:19 PM, Reto S.

This is the classic useless error that jruby-rack still sometimes
in my post a weeek ago):


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

On Wed, Dec 16, 2009 at 12:54 PM, Saty N. [email protected] wrote:

C:/bea/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/Phonebook/f6lg0m/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/vendor/rack.rb:1

You might want to try installing jruby-rack-0.9.6; I vaguely (sorry,
it’s
been quite a while) recall some problem I had being fixed with that.

Yes, I should keep better notes :slight_smile:


Hassan S. ------------------------ [email protected]
twitter: @hassan


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Saty N. wrote:

Reto:

I tried the sample phone book sample application, it works in Tomcat
just by copying the war file into the webpps folder of tomcat. It also
works in glassFish through Netbeans 6.8. But its failing in Weblogic
with the same error as mentioned previously (please see below too):

Application initialization failed: no such file to load – rack
from
C:/bea/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/Phonebook/f6lg0m/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/vendor/rack.rb:1
from
C:/bea/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/Phonebook/f6lg0m/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/vendor/rack.rb:22:in
require' from C:/bea/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/Phonebook/f6lg0m/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/jruby/rack/booter.rb:22:in boot!’
from
C:/bea/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/Phonebook/f6lg0m/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/jruby/rack/boot/rack.rb:9
from
C:/bea/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/Phonebook/f6lg0m/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/jruby/rack/boot/rack.rb:1:in
`load’
from :1

===================================================================
Vladimir S.:

I have installed Jruby on my windows machine using the installer. I am
not quite familiar in downloading and working with the source. If you
can briefly provide the steps, I can definitely try that.

-Satynos

I built new jruby.jar file based off the edge version from github.com,
switched it with the JRuby1.4.0 install, but still getting the same
error. I think the error/bug relates to JRuby-Rack rather than JRuby
itself. We have the project requirement that the rails app has to be run
on Weblogic Server due to the company policy. Any help is appreciated.

-Satynos

Hassan S. wrote:

On Wed, Dec 16, 2009 at 12:54 PM, Saty N. [email protected] wrote:

C:/bea/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/Phonebook/f6lg0m/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/vendor/rack.rb:1

You might want to try installing jruby-rack-0.9.6; I vaguely (sorry,
it’s
been quite a while) recall some problem I had being fixed with that.

Yes, I should keep better notes :slight_smile:


Hassan S. ------------------------ [email protected]
twitter: @hassan


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I was able to download JRuby-Rack-0.9.6 and switched it with 0.9.5,
still getting the same error (following):

Application initialization failed: no such file to load – rack
from
C:/bea/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/Phonebook/f6lg0m/war/WEB-INF/lib/jruby-rack-0.9.6.jar!/vendor/rack.rb:1
from
C:/bea/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/Phonebook/f6lg0m/war/WEB-INF/lib/jruby-rack-0.9.6.jar!/vendor/rack.rb:22:in
require' from C:/bea/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/Phonebook/f6lg0m/war/WEB-INF/lib/jruby-rack-0.9.6.jar!/jruby/rack/booter.rb:22:in boot!’
from
C:/bea/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/Phonebook/f6lg0m/war/WEB-INF/lib/jruby-rack-0.9.6.jar!/jruby/rack/boot/rack.rb:9
from
C:/bea/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/Phonebook/f6lg0m/war/WEB-INF/lib/jruby-rack-0.9.6.jar!/jruby/rack/boot/rack.rb:1:in
`load’
from :1

-Satynos

On Tue, Dec 22, 2009 at 3:51 PM, Saty N. [email protected] wrote:

I was able to download JRuby-Rack-0.9.6 and switched it with 0.9.5,
still getting the same error (following):

Application initialization failed: no such file to load – rack

Is rack 1.0.x in vendor/gems? And what jar files do you have in lib/ ?
How are you creating the WAR file?


Hassan S. ------------------------ [email protected]
twitter: @hassan


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hassan S. wrote:

On Wed, Dec 16, 2009 at 12:54 PM, Saty N. [email protected] wrote:

C:/bea/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/Phonebook/f6lg0m/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/vendor/rack.rb:1

You might want to try installing jruby-rack-0.9.6; I vaguely (sorry,
it’s
been quite a while) recall some problem I had being fixed with that.

Yes, I should keep better notes :slight_smile:


Hassan S. ------------------------ [email protected]
twitter: @hassan


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Where can I get jruby-rack-0.9.6, all I see is that 0.9.5 is the latest
version at github.com

Thanks in advance.
-Satynos

And if you have rack inside the war and it is still broken,
try to deploy the war unzipped into weblogic,
I had a similar issue with JBoss and Liferay and it only works when the
war is unzipped.
Otherwise the jruby.home get set to a path where it can’t find rack, and
hence the error at hand.

Cheers,
Luis Landeiro R.

Hassan S. wrote:

How are you creating the WAR file?


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Have you filed a bug for this? You may want to stop by #jruby on IRC
(maybe after the holidays) and we can try to walk you through it.

On Tue, Dec 22, 2009 at 2:35 PM, Saty N. [email protected] wrote:

C:/bea/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/Phonebook/f6lg0m/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/vendor/rack.rb:1
`load’


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

Hi

I am having the same problem, try to deploy a JRuby appplication to
Weblogic 10.3.

<ServletContext-/ruby> <[STANDBY]
ExecuteThread: ‘3’ for queue: ‘weblogic.kernel.Default (self-tuning)’>
<> <> <1264681808462> <unable to create shared
application instance
org.jruby.rack.RackInitializationException: no such file to load – rack
from
C:/Oracle/Middleware/user_projects/domains/my_domain/servers/AdminServer/tmp/_WL_user/bookstore/v4z4qq/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/vendor/rack.rb:1
from
C:/Oracle/Middleware/user_projects/domains/my_domain/servers/AdminServer/tmp/_WL_user/bookstore/v4z4qq/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/vendor/rack.rb:22:in
require' from C:/Oracle/Middleware/user_projects/domains/my_domain/servers/AdminServer/tmp/_WL_user/bookstore/v4z4qq/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/jruby/rack/booter.rb:22:inboot!’
from
C:/Oracle/Middleware/user_projects/domains/my_domain/servers/AdminServer/tmp/_WL_user/bookstore/v4z4qq/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/jruby/rack/rails.rb:20:in
boot!' from C:/Oracle/Middleware/user_projects/domains/my_domain/servers/AdminServer/tmp/_WL_user/bookstore/v4z4qq/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/jruby/rack/boot/rack.rb:9 from C:/Oracle/Middleware/user_projects/domains/my_domain/servers/AdminServer/tmp/_WL_user/bookstore/v4z4qq/war/WEB-INF/lib/jruby-rack-0.9.5.jar!/jruby/rack/boot/rack.rb:1:inload’
from :1

my env is:
window 7 64
weblogic 10.3
jruby 1.4
actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activerecord-oracle_enhanced-adapter (1.2.3)
activeresource (2.3.5)
activesupport (2.3.5)
gem_plugin (0.2.3)
jruby-jars (1.4.0)
jruby-openssl (0.6)
mongrel (1.1.5)
rack (1.1.0, 1.0.1)
rails (2.3.5)
rake (0.8.7)
rspec (1.3.0, 1.2.9)
sources (0.0.1)
warbler (0.9.14)

Downloaded jruby-rack-0.9.6.jar, still the same error msg.

Please advise how to work around this problem.

Tony

Hi Tony,

My understanding is that JRuby/Rack is being confused on some app
servers when you deploy WAR into such servers unexpanded, there is
some black magic happens when JRuby tries to load resources from the
JAR/WAR files directly and it breaks in some cases due to custom
classloader schemes some app servers do.

The best suggestion so far is to try to deploy the app expanded, not in
a WAR.

See also http://jira.codehaus.org/browse/JRUBY-3935

In your example, is the following JAR really exist?
C:/Oracle/Middleware/user_projects/domains/my_domain/servers/AdminServer/tmp/_WL_user/bookstore/v4z4qq/war/WEB-INF/lib/jruby-rack-0.9.5.jar

Thanks,
–Vladimir

On Fri, Jan 29, 2010 at 1:29 AM, Tony G. [email protected] wrote:

from
from
actionmailer (2.3.5)
rails (2.3.5)

Posted via http://www.ruby-forum.com/.


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

On Wed, Dec 23, 2009 at 11:45 AM, Luis R. [email protected]
wrote:

And if you have rack inside the war and it is still broken,
try to deploy the war unzipped into weblogic,
I had a similar issue with JBoss and Liferay and it only works when the war
is unzipped.
Otherwise the jruby.home get set to a path where it can’t find rack, and
hence the error at hand.

Yes, that’s the case. My comments about the situation can be found here:
http://bit.ly/5TvYp3

I made an attempt to allow JRuby to use “classpath:/foo/bar” scheme to
load resources, so that, for example, we could work with JBoss’ custom
vfszip:/ scheme (just loading from the classpath, having JRuby’s home
set to classpath:/META-INF/jruby.home), but there is a problem with
living purely on the classpath. For one, there is no glob support for
resources on classpath, and rubygems uses glob to find installed gems.
So, without rubygems changes, it won’t work with classpath:/ scheme,
unfortunately.

As a workaround (or, maybe, not only a workaround, but also a good
practice), indeed, one need to unpack the WARs, and then things should
work.

Thanks,
–Vladimir

still getting the same error (following):


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