복붙노트

[SPRING] Grails 2.3 데이터베이스 마이그레이션에서 "Plugin manager loading Error : TomcatGrailsPlugin"

SPRING

Grails 2.3 데이터베이스 마이그레이션에서 "Plugin manager loading Error : TomcatGrailsPlugin"

Grails 2.3과 Grails 데이터베이스 마이그레이션 플러그인 (1.3.6)을 사용합니다.

grails dbm-update를 할 때 다음 오류가 발생합니다. 이 오류를 어떻게 해결할 수 있습니까?

 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

해결법

  1. ==============================

    1.이것은 매우 짜증나는 버그입니다. 내 응용 프로그램은 실행 스크립트로 스크립트를 실행하는 것에 달려 있으며 동일한 동작을합니다. 해결 방법은 다음과 같습니다.

    이것은 매우 짜증나는 버그입니다. 내 응용 프로그램은 실행 스크립트로 스크립트를 실행하는 것에 달려 있으며 동일한 동작을합니다. 해결 방법은 다음과 같습니다.

    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. ==============================

    2.buildConfig.groovy에서 tomcat 빌드 유형을 변경하여 build 대신 컴파일하십시오.

    buildConfig.groovy에서 tomcat 빌드 유형을 변경하여 build 대신 컴파일하십시오.

    컴파일 ': 바람둥이 : 7.0.42'

  3. ==============================

    3.따라서 스크립트가 2.3.x에 의해 손상 되었기 때문에 여기를 발견하면 일반적으로 문제에 대해 발견 한 바가 있습니다. 난 항상 실행 스크립트를 사용할 수 없다. 왜냐하면 항상 무서운 TomcatPlugin에 문제가 생기지 않기 때문이다. (이것은 실행 스크립트가 항상 grails를 부트 스트랩하려고한다는 것을 의미한다.) 그러나 스크립트를 작업으로 컴파일하고 실행할 수 있습니다. 다음 방법을 사용하여 grails를 부트 스트랩했기 때문에 스크립트가 항상 실패합니다.

    따라서 스크립트가 2.3.x에 의해 손상 되었기 때문에 여기를 발견하면 일반적으로 문제에 대해 발견 한 바가 있습니다. 난 항상 실행 스크립트를 사용할 수 없다. 왜냐하면 항상 무서운 TomcatPlugin에 문제가 생기지 않기 때문이다. (이것은 실행 스크립트가 항상 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
    }
    

    그것의 모든 것은 그것을 말하는 다큐먼트에서 온 것입니다. 그러나 2.3.x에서는 depends (bootstrap)가 잘못 처리되어 전체 포크 기능이 망가졌습니다 (예 : 잘 생각하지 못했습니다).

    나는 운이 좋았고 스크립트는 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(parseArguments)  // this is not problem
    }
    

    그리고 비올라는 다시 일하기 시작했습니다. 잘 작동합니다. 다음은 작품 대 작동하지 않는 것입니다 :

    $ grails GenerateSecretKey              // yay works
    $ grails run-script GenerateSecretKey   // doesn't work
    

    다음은이 문제에 대한 몇 가지 Jira 문제입니다.이 모든 것이 잘못되었을 때를 알 수 있습니다 ;-)

  4. ==============================

    4.나는 Grails 2.3.4를 사용하고 있지만,이 문제를 어떻게 해결 했는가?

    나는 Grails 2.3.4를 사용하고 있지만,이 문제를 어떻게 해결 했는가?

    데이터베이스 이주 스크립트를 재 시도했고. 제점이 해결되었습니다.

  5. ==============================

    5.2.3.2로 업그레이드 할 때도 동일한 문제가 발생했습니다.

    2.3.2로 업그레이드 할 때도 동일한 문제가 발생했습니다.

    나는 국기 -DnoTomcat으로 위의 것을 시도했다.

    여전히 작동하지 않았습니다. 그런 다음 바람둥이를 참조하는 일부 플러그인을 사용하는 것을 깨달았습니다. grails 2.3.2로 새로 생성 된 플러그인에는 바람둥이에 대한 언급이 없기 때문에 이것은 어떤면에서 유산으로 보입니다. 그래서 플러그인에서 모든 참조를 제거하고 주요 응용 프로그램에서 플래그 스위치를 유지했습니다.

  6. ==============================

    6.위의 chubbsondubs에서 언급 한 약간의 설명이 있지만, 처음 읽었을 때 놓친 ...

    위의 chubbsondubs에서 언급 한 약간의 설명이 있지만, 처음 읽었을 때 놓친 ...

    보통 이것에 대한 간단한 해답은 다음과 같이하는 것이 아닙니다.

    grails run-script scripts/DoSomething
    

    그냥 이렇게해라.

    grails do-something
    
  7. from https://stackoverflow.com/questions/18817539/error-loading-plugin-manager-tomcatgrailsplugin-on-grails-2-3-database-migrat by cc-by-sa and MIT license