Forum: JRuby Problem with Rails 2.2.2 application under glassfish

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bcf23fd7e4ca8b75df30109fbe616b02?d=identicon&s=25 James Norton (Guest)
on 2009-02-25 20:07
(Received via mailing list)
I have an applications that was ported from Rails 1.x/tomcat to Rails
2.2.2/glassfish.  It runs correctly on mongrel using jruby 1.1.6, but
after
generating a war file using warbler and deploying to glassfish I get the
following error as soon as I access the application:

unable to create shared application instance
org.jruby.rack.RackInitializationException: migration database is not
configured

I don't understand why migrations should be invoked in the first place.

I ported the app by creating a new Rails 2.2.2 application and copying
things from my app dir into the new directory.  I also modified the
default
configs to suit the project (database, etc.).

Any ideas as to what could be going wrong here?

Thanks,

James
526d60de6472502bb570a9df2842b33b?d=identicon&s=25 Nick Sieger (Guest)
on 2009-02-25 23:41
(Received via mailing list)
On Wed, Feb 25, 2009 at 11:06 AM, James Norton <jamesnorton@gmail.com>
wrote:
>
> I ported the app by creating a new Rails 2.2.2 application and copying
> things from my app dir into the new directory.  I also modified the default
> configs to suit the project (database, etc.).
>
> Any ideas as to what could be going wrong here?

Not sure why it would work with Mongrel and not Glassfish/Warbler, but
can you make sure your environment files are current for 2.2.2 by
running "rake rails:update" in your application and try again?

/Nick

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Bcf23fd7e4ca8b75df30109fbe616b02?d=identicon&s=25 James Norton (Guest)
on 2009-02-26 16:17
(Received via mailing list)
I found the problem; I should have read the stack trace in more detail.
There is a model defined in this project that does not use the primary
database.  Instead it attempts to connect to a legacy database
(unfortunately reference as :migration) via the following line:

TrainingDocumentMigration.establish_connection(:migration)

This class is is no longer in use, and, unfortunately, no one ever
removed
it.  The :migration database entry WAS removed from database.yml.

I was originally confused by the mention of a migration database and did
not
read far enough down the stack trace to see that it was being invoked in
a
model.  Sorry for the false alarm.

I'm guessing that mongrel is not loading all the models until they are
referenced, while glassfish (or maybe just production mode) does.  In
any
case, thanks for the quick response.

-James
This topic is locked and can not be replied to.