当前位置: 首页 > 知识库问答 >
问题:

Grails slf4j NoSuchMethodError

甄华清
2023-03-14

试图编译一个grails 1.3.7应用程序,并得到以下依赖项错误。有人帮忙吗?

> Error executing script RunApp:
> org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
> java.lang.NoSuchMethodError:
> org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
>   at
> org.apache.commons.logging.impl.SLF4JLocationAwareLog.debug(SLF4JLocationAwareLog.java:133)
>   at
> org.codehaus.groovy.grails.plugins.CorePluginFinder.loadCorePluginsFromResources(CorePluginFinder.java:93)
>   at
> org.codehaus.groovy.grails.plugins.CorePluginFinder.getPluginClasses(CorePluginFinder.java:54)
>   at
> org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager.findCorePlugins(DefaultGrailsPluginManager.java:363)
>   at
> org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager.attemptLoadPlugins(DefaultGrailsPluginManager.java:326)
>   at
> org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager.loadPlugins(DefaultGrailsPluginManager.java:282)
>   at
> org.codehaus.groovy.grails.plugins.GrailsPluginManager$loadPlugins.call(Unknown
> Source)   at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
>   at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
>   at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
 runtime("org.grails:grails-datastore-gorm:$datastoreVersion","org.grails:grails-         datastore-core:$datastoreVersion") {
    excludes "jcl-over-slf4j", "slf4j-api"
 }
 excludes 'ehcache', 'xml-apis', 'commons-logging', 'slf4j-api'

我尝试将此添加到BuildConfig.groovy中,但没有成功:

插件{

    compile(":lesscss:1.0.0"){
           excludes "jcl-over-slf4j", "slf4j-api"
    }
    compile(":neo4j:1.0.0.M2"){
           excludes 'ehcache', 'xml-apis', 'commons-logging', 'slf4j-api'
    }

共有1个答案

许博
2023-03-14

此线程可能与您的问题有关:http://grails.1312388.n4.nabble.com/locationawarelogger-log-no-such-method-error-td3254387.html

我也遇到了同样的问题,最后我删除了错误的传递依赖关系,正如上面的链接所建议的那样。我还必须强制删除一个slf4j jar文件,该文件在导致部署阶段发生相同错误的war中以某种方式泄漏。

 类似资料:

相关问答

相关文章

相关阅读