Problem with Rails 2.2.2 application under glassfish

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

On Wed, Feb 25, 2009 at 11:06 AM, James N. [email protected]
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

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