Grails generate-all: erro [Resolvido]

3 respostas
tnaires

Boa noite.
Estou estudando Grails por este livro. Na página 32 do capítulo 3 o texto sugere a utilização do comando grails generate-all para gerar o código-fonte das classes de controle. Porém, quando eu utilizo o comando, aparece o seguinte erro:

Welcome to Grails 1.0 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: C:\Java\grails-1.0

Base Directory: D:\Tarso\Projetos\Java\Grails\racetrack
Environment set to development
Note: No plugin scripts found
Running script C:\Java\grails-1.0\scripts\GenerateAll.groovy
Error executing script GenerateAll: startup failed, GenerateAll_groovy: 53: you
tried to assign a value to the class ‘resources’. Do you have a script with this
name?
@ line 53, column 4.
1 error

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed,
GenerateAll_groovy: 53: you tried to assign a value to the class ‘resources’. Do
you have a script with this name?
@ line 53, column 4.
1 error

at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollecto
r.java:296)

at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(Compil

ationUnit.java:787)

at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.j

ava:438)

at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.j

ava:417)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:

86)

at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)

at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)

at org.codehaus.groovy.runtime.InvokerHelper.invokePojoMethod(InvokerHel

per.java:765)

at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.

java:753)

at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(Scrip

tBytecodeAdapter.java:167)

at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0(Scrip

tBytecodeAdapter.java:195)

at gant.Gant.compileScript(Gant.groovy:447)

at gant.Gant.this$2$compileScript(Gant.groovy)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:

86)

at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)

at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:867)

at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)

at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurre

ntN(ScriptBytecodeAdapter.java:77)

at gant.Gant$_processTargets_closure13.doCall(Gant.groovy:415)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:

86)

at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)

at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)

at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurre

ntN(ScriptBytecodeAdapter.java:77)

at gant.Gant$_processTargets_closure13.call(Gant.groovy)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:

86)

at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)

at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)

at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHel

per.java:777)

at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.

java:757)

at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(Scrip

tBytecodeAdapter.java:167)

at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeClosure(Scrip

tBytecodeAdapter.java:598)

at gant.Gant.processTargets(Gant.groovy:420)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:

86)

at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)

at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)

at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurre

ntN(ScriptBytecodeAdapter.java:77)

at gant.Gant.processArgs(Gant.groovy:372)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:

86)

at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)

at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)

at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHel

per.java:777)

at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.

java:757)

at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(Scrip

tBytecodeAdapter.java:167)

at org.codehaus.groovy.grails.cli.GrailsScriptRunner.callPluginOrGrailsS

cript(GrailsScriptRunner.groovy:204)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:

86)

at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)

at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1094)
at groovy.lang.ExpandoMetaClass.invokeStaticMethod(ExpandoMetaClass.java
:957)

at org.codehaus.groovy.runtime.InvokerHelper.invokeStaticMethod(InvokerH

elper.java:800)

at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeStaticMethodN

(ScriptBytecodeAdapter.java:212)

at org.codehaus.groovy.grails.cli.GrailsScriptRunner.main(GrailsScriptRu

nner.groovy:124)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(Grail

sStarter.java:140)

at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStart

er.java:169)</blockquote>

Alguém sabe o que aconteceu?

Abraços

3 Respostas

Mauricio_Linhares

Bug no script da versão 1.0 do Grails (não é uma boa maneira de se começar né…)

Vá no arquivo C:\Java\grails-1.0\scripts\GenerateAll.groovy , procure pela linha 53 onde tem “resources” e coloque um “this.” antes de resources.

tnaires

:lol:
Obrigado, deu certo.
Sabe onde eu poderia reportar esse bug, caso alguém não o tenha feito?
Abraços

jack_ganzha

tnaires:
Sabe onde eu poderia reportar esse bug, caso alguém não o tenha feito?
Abraços

Já foi corrigido na versão 1.0.1.

valeuz…

Criado 21 de fevereiro de 2008
Ultima resposta 21 de fev. de 2008
Respostas 3
Participantes 3