3.0-bin.zip'

snz8szmq  于 2021-07-22  发布在  Java
关注(0)|答案(1)|浏览(365)

我正在运行命令dbm gorm diff来使用liquibase向表中添加列。当我运行命令时,我得到错误:
|捕获到错误异常无法使用渐变分布执行生成https://services.gradle.org/distributions/gradle-3.0-bin.zip'.
这是我的gradle-wrapper.properties


# Mon Mar 15 08:44:17 EAT 2021

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip

下面是我的gradle.properties

grailsVersion=3.2.3
gradleWrapperVersion=3.0

下面是日志

grails> dbm-gorm-diff  
:compileJava UP-TO-DATE                                                          
:compileGroovy UP-TO-DATE                                                   
:buildProperties UP-TO-DATE
:processResources UP-TO-DATE      
:classes UP-TO-DATE
:findMainClass
:dbmGormDiff                 
ERROR grails.boot.config.tools.ClassPathScanner - The application defines a Groovy source using the default package. Please move all Groovy sources into a package.

> Building 85% > :dbmGormDiff
Configuring Spring Security Core ...
... finished configuring Spring Security Core

ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - Unknown column 'this_.cell_number' in 'field list'
ERROR grails.plugins.quartz.listeners.ExceptionPrinterJobListener - Exception occurred in job: Grails Job
org.quartz.JobExecutionException: org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: could not extract ResultSet; bad SQL grammar [n/a]; nested
exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'this_.cell_number' in 'field list'
        at grails.plugins.quartz.GrailsJobFactory$GrailsJob.execute(GrailsJobFactory.java:111)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: could not extract ResultSet; bad SQL grammar [n/a]; nested exception is com.mysql.
jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'this_.cell_number' in 'field list'
        at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231)
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
        at org.grails.orm.hibernate.GrailsHibernateTemplate.convertJdbcAccessException(GrailsHibernateTemplate.java:668)
        at org.grails.orm.hibernate.GrailsHibernateTemplate.convertHibernateAccessException(GrailsHibernateTemplate.java:656)
        at org.grails.orm.hibernate.GrailsHibernateTemplate.doExecute(GrailsHibernateTemplate.java:247)
        at org.grails.orm.hibernate.GrailsHibernateTemplate.execute(GrailsHibernateTemplate.java:187)
        at org.grails.orm.hibernate.GrailsHibernateTemplate.executeWithNewSession(GrailsHibernateTemplate.java:137)
        at org.grails.orm.hibernate.AbstractHibernateDatastore.withNewSession(AbstractHibernateDatastore.java:320)
        at org.grails.orm.hibernate.AbstractHibernateGormStaticApi.withNewSession(AbstractHibernateGormStaticApi.groovy:59)
        at org.grails.datastore.gorm.GormEntity$Trait$Helper.withNewSession(GormEntity.groovy:999)
        at org.grails.datastore.gorm.GormEntity$Trait$Helper$withNewSession$2.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
        at com.omnitech.mis.User.withNewSession(User.groovy)
        at com.omnitech.mis.User$withNewSession.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
        at ysave.DrupalUserExportJob.execute(DrupalUserExportJob.groovy:19)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426)
        at grails.plugins.quartz.GrailsJobFactory$GrailsJob.execute(GrailsJobFactory.java:104)
        ... 2 common frames omitted
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'this_.cell_number' in 'field list'
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrConstructorNewInstance(ReflectiveInterceptor.java:1075)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        at com.mysql.jdbc.Util.getInstance(Util.java:386)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2617)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2778)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2834)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2156)
        at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2313)
        at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:70)
        at org.hibernate.loader.Loader.getResultSet(Loader.java:2122)
        at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1905)
        at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1881)
        at org.hibernate.loader.Loader.doQuery(Loader.java:925)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:342)
        at org.hibernate.loader.Loader.doList(Loader.java:2622)
        at org.hibernate.loader.Loader.doList(Loader.java:2605)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2434)
        at org.hibernate.loader.Loader.list(Loader.java:2429)
        at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:109)
        at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1787)
        at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:363)
        at org.grails.orm.hibernate.query.AbstractHibernateQuery.listForCriteria(AbstractHibernateQuery.java:700)
        at org.grails.orm.hibernate.query.AbstractHibernateQuery.list(AbstractHibernateQuery.java:690)
        at org.grails.datastore.gorm.finders.FindAllByFinder.invokeQuery(FindAllByFinder.java:54)
        at org.grails.datastore.gorm.finders.FindAllByFinder$1.doInSession(FindAllByFinder.java:48)
        at org.grails.datastore.mapping.core.DatastoreUtils.execute(DatastoreUtils.java:318)
        at org.grails.datastore.gorm.finders.AbstractFinder.execute(AbstractFinder.java:42)
        at org.grails.datastore.gorm.finders.FindAllByFinder.doInvokeInternal(FindAllByFinder.java:45)
        at org.grails.datastore.gorm.finders.DynamicFinder.invoke(DynamicFinder.java:174)
        at org.grails.datastore.gorm.finders.DynamicFinder.invoke(DynamicFinder.java:374)
        at org.grails.datastore.gorm.finders.FinderMethod$invoke$0.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:141)
        at org.grails.datastore.gorm.GormStaticApi.methodMissing(GormStaticApi.groovy:173)
        at org.grails.datastore.gorm.GormEntity$Trait$Helper.staticMethodMissing(GormEntity.groovy:749)
        at org.grails.datastore.gorm.GormEntity$Trait$Helper$staticMethodMissing$4.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:141)
        at com.omnitech.mis.User.staticMethodMissing(User.groovy)
        at com.omnitech.mis.User$staticMethodMissing$0.callStatic(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:56)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:194)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:214)
        at com.omnitech.mis.User.$static_methodMissing(User.groovy)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
        at groovy.lang.MetaClassImpl.invokeStaticMissingMethod(MetaClassImpl.java:1501)
        at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1489)
        at org.codehaus.groovy.runtime.callsite.StaticMetaClassSite.call(StaticMetaClassSite.java:53)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)

        at org.grails.orm.hibernate.GrailsHibernateTemplate$1.doInHibernate(GrailsHibernateTemplate.java:140)
        at org.grails.orm.hibernate.GrailsHibernateTemplate.doExecute(GrailsHibernateTemplate.java:243)
        ... 23 common frames omitted
