webtier@glassfish.java.net

Re: [webtier] JRuby on Rails on Glassfish -- Unexplainable NameError

From: Vivek Pandey <Vivek.Pandey_at_Sun.COM>
Date: Mon, 10 Nov 2008 16:51:43 -0800

webtier_at_javadesktop.org wrote:
> Hi, i'm trying to run a large rails app (12k+ LOC) under GF with the Glassfish v3 gem.
>
> I start the app with: $ jruby -S glassfish_rails
>
> The server starts without a hitch but as soon as I hit a controller I get a NameError:
> NameError: uninitialized constant PointObserver
>
> Now i'm sure this class is included in my environment's config.load_path -- in fact, starting a rails console session under jruby and typing PointObserver doesn't raise the exception, so i'm fairly sure this is isolated to my GF server. Furthermore, the app runs fine under JRuby WEBrick (jruby -S script/server webrick).
>
> Here is a link to the stack trace: http://pastie.org/311820
>
> My Setup:
> $ jruby --version => jruby 1.1.4 (ruby 1.8.6 patchlevel 114) (2008-09-23 rev 6586) [i386-java]
> $ glassfish --version => GlassFish gem version: 0.9.0
> Rails 2.0.2 "frozen" to vendor/rails
>
> Also, i'm seeing a bunch of warnings for reinitializing constants in my environment.rb file -- it appears as though the environment is being loaded more than once. I mention this as I think it might be related to the load error.
>
>
Thanks for reporting. There is a bug in the glassfish gem's rails
adapter where it is parsing environment.rb twice. I just fixed this.
Although not sure this is what was causing the NameError. Any chance you
can provide a testcase. OR maybe I can send you the patched jar file for
you to try out?


BTW, I opened an issue[1] at http://rubyforge.org/projects/glassfishgem/.

-vivek.
[1]http://rubyforge.org/tracker/index.php?func=detail&aid=22741&group_id=5450&atid=21080

> Any thoughts?
> [Message sent by forum member 'mwadhera' (mwadhera)]
>
> http://forums.java.net/jive/thread.jspa?messageID=315905
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>
>