我已经导入了一个 Grails 项目,并试图“将其转换为 grails”。当我这样做时,我在 apache commons 日志记录包上得到一个 NoClassDefFound。我在哪里添加这个 jar?这是在 IDE 的类路径、Grails 类路径还是应用程序的类路径中?它似乎没有在 grails-2.2.4/lib 中。这是我期望的第一个地方。这似乎使用了 Ivy,所以它应该作为依赖项出现吗?下面是我看到的错误:
Loading Grails 2.2.4
| Error java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
| Error at org.codehaus.groovy.grails.io.support.PathMatchingResourcePatternResolver.<clinit>(PathMatchingResourcePatternResolver.java:136)
| Error at org.codehaus.groovy.grails.cli.GrailsScriptRunner.getAvailableScripts(GrailsScriptRunner.java:813)
| Error at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeScriptWithCaching(GrailsScriptRunner.java:423)
| Error at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeScriptWithCaching(GrailsScriptRunner.java:417)
| Error at org.grails.ide.api.impl.GrailsConnectorImpl.executeCommand(GrailsConnectorImpl.java:160)
| Error at org.grails.ide.eclipse.longrunning.process.GrailsProcess.run(GrailsProcess.java:130)
| Error at org.grails.ide.eclipse.longrunning.process.GrailsProcess.main(GrailsProcess.java:93)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error at java.lang.reflect.Method.invoke(Method.java:483)
| Error at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:234)
| Error at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:262)
| Error Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
| Error at org.codehaus.groovy.tools.RootLoader.findClass(RootLoader.java:175)
| Error at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
| Error at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:147)
| Error at org.codehaus.groovy.grails.cli.support.GrailsRootLoader.loadClass(GrailsRootLoader.java:52)
| Error at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
| Error ... 13 more