Command execution error: Bean named 'sessionFactory' is expected to be of type [org.springframework.beans.factory.FactoryBean] but was actually of type [org.hibern
ate.internal.SessionFactoryImpl]
:dbmGormDiff FAILED          

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':dbmGormDiff'.
> Process 'command 'C:\Program Files\Java\jdk1.8.0_101\bin\java.exe'' finished with non-zero exit value 1

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1 mins 24.239 secs
| Error Caught exception Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-3.0-bin.zip'. (Use --stacktrace to see
 the full trace)

我发现如果我和别人分享我的身材我会得到更多的帮助

buildscript {
    ext {
        grailsVersion = project.grailsVersion
        dbmMigrationVersion = '2.0.0.RC4'
    }
    repositories {
        mavenLocal()
        maven { url "https://repo.grails.org/grails/core" }
    }
    dependencies {
        classpath "org.grails.plugins:database-migration:$dbmMigrationVersion"
        classpath "org.grails:grails-gradle-plugin:$grailsVersion"
        classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.5.0"
        classpath "org.grails.plugins:hibernate4:5.0.0"
    }
}

version "0.1"
group "something"

apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "war"
apply plugin: "org.grails.grails-web"
apply plugin: "org.grails.grails-gsp"
apply plugin: "asset-pipeline"
apply plugin: "java"

ext {
    grailsVersion = project.grailsVersion
    gradleWrapperVersion = project.gradleWrapperVersion
}

repositories {
    mavenLocal()
    maven { url "https://repo.grails.org/grails/core" }
    maven { url "http://jitpack.io"}
    maven { url "http://jcenter.bintray.com" }
    maven { url  "http://repository.codehaus.org"}
}

dependencyManagement {
    imports {
        mavenBom "org.grails:grails-bom:$grailsVersion"
    }
    applyMavenExclusions false
}

dependencies {
    compile 'com.github.kayr:fuzzy-csv:1.6.26'
    compile 'org.grails.plugins:spring-security-core:3.1.1'
    compile "org.springframework.boot:spring-boot-starter-logging"
    compile "org.springframework.boot:spring-boot-autoconfigure"
    compile "org.grails:grails-core"
    compile "org.springframework.boot:spring-boot-starter-actuator"
    provided "org.springframework.boot:spring-boot-starter-tomcat"
    compile "org.grails:grails-dependencies"
    compile "org.grails:grails-web-boot"
    compile "org.grails.plugins:cache"
    compile "org.grails.plugins:scaffolding"
    compile "org.grails.plugins:hibernate5"
    compile "org.hibernate:hibernate-core:5.1.2.Final"
    compile "org.hibernate:hibernate-ehcache:5.1.2.Final"
    console "org.grails:grails-console"
    profile "org.grails.profiles:web"
    runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.11.1"
    compile "org.grails.plugins:database-migration:$dbmMigrationVersion"
    compile 'org.grails.plugins:quartz:2.0.8'
    compile 'org.liquibase:liquibase-core:3.6.1'
    runtime "com.h2database:h2"
    runtime 'mysql:mysql-connector-java:5.1.29'
    testCompile "org.grails:grails-plugin-testing"
    testCompile "org.grails.plugins:geb"
    testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
    testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
    compile 'org.grails.plugins:audit-logging:2.0.1'
    compile 'org.grails.plugins:mail:2.0.0.RC1'
    compile 'com.xlson.groovycsv:groovycsv:1.1'
    compile 'org.apache.commons:commons-lang3:3.4'
    compile 'eu.bitwalker:UserAgentUtils:1.20'
}

sourceSets {
    main {
        resources {
            srcDir 'grails-app/migrations'
        }
    }
}
task wrapper(type: Wrapper) {
    gradleVersion = gradleWrapperVersion
}

assets {
    minifyJs = true
    minifyCss = true
}
mepcadol

mepcadol1#

尝试使用更新版本的gradle。可以尝试使用gradle-4.7-all或更新版本
尝试重命名 c:\users\MY USERNAME\.gradle 目录到 old-.gradle 或删除 .gradle 目录,然后尝试重新启动程序。

相关问题