Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread

 

By: Ken D
RE: Can you run Sinatra Extension in Glassfish? [ reply ]  
2009-09-17 17:45
I figured out how to get this working under glassfish. You just say the app name in the rackup, with no run before or after.

---The working config.ru---
require 'rubygems'
require 'rack/handler/grizzly'
require 'jruby/rack/grizzly_helper'

require 'myapp'
MyApp

--The working myapp.rb---
require 'sinatra/base'

class MyApp < Sinatra::Base
get "/" do
"hi"
end
end

By: Ken D
Can you run Sinatra Extension in Glassfish? [ reply ]  
2009-09-17 16:46
I'd like to run a Sinatra extension in glassfish, but I can't figure out how to get it to load grizzly in this configuration.

---The config.ru---
require 'rubygems'
require 'myapp'
MyApp.run!

---myapp.rb---

require 'rubygems'
require 'sinatra/base'

class MyApp < Sinatra::Base
set :server, 'grizzly'
get "/" do
"ok"
end
end

--The error---
After starting (jruby -S glassfish -l), I get:
Sep 17, 2009 12:37:47 PM com.sun.grizzly.jruby.rack.RackApplicationPoolAdapter initializeObject
SEVERE: Server handler (grizzly) not found.
This error means the following Sinatra line is failing:
return Rack::Handler.get(server_name.downcase)
and this is due to a Rack::Handler NameError:
'wrong constant name grizzly'