Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring &引用;加载插件管理器时出错:TomcatGrailsPlugin";关于Grails2.3数据库迁移_Spring_Grails_Grails Plugin_Grails 2.0_Database Migration - Fatal编程技术网

Spring &引用;加载插件管理器时出错:TomcatGrailsPlugin";关于Grails2.3数据库迁移

Spring &引用;加载插件管理器时出错:TomcatGrailsPlugin";关于Grails2.3数据库迁移,spring,grails,grails-plugin,grails-2.0,database-migration,Spring,Grails,Grails Plugin,Grails 2.0,Database Migration,我使用Grails2.3和Grails数据库迁移插件(1.3.6) 当我进行grailsdbm更新时,我得到以下错误。如何解决此错误 Error Error loading plugin manager: TomcatGrailsPlugin (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.) java.lang.ClassNotFoundException: TomcatGrailsPlugin

我使用Grails2.3和Grails数据库迁移插件(1.3.6)

当我进行grailsdbm更新时,我得到以下错误。如何解决此错误

 Error Error loading plugin manager: TomcatGrailsPlugin (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.ClassNotFoundException: TomcatGrailsPlugin
    at _GrailsBootstrap_groovy$_run_closure2.doCall(_GrailsBootstrap_groovy:40)
    at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
    at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
    at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
    at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
    at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
    at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
    at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
    at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
    at _GrailsBootstrap_groovy$_run_closure6.doCall(_GrailsBootstrap_groovy:64)
    at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
    at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
    at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
    at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
    at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
    at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
    at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
    at org.codehaus.gant.GantMetaClass.processClosure(GantMetaClass.java:81)
    at org.codehaus.gant.GantMetaClass.processArgument(GantMetaClass.java:95)
    at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:128)
    at _DatabaseMigrationCommon_groovy$_run_closure1.doCall(_DatabaseMigrationCommon_groovy:25)
    at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
    at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
    at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
    at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
    at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
    at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
    at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
    at org.codehaus.gant.GantMetaClass.processClosure(GantMetaClass.java:81)
    at org.codehaus.gant.GantMetaClass.processArgument(GantMetaClass.java:95)
    at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:128)
    at DbmUpdate$_run_closure1.doCall(DbmUpdate:23)
    at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
    at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
    at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
    at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
    at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
    at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
    at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
    at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
    at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
    at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
    at gant.Gant.withBuildListeners(Gant.groovy:427)
    at gant.Gant.this$2$withBuildListeners(Gant.groovy)
    at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
    at gant.Gant.dispatch(Gant.groovy:415)
    at gant.Gant.this$2$dispatch(Gant.groovy)
    at gant.Gant.invokeMethod(Gant.groovy)
    at gant.Gant.executeTargets(Gant.groovy:591)
    at gant.Gant.executeTargets(Gant.groovy:590)
| Error Error loading plugin manager: TomcatGrailsPlugin

尝试将buildConfig.groovy中的tomcat构建类型更改为compile而不是build:

compile':tomcat:7.0.42'

这是一个超级讨厌的bug。我的应用程序依赖于使用run脚本运行脚本,我得到了相同的行为。以下是我作为解决办法所做的:

plugins {
    ...
    // grails 2.3.2 and tomcat 7.0.42 cause scripts to not work :( Pass -DnoTomcat=true in the script args to fix this
    if (System.getProperty("noTomcat") == null) {
        build ":tomcat:7.0.42"
    }
}
然后在运行脚本时:

 grails -DnoTomcat=true run-script scripts/MyScript.groovy

当然很烦人,但至少你可以在等待修复时使用所有其他最新功能。

我在升级到2.3.2时也遇到了同样的问题

我用旗子试了上面的方法——D猫


它仍然不起作用。然后我意识到有一些引用tomcat的插件。在某种程度上,这似乎是遗留问题,因为新创建的Grails2.3.2插件没有对tomcat的引用。因此,我只是删除了插件中的所有引用,并将标志开关保留在我的主应用程序中

我使用的是Grails 2.3.4,但我是如何解决这个问题的:

  • 升级到数据库迁移1.3.8
  • 已清除我的脚本缓存文件夹
  • 执行的刷新依赖项

  • 重试了数据库迁移脚本,问题得到了解决。

    因此,如果您是因为脚本被2.3.x破坏而发现此问题,下面是我对该问题的总体发现。我仍然不能使用run脚本,因为它总是会失败,并出现可怕的TomcatPlugin丢失问题(我怀疑这意味着run脚本总是试图引导grails不受约束)。但是,我可以让脚本作为任务编译和运行。我的脚本总是会失败,因为我使用以下方法引导grails:

    includeTargets << grailsScript("_GrailsInit")
    includeTargets << grailsScript("_GrailsBootstrap")
    includeTargets << grailsScript("_GrailsClasspath")
    
    target(main: "Generate a secret key to be used with HMAC and AES algorithms") {
       depends(bootstrap)  // this is problem
    }
    
    这里有一些关于这个问题的Jira问题,这样你就知道什么时候所有这些都是错误的;-)


    只是一个小小的澄清,chubbsondubs在上面提到了这一点,但我在第一次阅读时就错过了

    通常,简单的答案是,不要做:

    grails run-script scripts/DoSomething
    
    只要这样做:

    grails do-something
    

    最近有一个日志记录了相同的问题。@dmahapatro您知道如何解决这个问题吗?@confile我在grails 2.3中遇到了同样的问题,db迁移插件1.3.5在2.3.7中进行了测试,但仍然出现了这个错误。我从来都无法使用这个方法运行脚本。如果我进行了grails编译,那么grails MyScript使用这个方法工作。如果我使用run脚本,它会被一个MissingPropertyException includeTargets炸掉。我用2.3.7进行了测试,这项工作正在进行。嗨,我发现了同样的问题。你知道有没有人已经为此引起了错误?Cheers我相信这是对这个问题已有答案的重复。。。不确定我们应该如何处理这个问题,但我建议删除。很抱歉澄清——在我的情况下,我只需要执行上述步骤就可以解决问题。更好(更完整)的答案在
    grails run-script scripts/DoSomething
    
    grails do-something