users@glassfish.java.net

Re: Shifting failed. Permission denied?

From: Vivek Pandey <Vivek.Pandey_at_Sun.COM>
Date: Thu, 17 Sep 2009 10:20:38 -0700

You are using fairly old glassfish build. I would recommend using either
[1] or [2]. I suspect the bug might be there as well but its worth a try.

Ruby support in glassfish wires up Rails logger middleware to glassfish
logger. So the logging will really be happening inside glassfish
server.log. For log rotation, you can tell glassfish to handle it or
tell glassfish to use system logger (unix system logger).

@logger |= begin; require 'logger'; Logger.new(GlassFishLogger.new); end

I am not sure if you are creating a new Logger by yourself or using
Rails logger to write your log files. In the latter case what might be
happening is that Glassfish logger has control on the opened file and
when Ruby Logger tries to shift it it might be running in to this
permission issue.

Please open an issue under jruby at
https://glassfish.dev.java.net/servlets/ProjectIssues and provide a
testcase, specially your logger code that I could use in a Rails app to
reproduce this issue.

-vivek

[1]http://download.java.net/glassfish/v3-preview/promoted/glassfish-v3-web-preview-b47d.zip
[2]http://download.java.net/glassfish/v3/promoted/glassfish-v3-b63.zip

glassfish_at_javadesktop.org wrote:
> I am running some Ruby on Rails application with JRuby 1.3.1 + GlassFish (v3-b34-01_26_2009 build) and just found out the Ruby logger is unable to shift and the stack trace is below.
>
> I guess it has something to do with the GlassFish because there is no problem at all if I run the Rails application with JRuby 1.3.1 + Mongrel
>
> I am sure that there is no disk space issue and there is no permission set in the target log directory.
>
> Any idea? Thanks!!
>
>
>
> Sep 17, 2009 8:46:13 AM
> INFO: Shifting failed. Permission denied - Permission denied - C:/projects/myapps/deploy/runtime/log/myapps_ruby.log or C:/pro
> jects/myapps/deploy/runtime/log/myapps_ruby.log.0
> Sep 17, 2009 8:46:13 AM
> INFO:
>
> Sep 17, 2009 8:46:13 AM
> INFO: C:/dev-tools/jruby-1.3.1/lib/ruby/1.8/logger.rb:501:in `write'
> C:/dev-tools/jruby-1.3.1/lib/ruby/1.8/monitor.rb:191:in `mon_synchronize'
> C:/dev-tools/jruby-1.3.1/lib/ruby/1.8/logger.rb:496:in `write'
> C:/dev-tools/jruby-1.3.1/lib/ruby/1.8/logger.rb:326:in `add'
> C:/dev-tools/jruby-1.3.1/lib/ruby/1.8/logger.rb:392:in `error'
> C:\projects/myapps/deploy/servers/myapps_web/app/controllers/room_schedules_controller.rb:36:in `add_problems'
> C:/dev-tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:1253:in `perform_action'
> C:/dev-tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:617:in `call_filters'
> C:/dev-tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:610:in `perform_action_with_filt
> ers'
> C:/dev-tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb:68:in `perform_action_with_
> benchmark'
> C:/dev-tools/jruby-1.3.1/lib/ruby/1.8/benchmark.rb:293:in `measure'
> C:/dev-tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb:68:in `perform_action_with_
> benchmark'
> C:/dev-tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/rescue.rb:136:in `perform_action_with_rescu
> e'
> C:/dev-tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:13:in `perform_action_
> with_caching'
> C:/dev-tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:3
> 4:in `cache'
> C:/dev-tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/query_cache.rb:8:in `cache'
> C:/dev-tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:12:in `perform_action_
> with_caching'
> C:/dev-tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:524:in `process'
> C:/dev-tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:606:in `process_with_filters'
> C:/dev-tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/session_management.rb:134:in `process_with_
> session_management_support'
> C:/dev-tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:392:in `process'
> C:/dev-tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:183:in `handle_request'
> C:/dev-tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:110:in `dispatch_unlocked'
> C:/dev-tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:120:in `dispatch'
> C:/dev-tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:132:in `dispatch_cgi'
> C:/dev-tools/jruby-1.3.1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:39:in `dispatch'
> file:/C:/dev-tools/glassfish-v3-b34-01_26_2009/glassfish/modules/grizzly-jruby.jar!/rack/adapter/rails.rb:82:in `serve_rails'
> file:/C:/dev-tools/glassfish-v3-b34-01_26_2009/glassfish/modules/grizzly-jruby.jar!/rack/adapter/rails.rb:106:in `call'
> file:/C:/dev-tools/glassfish-v3-b34-01_26_2009/glassfish/modules/grizzly-jruby.jar!/jruby/rack/rails.rb:81:in `call'
> file:/C:/dev-tools/glassfish-v3-b34-01_26_2009/glassfish/modules/grizzly-jruby.jar!/rack/handler/grizzly.rb:55:in `call'
> [Message sent by forum member 'socalvin' (socalvin_at_hotmail.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=364436
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>