Questions about jruby + jruby-rack + sinatra + warbler

Hello everyone!

Hope this is an appropriate place to post this. I’ve also gotten
questions onto the sinatra, warbler, and jruby-rack lists, but am
thinking it might be better here, but maybe I’m wrong. I am a lot. In a
nutshell, just read the questions within the many, many equals marks. I
don’t live in a nutshell often, which is why it spills between.

I’m having some trouble in our jruby + jruby-rack + sinatra app with the
following:

======================================================================================================================================================

  1. Trying to get a rack test working for a sinatra app (and I’ve used
    the recently updated Testing Sinatra with Rack::Test as an
    example) where the Sinatra app is using some jars for a custom client
    that I wrote.
    ======================================================================================================================================================

jruby -S rake test

I get:

(in /Users/garyweaver/dev/git/dmws)
“Classpath is "
“Classpath is (contains all jars required)”
(eval):1:in `include_class’: cannot load Java class
(fully qualified classname of class being called) (NameError)
rake aborted!
Command failed with status (1): [/(path to jruby)/jruby/bin/jruby -
I"lib” …]

(See full trace by running task with --trace)

Rakefile looks like:

—start copy/paste—
raise “Rake must be called with JRuby: try again with `jruby -S rake’”
unless defined?(JRUBY_VERSION)

p “Classpath is #{ENV[‘CLASSPATH’]}”
ENV[‘CLASSPATH’] = Dir[“#{File.expand_path ‘lib’}/*.jar”].join
(File::PATH_SEPARATOR)
p “Classpath is #{ENV[‘CLASSPATH’]}”

require ‘rubygems’
require ‘rake’
require ‘rake/testtask’

desc “Default: run all tests”
task :default => :test

desc “Run tests”
task :test => %w(test:units test:acceptance)
namespace :test do

desc “Run unit tests”
Rake::TestTask.new(:units) do |t|
t.test_files = FileList[“test/unit/*_test.rb”]
end

desc “Run acceptance tests”
Rake::TestTask.new(:acceptance) do |t|
t.test_files = FileList[“test/acceptance/*_test.rb”]
end
end
—end copy/paste—

======================================================================================================================================================
2. Trying to get some sort of standard logging with timestamp working in
the Sinatra app (assuming rack logger is best, but can’t get it to
work?)

In the sinatra controller script I wrote it has:

configure do
Sample = “test”
Version = Sinatra::VERSION
set :dump_errors, true
set :clean_trace, false

try to setup the rack logger

set :logging, false
Log = Logger.new(“myapplication.log”)
use Rack::CommonLogger, Log
end

post ‘/somepath’ do
#Log.debug “Request coming in: #{request.inspect}”

end

Here is the error I get:

uninitialized constant Logger from dc_controller.rb:33 from
/usr/java/apache-tomcat-6.0.18/webapps/dmws/WEB-INF/gems/gems/sinatra-0.9.2/lib/sinatra/base.rb:849:in

configure' from (__DELEGATE__):3:in configure’ from
dc_controller.rb:21 from dc_controller.rb:31:in `require’ from
file:/usr/java/apache-tomcat-6.0.18/webapps/dmws/WEB-INF/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in

`require’ from

======================================================================================================================================================
3. The recommended way to ensure that the jruby and jruby-rack jars and
other gems are consistent both in the version of the sinatra app tested
by rack-test and the warbled (warred) webapp, and are also all “frozen”
(including the jars) in the project itself and not scattered about under
the jruby installation’s gems.

Part of this (the keeping the jruby and jruby-rack jars in the project
directory structure that warbler uses at least) could be solved I guess
with the stuff that Nick put here:

Specifically something similar to this part (except paths would need to
be different, and would also want jruby in there):

config.java_libs.delete_if {|f| f =~ /jruby-rack/}
config.java_libs += FileList[“…/…/target/jruby-rack*.jar”]

======================================================================================================================================================
4. I’d like to easily be able to work with the most recent version of
jruby and jruby-rack jars instead of building the version in git with
ant jar-complete and putting it into (jruby
install dir)/lib/ruby/gems/1.8/gems/warbler-0.9.13/lib/ which for
whatever reason in my case still causes warbler to include the released
jruby-complete jar (1.3.0RC1) instead of just the locally-built one.

Other than the method mentioned in #3 above for warbler including diff
jars, is it possible to grab some nightly build of the jruby complete
and jruby-rack jars from some Ivy/Maven 2 repo or similar that you’d
recommend?

Thanks!

Gary


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Charley,

Thanks for the quick reply! Answers inline with additional info:

Charles Oliver N. wrote:

jruby -S rake test
I"lib" …]

Two things to check: is the Java class you’re referencing available to
the JVM somehow (classpath, require’d jar, etc) and does passing -d to
JRuby produce any additional error information?

I try to make it available via setting the classpath env in the
Rakefile.

in the Rakefile, I do:

p “Classpath is #{ENV[‘CLASSPATH’]}”
ENV[‘CLASSPATH’] = Dir["#{File.expand_path
‘lib’}/*.jar"].join(File::PATH_SEPARATOR)
p “Classpath is #{ENV[‘CLASSPATH’]}”

and it outputs nothing in the classpath originally and all of the jars I
need (that work in the warbled version, without anything other than the
normal tomcat stuff in tomcat’s common/lib common/classes shared/lib or
shared/classes.

I just did a clean install of JRuby1.3.0RC2 and installed (only) the
latest versions of these gems:

jruby-1.3.0RC2
rake-0.8.7
rack-1.0.0
jruby-openssl-0.5
sinatra-0.9.2
warbler-0.9.13
rest-client-0.9.2
rack-test-0.3.0
xml-simple-1.0.12

Then ran it again with debug and trace and got something a bit different
now. Is this a rake issue?:

$ jruby -d -S rake test --trace
(in /Users/garyweaver/dev/git/dmws)
“Classpath is "
“Classpath is (contains jar the class exists in as well as
dependencies)”
** Invoke test (first_time)
** Invoke test:units (first_time)
** Execute test:units
rake aborted!
Command failed with status (1): [/Users/garyweaver/jruby/bin/jruby
-I"lib” …]
/Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:995:in
sh' /Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1010:incall’
/Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1010:in
sh' /Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1098:insh’
/Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1029:in
ruby' /Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1098:inruby’
/Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/testtask.rb:117:in
define' /Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1112:inverbose’
/Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/testtask.rb:102:in
define' /Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:incall’
/Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
execute' /Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:ineach’
/Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
execute' /Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:ininvoke_with_call_chain’
/Users/garyweaver/jruby/lib/ruby/1.8/monitor.rb:191:in mon_synchronize' /Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:ininvoke_with_call_chain’
/Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in
invoke_prerequisites' /Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:ineach’
/Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in
invoke_prerequisites' /Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:ininvoke_with_call_chain’
/Users/garyweaver/jruby/lib/ruby/1.8/monitor.rb:191:in mon_synchronize' /Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:ininvoke_with_call_chain’
/Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in
invoke' /Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:ininvoke_task’
/Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
top_level' /Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:ineach’
/Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
top_level' /Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:instandard_exception_handling’
/Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in
top_level' /Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:inrun’
/Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
standard_exception_handling' /Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:inrun’
/Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:19:in
`load’
/Users/garyweaver/jruby/bin/rake:19

I’m not sure about this one. You are running on a very recent JRuby, yes?
Yes, I was using a build from git (trunk) of jruby last week, but I just
did fresh install of jruby 1.3.0RC2 as stated above and I get the same
now also:

uninitialized constant Logger from dc_controller.rb:32 from
/usr/java/apache-tomcat-6.0.18/webapps/dmws/WEB-INF/gems/gems/sinatra-0.9.2/lib/sinatra/base.rb:849:in
configure' from (__DELEGATE__):3:inconfigure’ from
dc_controller.rb:20 from dc_controller.rb:31:in require' from file:/usr/java/apache-tomcat-6.0.18/webapps/dmws/WEB-INF/lib/jruby-complete-1.3.0RC1.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’ from

config.java_libs += FileList["…/…/target/jruby-rack*.jar"]
released jruby-complete jar (1.3.0RC1) instead of just the
that will also contain the bits Warbler uses. That should easy the
upgrade process, so you’d just install a newer jruby-jars and have
access to it.

Thanks! Sounds cool!


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Gary W. wrote:

I get:

(in /Users/garyweaver/dev/git/dmws)
“Classpath is "
“Classpath is (contains all jars required)”
(eval):1:in `include_class’: cannot load Java class
(fully qualified classname of class being called) (NameError)
rake aborted!
Command failed with status (1): [/(path to jruby)/jruby/bin/jruby -
I"lib” …]

Two things to check: is the Java class you’re referencing available to
the JVM somehow (classpath, require’d jar, etc) and does passing -d to
JRuby produce any additional error information?

======================================================================================================================================================

  1. Trying to get some sort of standard logging with timestamp working in
    the Sinatra app (assuming rack logger is best, but can’t get it to work?)
    ======================================================================================================================================================

I’m not sure about this one. You are running on a very recent JRuby,
yes?

Part of this (the keeping the jruby and jruby-rack jars in the project
directory structure that warbler uses at least) could be solved I guess
with the stuff that Nick put here:
jruby-rack/examples/sinatra/config/warble.rb at bb21bd148433c77a3ccd4e5d99b4d0b3a89e4917 · nicksieger/jruby-rack · GitHub

Specifically something similar to this part (except paths would need to
be different, and would also want jruby in there):

config.java_libs.delete_if {|f| f =~ /jruby-rack/}
config.java_libs += FileList[“…/…/target/jruby-rack*.jar”]

Yeah, this is more a question for Nick, I’m not sure about it.

Other than the method mentioned in #3 above for warbler including diff
jars, is it possible to grab some nightly build of the jruby complete
and jruby-rack jars from some Ivy/Maven 2 repo or similar that you’d
recommend?

Hopefully with JRuby 1.3 we’ll have a release of a “jruby-jars” gem that
will also contain the bits Warbler uses. That should easy the upgrade
process, so you’d just install a newer jruby-jars and have access to it.

Nick, I think we need to get that 100% before 1.3 release, do you know
where it stands?

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Charles Oliver N. wrote:

Hopefully with JRuby 1.3 we’ll have a release of a “jruby-jars” gem that
will also contain the bits Warbler uses. That should easy the upgrade
process, so you’d just install a newer jruby-jars and have access to it.

Nick, I think we need to get that 100% before 1.3 release, do you know
where it stands?

FYI, I just tried the jruby-jars gem stuff and it works fine. I don’t
know what I was smoking before.

So there will be a jruby-jars-1.3.0.gem release along with 1.3.0, and
warbler, reggae, rawr and friends can start depending on it.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Gary W. wrote:

and it outputs nothing in the classpath originally and all of the jars I
need (that work in the warbled version, without anything other than the
normal tomcat stuff in tomcat’s common/lib common/classes shared/lib or
shared/classes.

I’m not sure if we look at ENV[‘CLASSPATH’] after startup. Is this for
passing along to a subprocess? You may want to update classpath using
the $CLASSPATH global ($CLASSPATH << some libs) or just require the jar
files.

rake aborted!
Command failed with status (1): [/Users/garyweaver/jruby/bin/jruby
-I"lib" …]

We need to see what that command was and what error it actually
produced…

I’m not sure about this one. You are running on a very recent JRuby, yes?

Yes, I was using a build from git (trunk) of jruby last week, but I just
did fresh install of jruby 1.3.0RC2 as stated above and I get the same
now also:

Are you able to access Logger outside of Sinatra?

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Charlie,

Thanks so much again for the quick response! Response inline…

Charles Oliver N. wrote:

p “Classpath is #{ENV[‘CLASSPATH’]}”

and it outputs nothing in the classpath originally and all of the
jars I need (that work in the warbled version, without anything other
than the normal tomcat stuff in tomcat’s common/lib common/classes
shared/lib or shared/classes.

I’m not sure if we look at ENV[‘CLASSPATH’] after startup. Is this for
passing along to a subprocess? You may want to update classpath using
the $CLASSPATH global ($CLASSPATH << some libs) or just require the
jar files.

I basically just need some way to get custom jars into the classpath or
the classloader that will be used by Sinatra/Rack when called from rack
test.

So if I do this in the Rakefile, would that work? (if those custom jars
are in the lib dir):

$CLASSPATH << Dir["#{File.expand_path
‘lib’}/*.jar"].join(File::PATH_SEPARATOR)

Unfortunately due to the other new issue running rake below, it dies
before the actual test now.

** Invoke test:units (first_time)
** Execute test:units
rake aborted!
Command failed with status (1): [/Users/garyweaver/jruby/bin/jruby
-I"lib" …]

We need to see what that command was and what error it actually
produced…

The part in rake is:

def sh(*cmd, &block)
options = (Hash === cmd.last) ? cmd.pop : {}
unless block_given?
show_command = cmd.join(" ")
show_command = show_command[0,42] + “…” unless $trace
# TODO code application logic heref show_command.length > 45
block = lambda { |ok, status|
ok or fail “Command failed with status (#{status.exitstatus}):
[#{show_command}]” <<<- this is where it fails

I commented out the second show_command line to keep it from truncating
the command (for whatever reason --trace is not setting $trace it
seems?) and ran again and got:

$ jruby -S rake test --trace
(in /Users/garyweaver/dev/git/dmws)
** Invoke test (first_time)
** Invoke test:units (first_time)
** Execute test:units
rake aborted!
Command failed with status (1): [/Users/garyweaver/jruby/bin/jruby
-I"lib"
“/Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb”
“test/unit/dmws_test.rb” ]
/Users/garyweaver/jruby-1.3.0RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:995:in
`sh’
… (rest of trace is not interesting)

Is the -I is parked up too close to “lib” in that command or is that ok?
If it is, is that a rake issue?

Currently my Rakefile looks like the following:

— start copy/paste —

raise “Rake must be called with JRuby: try again with `jruby -S rake’”
unless defined?(JRUBY_VERSION)
#raise “Read the README. You need to run runtests.sh to setup the
classpath” unless defined?(RUN_TESTS_CALLED)

$CLASSPATH << Dir["#{File.expand_path
‘lib’}/*.jar"].join(File::PATH_SEPARATOR)

require ‘rubygems’
require ‘rake’
require ‘rake/testtask’

desc “Default: run all tests”
task :default => :test

desc “Run tests”
task :test => %w(test:units test:acceptance)
namespace :test do

desc “Run unit tests”
Rake::TestTask.new(:units) do |t|
t.test_files = FileList[“test/unit/*_test.rb”]
end

desc “Run acceptance tests”
Rake::TestTask.new(:acceptance) do |t|
t.test_files = FileList[“test/acceptance/*_test.rb”]
end
end

— end copy/paste —

I’m not sure about this one. You are running on a very recent JRuby,
yes?

Yes, I was using a build from git (trunk) of jruby last week, but I
just did fresh install of jruby 1.3.0RC2 as stated above and I get
the same now also:

Are you able to access Logger outside of Sinatra?

Figured it out after a while with messing with irb that I wasn’t doing a
require ‘logger’. Thanks! :slight_smile:

However, after I got past that I’ve got something new. It appears that
it is looking for Warbler in the deployed sinatra webapp when it
shouldn’t be maybe?:

The Sinatra app complains:

uninitialized constant #::Warbler from

and in the tomcat catalina.out it says:

May 29, 2009 4:28:41 PM org.apache.catalina.core.ApplicationContext log
SEVERE: unable to create shared application instance
org.jruby.rack.RackInitializationException: uninitialized constant
#Class:01x9467a6::Warbler
from :20
from
file:/usr/java/apache-tomcat-6.0.18/webapps/dmws/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/builder.rb:29:in
instance_eval' from file:/usr/java/apache-tomcat-6.0.18/webapps/dmws/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/builder.rb:29:ininitialize’
from :2

    at

org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:153)
at
org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:50)
at
org.jruby.rack.SharedRackApplicationFactory.init(SharedRackApplicationFactory.java:26)
at
org.jruby.rack.RackServletContextListener.contextInitialized(RackServletContextListener.java:39)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at
org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at
org.apache.catalina.core.StandardService.start(StandardService.java:516)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.jruby.exceptions.RaiseException: uninitialized constant
#Class:01x9467a6::Warbler
at
(unknown).require(file:/usr/java/apache-tomcat-6.0.18/webapps/dmws/WEB-INF/lib/jruby-complete-1.3.0RC1.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31)
at Module.const_missing(:20)
at
(unknown).(unknown)(file:/usr/java/apache-tomcat-6.0.18/webapps/dmws/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/builder.rb:29)
at
Kernel.instance_eval(file:/usr/java/apache-tomcat-6.0.18/webapps/dmws/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/builder.rb:29)
at
Kernel.instance_eval(file:/usr/java/apache-tomcat-6.0.18/webapps/dmws/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/builder.rb:29)
at Rack::Builder.initialize(:2)
at (unknown).(unknown)(:1)
May 29, 2009 4:28:41 PM org.apache.catalina.core.ApplicationContext log
SEVERE: Error: application initialization failed
org.jruby.rack.RackInitializationException: unable to create shared
application instance
at
org.jruby.rack.SharedRackApplicationFactory.init(SharedRackApplicationFactory.java:38)
at
org.jruby.rack.RackServletContextListener.contextInitialized(RackServletContextListener.java:39)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at
org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at
org.apache.catalina.core.StandardService.start(StandardService.java:516)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.jruby.rack.RackInitializationException: uninitialized
constant #Class:01x9467a6::Warbler
from :20
from
file:/usr/java/apache-tomcat-6.0.18/webapps/dmws/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/builder.rb:29:in
instance_eval' from file:/usr/java/apache-tomcat-6.0.18/webapps/dmws/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/builder.rb:29:ininitialize’
from :2

    at

org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:153)
at
org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:50)
at
org.jruby.rack.SharedRackApplicationFactory.init(SharedRackApplicationFactory.java:26)
… 25 more
Caused by: org.jruby.exceptions.RaiseException: uninitialized constant
#Class:01x9467a6::Warbler
at
(unknown).require(file:/usr/java/apache-tomcat-6.0.18/webapps/dmws/WEB-INF/lib/jruby-complete-1.3.0RC1.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31)
at Module.const_missing(:20)
at
(unknown).(unknown)(file:/usr/java/apache-tomcat-6.0.18/webapps/dmws/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/builder.rb:29)
at
Kernel.instance_eval(file:/usr/java/apache-tomcat-6.0.18/webapps/dmws/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/builder.rb:29)
at
Kernel.instance_eval(file:/usr/java/apache-tomcat-6.0.18/webapps/dmws/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/builder.rb:29)
at Rack::Builder.initialize(:2)
at (unknown).(unknown)(:1)

I tried removing the tmp dir used by warbler, removing everything from
vendor, blowing away tomcat’s work/Catalina/localhost, logs, and
previously deployed webapp and war, and verified that this is what it is
putting into the webapp in the version I just stripped down to test:

in (tomcat)/webapps/(mywebapp)/WEB-INF/gems/gems/:

jruby-openssl-0.5
rack-1.0.0
rest-client-1.0
sinatra-0.9.2

in (tomcat)/webapps/(mywebapp)/WEB-INF/lib/:

…(custom jar and other dependencies)
jruby-complete-1.3.0RC1.jar
jruby-openssl-0.5.tar.gz
jruby-rack-0.9.4.jar

Thanks in advance for any help you can provide.

Have a great weekend!

Gary


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email