Skip to content

Instantly share code, notes, and snippets.

@klauern
Created April 5, 2011 19:03
Show Gist options
  • Save klauern/904275 to your computer and use it in GitHub Desktop.
Save klauern/904275 to your computer and use it in GitHub Desktop.
require 'sinatra-caching'
run SinatraCache
13:57:19,031 INFO [org.torquebox.mc.vdf.PojoDeployment] Deploying: sinatra-caching -- "/C:/torquebox-apps/sinatra-caching"
13:57:19,062 INFO [org.torquebox.base.deployers.AuthDefaultsDeployer] No authentication configuration provided for this application. Using defaults.
13:57:19,062 INFO [org.torquebox.base.deployers.AuthDefaultsDeployer] Authentication Domain: torquebox-auth
13:57:19,109 WARN [org.torquebox.interp.deployers.BaseRubyRuntimeDeployer] Ruby runtime already configured as RACK: AbstractVFSDeploymentContext@29652903{sinatra-caching}
13:57:19,265 INFO [org.torquebox.interp.core.RubyRuntimeFactoryImpl] Creating ruby runtime (ruby_version: RUBY1_8, compile_mode: JIT)
13:57:26,453 INFO [STDOUT] Loading torquebox-web gem hook
13:57:26,468 INFO [org.torquebox.interp.core.RubyRuntimeFactoryImpl] Creating ruby runtime (ruby_version: RUBY1_8, compile_mode: JIT)
13:57:33,531 INFO [STDOUT] Loading torquebox-web gem hook
13:57:33,640 INFO [org.jboss.web.tomcat.service.deployers.TomcatDeployment] deploy, ctxPath=/caching
13:57:33,656 WARN [org.jboss.web.tomcat.service.deployers.JBossContextConfig] Failed to setup clustering, clustering disabled. ClusteringNotSupportedException: No DistributedCacheManagerFactory service provider found.
13:57:33,718 INFO [org.torquebox.base.deployers.DeploymentNotifier] Fully deployed: sinatra-caching
13:57:33,718 INFO [org.torquebox.mc.vdf.PojoDeployment] Fully deployed: "/C:/torquebox-apps/sinatra-caching"
13:58:15,187 ERROR [org.torquebox.rack.core.servlet.RackFilter] Error invoking Rack filter: org.jruby.exceptions.RaiseException: (NameError) uninitialized constant TorqueBox::Registry
at org.jruby.RubyModule.const_missing(org/jruby/RubyModule.java:2528) [:]
13:58:15,187 ERROR [org.torquebox.rack.core.servlet.RackFilter] Underlying Ruby exception
13:58:15,187 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/caching].[torquebox.500]] Servlet.service() for servlet torquebox.500 threw exception: org.jruby.exceptions.RaiseException: (NameError) uninitialized
constant TorqueBox::Registry
at org.jruby.RubyModule.const_missing(org/jruby/RubyModule.java:2528) [:]
13:58:18,843 ERROR [org.torquebox.rack.core.servlet.RackFilter] Error invoking Rack filter: org.jruby.exceptions.RaiseException: (NameError) uninitialized constant TorqueBox::Registry
at org.jruby.RubyModule.const_missing(org/jruby/RubyModule.java:2528) [:]
13:58:18,843 ERROR [org.torquebox.rack.core.servlet.RackFilter] Underlying Ruby exception
13:58:18,859 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/caching].[torquebox.500]] Servlet.service() for servlet torquebox.500 threw exception: org.jruby.exceptions.RaiseException: (NameError) uninitialized
constant TorqueBox::Registry
at org.jruby.RubyModule.const_missing(org/jruby/RubyModule.java:2528) [:]
require 'sinatra/base'
require 'torquebox'
require 'active_support'
class SinatraCache < Sinatra::Base
set :cache, ActiveSupport::Cache::TorqueBoxStore.new
get '/time' do
settings.cache.write "now", Time.now
end
get '/' do
"Hello world!\nCache contains:\n#{settings.cache.read("now")}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment