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

Vladimir S. wrote:

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

Hi Vladimir,

Yes 3 jars exists in
C:/Oracle/Middleware/user_projects/domains/my_domain/servers/AdminServer/tmp/_WL_user/bookstore/v4z4qq/war/WEB-INF/lib/

jruby-core-1.4.0.jar
jruby-rack-0.9.5.jar
jruby-stdlib-1.4.0.jar

Also before any error occured, there is a warning as well:

Warning: JRuby home “C:…/war/WEB-INF/lib/jruby-stdlib-1.4.0.jar!
/META-INF/jruby.home” does not exist, using
C:\DOCUME~1\username\LOCALS~1\Temp\

if it can’t get into this dir, would this be the root cause.

The war file deploy in weblogic and expanded to the dir
C:/Oracle/Middleware/user_projects/domains/my_domain/servers/AdminServer/tmp/_WL_user/bookstore/v4z4qq/war/,
everything expanded/unziped under this dir (apart from the jar files
above).

How to deploy an application and not pack into war/ear file in weblogic?
If anyone can point me to the right direction, please.

Have been try to resolved the problem for a while, only two places seem
really understand the problem, here and
http://jira.codehaus.org/browse/JRUBY-3935, but I still haven’t work out
how to get it work.

Many Thanks

Tony

Vladimir S. wrote:

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

Hi I created an exploded Archive directory instead of the war file,
deployed to the app server, got a class not found error:

java.lang.ClassNotFoundException:
org.jruby.rack.rails.RailsServletContextListener

also try unziped the 3 jar files into 3 subdirectory same name as the
jar files:

jruby-core-1.4.0.jar
jruby-rack-0.9.5.jar
jruby-stdlib-1.4.0.jar

and deployed again, same error.

Tony

Tony:

Following are the changes I made to successfully deploy my app both on
Weblogic 10.2 and 10.3

(1) in config/warble.rb

#JARS
config.java_libs.delete_if {|f| f =~ /jruby-rack/ || f =~
/jruby-complete/ }
config.java_libs = FileList[“lib/*.jar”]

GEMS

Rails 2.3.5 needs rack 1.0.1

config.gems << Gem::Dependency.new(“rack”, “= 1.0.1”) #“rack”

(2) place jruby.jar and jruby-rack-0.9.5.jar files in your apps lib
directory

(3) explicitly set the jruby.home, jruby.base and jruby.lib JAVA_OPTIONS
in C:\bea\wlserver_10.3\samples\domains\wl_server\bin\setDomainEnv.cmd
or pass them to the startweblogic

set JAVA_OPTIONS=%JAVA_OPTIONS%
-Djruby.base=C:\wamp\bin\jruby\jruby-1.4.0
-Djruby.home=C:\wamp\bin\jruby\jruby-1.4.0
-Djruby.lib=C:\wamp\bin\jruby\jruby-1.4.0\lib

After these 3 changes, my app was running fine. I guess it is more to do
with the 3rd change. Let me know how it goes. If successful, we can
update the jruby wiki documentation accordingly.

-Satynos

Tony:

Glad it solved your problem. Let us know how the deployment of your
actual application along with the JDBC connection goes. As I said before
if it works for you, we could provide a wiki entry which could help
others.

-satynos (Dharam)

Saty N. wrote:

Tony:

Following are the changes I made to successfully deploy my app both on
Weblogic 10.2 and 10.3

(1) in config/warble.rb

#JARS
config.java_libs.delete_if {|f| f =~ /jruby-rack/ || f =~
/jruby-complete/ }
config.java_libs = FileList[“lib/*.jar”]

GEMS

Rails 2.3.5 needs rack 1.0.1

config.gems << Gem::Dependency.new(“rack”, “= 1.0.1”) #“rack”

(2) place jruby.jar and jruby-rack-0.9.5.jar files in your apps lib
directory

(3) explicitly set the jruby.home, jruby.base and jruby.lib JAVA_OPTIONS
in C:\bea\wlserver_10.3\samples\domains\wl_server\bin\setDomainEnv.cmd
or pass them to the startweblogic

set JAVA_OPTIONS=%JAVA_OPTIONS%
-Djruby.base=C:\wamp\bin\jruby\jruby-1.4.0
-Djruby.home=C:\wamp\bin\jruby\jruby-1.4.0
-Djruby.lib=C:\wamp\bin\jruby\jruby-1.4.0\lib

After these 3 changes, my app was running fine. I guess it is more to do
with the 3rd change. Let me know how it goes. If successful, we can
update the jruby wiki documentation accordingly.

-Satynos

Hi Dharam,

Created a very simple app “books” and following the steps you given, it
deployed to weblogic 10.3 without any error! I can read/create/delete a
record from my app. Next thing will try to setup the JDBC connection.

Thanks very much for your help.

Tony

On Sun, Jan 31, 2010 at 12:36 PM, Saty N. [email protected] wrote:

Tony:

Glad it solved your problem. Let us know how the deployment of your
actual application along with the JDBC connection goes. As I said before
if it works for you, we could provide a wiki entry which could help
others.

And ideally we may want to provide the appropriate logic/bits/helpers
within warbler or jruby-rack or something to report an error or
warning or something. We don’t want people to keep running into
useless errors when they deploy to servers that don’t explode WARs to
the filesystem.

Do you think you know a good place where we could put an error?

Definitely add this to the wiki somewhere ASAP…don’t be afraid!

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email