将Grails数据库迁移文件的grails升级到2.5.0时出现Class Not Found错误

时间:2015-04-30 05:28:36

标签: grails database-migration grails-plugin

我正在尝试将Grails应用从2.4.3升级到2.5.0版本。 Grails 2.5.0包含修复和改进,但没有任何重大更改。此外,安装了所有2.5.0兼容的插件版本。

还通过了Grails数据库迁移插件更新日志和 其他插件支持grails 2.5.0。 遇到我现在面临的同样的JIRA问题 - Jira Link,但它已经在旧的Grails数据库迁移插件版本中得到修复。

BuildConfig.groovy

public void onDataChanged(DataEventBuffer dataEvents) {
        final List<DataEvent> events = FreezableUtils
                .freezeIterable(dataEvents);
        dataEvents.close();

        if (!mGoogleApiClient.isConnected()) {
            ConnectionResult connectionResult = mGoogleApiClient
                    .blockingConnect(30, TimeUnit.SECONDS);
            if (!connectionResult.isSuccess()) {
                Log.e(TAG,"WEAR :: Service failed to connect to GoogleApiClient.");
                return;
            }
        } else {
            Log.e(TAG,"WEAR :: Service connected to GoogleApiClient.");
        }

        for (DataEvent event : events) {
            if (event.getType() == DataEvent.TYPE_CHANGED &&
                    event.getDataItem().getUri().getPath().equals("/audio")) {

                DataMapItem dataMapItem = DataMapItem.fromDataItem(event.getDataItem());
                Asset audioAsset = dataMapItem.getDataMap().getAsset("Audio");
                DataExchange.setBuffer(loadAudioFromAsset(audioAsset));
                Log.w(TAG, "receive");
            }
        }
    }

栈跟踪 我在默认迁移位置grails.servlet.version = "3.0" // Change depending on target container compliance (2.5 or 3.0) grails.reload.enabled = true grails.project.class.dir = "target/classes" grails.project.test.class.dir = "target/test-classes" grails.project.test.reports.dir = "target/test-reports" grails.project.target.level = 1.6 grails.project.source.level = 1.6 grails.project.dependency.resolver = "maven" grails.project.dependency.resolution = { inherits("global") { } log "warn" checksums true // Whether to verify checksums on resolve repositories { inherits true // Whether to inherit repository definitions from plugins grailsPlugins() grailsHome() mavenLocal() grailsCentral() mavenCentral() mavenRepo "http://repo.grails.org/grails/core" // Dependency for export plugin. } dependencies { compile ("org.apache.jclouds.provider:cloudfiles-us:1.6.2-incubating", "org.jclouds:jclouds-compute:1.6.0") { excludes "jclouds-core" } compile 'commons-beanutils:commons-beanutils:1.8.3' compile "org.apache.jclouds:jclouds-core:1.7.2" runtime 'mysql:mysql-connector-java:5.1.29' } plugins { runtime ':database-migration:1.4.0' runtime ":hibernate:3.6.10.18" runtime ":jquery:1.11.0.2" runtime ":resources:1.2.14" compile ":scaffolding:2.1.2" compile ':cache:1.1.8' build ":tomcat:7.0.55.2" } }

上有名为upgrade-2.1.groovy的迁移文件
grails-app/migrations

1 个答案:

答案 0 :(得分:5)

这与插件或Grails无关 - 问题是upgrade-2.1不是Groovy脚本的有效名称。您只能使用有效类名的名称。你必须用另一个角色替换周期,也可能用短划线替换。试试upgrade_2_1.groovy