Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Labels:None
-
Environment:Mac OS X 10.6.7, STS 2.6.0 (released version)
Description
After adding a subclass to Person, an old version of the database cannot be upgraded using dbm commands. Both dbm-status and dbm-upgrade fail with the same errors.
I'm just guessing here but the cause appears to be that the Grails app can't start because the database hasn't been upgraded and the database can't be upgraded because the Grails app can't start.
I've been able to upgrade the database using the changelog with liquibase outside of the Grails app so the changelog itself doesn't appear to be the issue. (I've attached it in anyway.)
Here's the abbreviated stacktrace for dbm-status (full log attached):
2011-03-29 14:29:51,901 [Compass Gps Index] ERROR indexer.ScrollableHibernateIndexEntitiesIndexer - {hibernate}: Failed to index the database
org.hibernate.WrongClassException: Object with id: 1 was not of the specified subclass: com.infinitecampus.people.Person (Discriminator: null)
at org.hibernate.loader.Loader.getInstanceClass(Loader.java:1477)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1308)
at org.hibernate.loader.Loader.getRow(Loader.java:1230)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:603)
at org.hibernate.loader.Loader.loadSingleRow(Loader.java:291)
at org.hibernate.impl.ScrollableResultsImpl.prepareCurrentRow(ScrollableResultsImpl.java:254)
at org.hibernate.impl.ScrollableResultsImpl.next(ScrollableResultsImpl.java:123)
at org.compass.gps.device.hibernate.indexer.ScrollableHibernateIndexEntitiesIndexer.performIndex(ScrollableHibernateIndexEntitiesIndexer.java:129)
at org.compass.gps.device.support.parallel.ConcurrentParallelIndexExecutor$1$1.doInCompassWithoutResult(ConcurrentParallelIndexExecutor.java:105)
at org.compass.core.CompassCallbackWithoutResult.doInCompass(CompassCallbackWithoutResult.java:29)
at org.compass.core.CompassTemplate.execute(CompassTemplate.java:130)
at org.compass.gps.impl.SingleCompassGps.executeForIndex(SingleCompassGps.java:162)
at org.compass.gps.device.support.parallel.ConcurrentParallelIndexExecutor$1.call(ConcurrentParallelIndexExecutor.java:103)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
I have a similar problem because I'm working with Weceem plugin. I upgraded Weceem, and I want to do a gorm update script. Both of these fail however because it seems that dbm-init scripts have dependencies on bootstrap & loadApp. These two dependencies try to load up the app, just to run an update script! Trying to load the app, with the Weceem plugin installed causes trouble because Weceem tries to execute some hibernate inserts with the new schema, but those tables don't exist yet. But I can't get database migration plugin to make the changelogs for it because it has to load up the app first. It seems impossible.
I've tried removing these two dependencies, but this produces an error on startup:
java.lang.ClassNotFoundException: grails.plugin.databasemigration.MigrationUtils at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at _DatabaseMigrationCommon_groovy$_run_closure1.doCall(_DatabaseMigrationCommon_groovy:41)Is there a workaround for me? I am using version Database Migration 1.0 and Weceem version 1.0 as well.