我刚刚继承了一个现有的应用程序,我注意到的第一件事是,我必须在每个"grails run app"之前进行"grails clean",否则就会出现错误。创建该项目的人员表示,他们还有其他几个具有类似设置的项目没有出现此错误,并且无法跟踪该特定项目的此问题。
详细信息:
从命令行,我第一次运行它时,得到的输出是:
grails运行应用
编译192个源文件
并且它继续运行良好。如果我控制C并运行完全相同的命令(没有更改,什么都没有),我会得到:
|编译4个源文件。|错误编译错误:启动失败:类生成过程中的一般错误:对象不是的实例声明类
java.lang.IollegalArgumentException:对象不是的实例在声明类位于的sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在java.lang.reflect.Method.ioke(Method.java:606)com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)在org.codehaus.groovy.vmplugin.v5.Java5.configureAnnotation(Java5.java:242)在org.codehaus.groovy.vmplugin.v5.Java5.setAnnotationMetaData(Java5.java:179)在org.codehaus.groovy.vmplugin.v5.Java5.configureClassNode(Java5.java:325)在org.codehaus.groovy.ast.ClassNode.lazClassInit(ClassNode.java:262)在org.codehaus.groovy.ast.ClassNode.getInterfaces(ClassNode.java:356)在org.codehaus.groovy.ast.ClassNode.declaresInterface(ClassNode.java:946)在org.codehaus.groovy.ast.ClassNode.eimplementsInterface(ClassNode.java:926)在org.codehaus.groovy.ast.ClassNode.isDerivedFromGroovyObject(ClassNode.java:916)在org.codehaus.groovy.classgen.AsmClassGenerator.isGroovyObject(AsmClassGenerator.java:1090)在org.codehaus.groovy.classgen.AsmClassGenerator.visitPropertyExpression(AsmClassGenerator.java:1047)在org.codehaus.groovy.ast.expr.PropertyExpression.visit(PropertyExpression.java:55)在org.codehaus.groovy.classgen.AsmClassGenerator.visitGStringExpression(AsmClassGenerator.java:1855)在org.codehaus.groovy.ast.expr.GStringExpression.visit(GStringExpression.java:50)在org.codehaus.groovy.classgen.AsmClassGenerator.visitMapExpression(AsmClassGenerator.java:1444)在org.codehaus.groovy.ast.expr.MapExpression.visit(MapExpression.java:53)在org.codehaus.groovy.classgen.AsmClassGenerator.visitMapExpression(AsmClassGenerator.java:1444)在org.codehaus.groovy.ast.expr.MapExpression.visit(MapExpression.java:53)在org.codehaus.groovy.classgen.asm.CallSiteWriter.makeCallSite(CallSiteWriter.java:301)在org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:187)在org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:89)在org.codehaus.groovy.classgen.asm.InvocationWriter.makeInvokeMethodCall(InvocationWriter.java:73)在org.codehaus.groovy.classgen.asm.InvocationWriter.writeInvokeMethod(InvocationWriter.java:292)在org.codehaus.groovy.classgen.AsmClassGenerator.visitMethodCallExpression(AsmClassGenerator.java:655)在org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:75)在org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.evaluatteEqual(BinaryExpressionHelper.java:296)在org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.eval(BinaryExpressionHelper.java:79)在org.codehaus.groovy.classgen.AsmClassGenerator.visitBinaryExpression(AsmClassGenerator.java:519)在org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:49)在org.codehaus.groovy.classgen.asm.StatementWriter.writeExpressionStatement(StatementWriter.java:599)在org.codehaus.groovy.classgen.asm.OptizingStatementWriter.writeExpressionStatement(OptimizingStatementWriter.java:346)在org.codehaus.groovy.classgen.AsmClassGenerator.visitExpressionStatement(AsmClassGenerator.java:501)在org.codehaus.groovy.ast.stmt.ExpressionStatement.visite(ExpressionStatements.java:40)在org.codehaus.groovy.classgen.asm.StatementWriter.writeBlockStatement(StatementWriter.java:80)在org.codehaus.groovy.classgen.asm.OptizingStatementWriter.writeBlockStatement(OptimizingStatementWriter.java:155)在org.codehaus.groovy.classgen.AsmClassGenerator.visitBlockStatement(AsmClassGenerator.java:447)在org.codehaus.groovy.ast.stmt.BlockStatement.visite(BlockStatement.java:69)在org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:101)在org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:112)在org.codehaus.groovy.classgen.AsmClassGenerator.visitStdMethod(AsmClassGenerator.java:311)在org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(AsmClassGenerator.java:268)在org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:123)在org.codehaus.groovy.classgen.AsmClassGenerator.visitMethod(AsmClassGenerator.java:388)在org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1056)在org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:50)在org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:172)在org.codehaus.groovy.control.CompilationUnit$14.call(CompilationUnit.java:770)在org.codehaus.groovy.control.CompilationUnit$14.call(CompilationUnit.java:787)在org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:970)在org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:548)在org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:526)在org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:503)在org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:482)在org.codehaus.groovy.tools.FileSystemCompiler.compile(文件系统编译器.java:60)在org.codehaus.groovy.tools.FileSystemCompiler.doCompilation(文件系统编译器.java:216)网址:org.codehaus.groovy.ant.Groovyc.compile(Groovyc.java:935)org.codehaus.groovy.grails.compiler.Grailsc.compile(Grailsc.java:79)网址:org.codehaus.groovy.ant.Groovyc.execute(Groovyc.java:629)org.apache.tools.ant.UnnknownElement.execute(UnknownElement.java:291)位于sun.reflect.GeneratedMethodAccessor148.reinvoke(未知源)sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在java.lang.reflect.Method.ioke(Method.java:606)com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)在org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)在groovy.util.AntBuilder.performTask(AntBuilder.java:260)groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:220)groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:147)groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:170)groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)org.codehaus.gant.GantBuilder.invokeMethod(GantBuildr.java:99)org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)在org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)在org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)在org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)在org.codehaus.groovy.grails.compiler.GrailsProjectCompiler.compile(GrailsProjectCompiler.groovy:263)在org.codehaus.groovy.grails.compiler.GrailsProjectCompiler$compiler$0.callCurrent(未知来源)org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)在org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)在org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)在org.codehaus.groovy.grails.compiler.GrailsProjectCompiler.compile(GrailsProjectCompiler.groovy:234)在org.codehaus.groovy.grails.compiler.GrailsProjectCompiler$compile.call(未知来源)org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)在org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)在org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)在_GrailsCompile_groovy$_run_closure2_closure6_closure7.doCall(_GrailsCompile_groovy:48)位于的sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在java.lang.reflect.Method.ioke(Method.java:606)com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)在org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.ioke(PogoMetaMethodSite.java:231)在org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)在org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)在org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)在org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)在_GrailsCompile_groovy$_run_closure2_closure6_closure7.doCall(_GrailsCompile_groovy)位于的sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在java.lang.reflect.Method.ioke(Method.java:606)com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)在org.codehaus.groovy.reflection.CachedMethod.ioke(CachedMethod.java:90)在groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1071)groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)groovy.lang.Closure.call(Closure.java:415)groovy.lang.Closure.call(Closure.java:409)位于的java_util_concurrent_Callable$call.call(未知源)org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)位于的java_util_concurrent_Callable$call.call(未知源)_GrailsCompile_groovy.withCompilationErrorHandling(_GrailsCompile_groovy:69)在_GrailsCompile_groovy.this$4$with CompilationErrorHandling(_GrailsCompile_groovy)位于的sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在java.lang.reflect.Method.ioke(Method.java:606)com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)在org.codehaus.groovy.reflection.CachedMethod.ioke(CachedMethod.java:90)在groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1071)groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:149)在org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)在org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:168)在groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:44)在groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1136)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1030)在groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)在org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)在org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)在org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)在_GrailsCompile_groovy$_run_closure2_closure6.doCall(_GrailsCompile_groovy:47)位于的sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在java.lang.reflect.Method.ioke(Method.java:606)com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)在org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.ioke(PogoMetaMethodSite.java:231)在org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)在org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)在org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)在org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)在_GrailsCompile_groovy$_run_closure2_closure6.doCall(_GrailsCompile_groovy)位于的sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在java.lang.reflect.Method.ioke(Method.java:606)com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)在org.codehaus.groovy.reflection.CachedMethod.ioke(CachedMethod.java:90)在groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1071)groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)groovy.lang.Closure.call(Closure.java:415)groovy.lang.Closure.call(Closure.java:409)org.codehaus.groovy.grails.cli.api.BaseSettingsPi.profile(BaseSettingsPi.java:287)位于的sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在java.lang.reflect.Method.ioke(Method.java:606)com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)在org.codehaus.groovy.reflection.CachedMethod.ioke(CachedMethod.java:90)在groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1071)groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:938)groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1117)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1073)在groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:721)groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:44)在groovy.lang.Script.invokeMethod(Script.java:78)groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1136)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1030)在groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:149)在org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)在org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)在org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)在org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)在org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)在_位于sun.reflect.NativeMethodAccessorImpl.invoke0(Native方法)的GrailsCompile_groovy$_run_closure2.doCall(_GrailsCompile_groovy:46)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在java.lang.reflect.Method.ioke(Method.java:606)com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)在org.codehaus.groovy.reflection.CachedMethod.ioke(CachedMethod.java:90)在groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1071)groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:149)在org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)在groovy.lang.Closure.call(Closure.java:415)groovy.lang.Closure.call(Closure.java:428)sun.reflect.GeneratedMethodAccessor106.invoke(未知源)位于sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在java.lang.reflect.Method.ioke(Method.java:606)com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)在org.codehaus.groovy.reflection.CachedMethod.ioke(CachedMethod.java:90)在groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1071)groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:149)在org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)在org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)在org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)在org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54)在org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)在org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)位于的sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在java.lang.reflect.Method.ioke(Method.java:606)com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)在org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.ioke(PogoMetaMethodSite.java:231)在org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)在org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)在org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)位于的sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在java.lang.reflect.Method.ioke(Method.java:606)com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)在org.codehaus.groovy.reflection.CachedMethod.ioke(CachedMethod.java:90)在groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1071)groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)groovy.lang.Closure.call(Closure.java:415)groovy.lang.Closure.call(Closure.java:409)位于的java_util_concurrent_Callable$call.call(未知源)org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)在org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)位于的sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在java.lang.reflect.Method.ioke(Method.java:606)com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)在org.codehaus.groovy.reflection.CachedMethod.ioke(CachedMethod.java:90)在groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1071)groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:721)groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:44)在groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1136)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1030)在groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)在org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)在org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)位于的sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在java.lang.reflect.Method.ioke(Method.java:606)com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)在org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.ioke(PogoMetaMethodSite.java:231)在org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)在org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)在org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)位于的sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在java.lang.reflect.Method.ioke(Method.java:606)com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)在org.codehaus.groovy.reflection.CachedMethod.ioke(CachedMethod.java:90)在groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1071)groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)groovy.lang.Closure.call(Closure.java:415)groovy.lang.Closure.call(Closure.java:409)位于的sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在java.lang.reflect.Method.ioke(Method.java:606)com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)在org.codehaus.groovy.reflection.CachedMethod.ioke(CachedMethod.java:90)在groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1071)groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1117)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1073)在groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:721)groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:44)在groovy.lang.Script.invokeMethod(Script.java:78)groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1136)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1030)在groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:149)在org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)在org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:168)在groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:44)在groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1136)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1030)在groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)在org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)在org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)在org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:137)在_GrailsPackage_groovy$_run_closure2_closure9.doCall(_GrailsPackage_groovy:45)位于的sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在java.lang.reflect.Method.ioke(Method.java:606)com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)在org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.ioke(PogoMetaMethodSite.java:231)在org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)在org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)在
奇怪的是,在IntelliJ中,如果我在(命令行)grails清理后从菜单上运行应用程序,我会收到相同的"正在编译192个源文件"消息,并且它有效,第二次收到"正在编译4个源文件",它仍然有效。
我在谷歌上搜索了一下,但没有用。我甚至不知道如何开始解决这个问题。有人能为我指出解决这一问题的途径吗?我看什么?显然,当发生相同的编译时,它如何在IDE中而不是在命令行中工作?这个错误是什么意思?
我会尝试在不重新加载的情况下运行(我认为是grails -noreloading run-app
)-这能解决问题吗?
如果是这样,我们可以更深入地挖掘:可能只是slcache填充错误,如果使用最新的JDK并加载了旧的spring,就会发生这种情况。在重新启动之间(仅使用常规grails run-app
)删除.slcache-rm -rf ~/grails/2.1.3/.slcache
,而不是grails clean。这有什么不同吗?
然后,我会从中央的这里获取一个更新的弹簧加载(例如1.2.0.RELEASE.jar:http://search.maven.org/remotecontent?filepath=org/springframework/springloaded/1.2.0.RELEASE/springloaded-1.2.0.RELEASE.jar
在grails 2.1.3安装中找到弹簧加载的罐子。重命名它(以备份它)。然后将1.2.0 jar复制到该文件夹中,并重命名它以匹配原始的弹簧加载jar。我在这里找到了我的:
grails-2.1.3/lib/org.springsource.springloaded/springloaded-core/jars/springloaded-core-1.1.1.jar
所以我会将springloaded-1.2.0.RELEASE.jar
复制到那个文件夹中,并将其重命名为springloaded-core-1.1.1.jar
再来一个grails clean
,然后再次尝试运行应用程序。有更好的吗?
这绝对是个棘手的问题。在开发过程中,偶尔可能需要进行一次清洁是很自然的。
然而,你所描述的听起来是不断重复的,你一定要找到原因。以下是我将如何解决这个问题的策略。我想你的一切都在版本控制之下。
- 创建一个具有相同名称、相同grails版本的全新项目
- 从项目中删除所有文件,并将文件从(1)复制到项目中。现在你有了一个干净的项目和巨大的差异
- 首先恢复(完整或逐行)你的BuildConfig.groovy。原因肯定在这里
- 接下来,我将恢复Config.groovy/Datasource.groovy/Bootstrap
- 现在,如果您仍然无法隔离原因,那一定是您的代码。继续回复,直到你最终找到原因。一旦有了可用的类,就恢复resources.groovy