gswg-v2 icon indicating copy to clipboard operation
gswg-v2 copied to clipboard

possible issue in chapter 7 of gwsg v2

Open bocode opened this issue 13 years ago • 5 comments

Hi Scott, I've reading the second issue and found an issue after invoking "grails generate-all User" command. I'm using grails 1.3.7 version on windows xp and java compiler is 1.6.0_10..

BTW i cut pasted the User's domain code and issued the generate-all command.

Here is the error:

C:\web\racetrack>grails generate-all User
Welcome to Grails 1.3.7 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: C:\grails-1.3.7

Base Directory: C:\web\racetrack
Resolving dependencies...
Dependencies resolved in 2391ms.
Running script C:\grails-1.3.7\scripts\GenerateAll.groovy
Environment set to development
  [groovyc] Compiling 2 source files to C:\web\racetrack\target\classes
  [groovyc] Compiling 1 source file to C:\web\racetrack\target\classes
Domain class not found in grails-app/domain, trying hibernate mapped classes...
  [groovyc] Compiling 1 source file to C:\web\racetrack\target\classes
  [groovyc] Compiling 1 source file to C:\web\racetrack\target\classes
No domain class found for name User. Please try again and enter a valid domain class nam
e
Application context shutting down...
Application context shutdown.

bocode avatar Mar 17 '11 09:03 bocode

Hi Bocode,

It sounds like you are running into a Java packaging issue. After Jason and I wrote the 2nd Edition, Grails started putting all of its artifacts into packages. In other words, your User.groovy class is probably in grails-app/domain/racetrack/User.groovy.

It would be nice if Grails "just knew" what you were talking about when you told it to "grails generate-all User", but instead you need to be a bit more specific: "grails generate-all racetrack.User".

HTH, s Scott Davis [email protected]

ThirstyHead: training done right http://thirstyhead.com

On Mar 17, 2011, at 3:42 AM, bocode wrote:

Hi Scott, I've reading the second issue and found an issue after invoking "grails generate-all User" command. I'm using grails 1.3.7 version on windows xp and java compiler is 1.6.0_10..

BTW i cut pasted the User's domain code and issued the generate-all command.

Here is the error:

C:\web\racetrack>grails generate-all User
Welcome to Grails 1.3.7 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: C:\grails-1.3.7

Base Directory: C:\web\racetrack
Resolving dependencies...
Dependencies resolved in 2391ms.
Running script C:\grails-1.3.7\scripts\GenerateAll.groovy
Environment set to development
 [groovyc] Compiling 2 source files to C:\web\racetrack\target\classes
 [groovyc] Compiling 1 source file to C:\web\racetrack\target\classes
Domain class not found in grails-app/domain, trying hibernate mapped classes...
 [groovyc] Compiling 1 source file to C:\web\racetrack\target\classes
 [groovyc] Compiling 1 source file to C:\web\racetrack\target\classes
No domain class found for name User. Please try again and enter a valid domain class nam
e
Application context shutting down...
Application context shutdown.

Reply to this email directly or view it on GitHub: https://github.com/scottdavis99/gswg-v2/issues/1

scottdavis99 avatar Mar 22 '11 18:03 scottdavis99

Hi Scott,

Thanks for the reply. Let me retry with your suggestion.

Thank you Bocode

On Wed, Mar 23, 2011 at 12:24 AM, scottdavis99 < [email protected]>wrote:

Hi Bocode,

It sounds like you are running into a Java packaging issue. After Jason and I wrote the 2nd Edition, Grails started putting all of its artifacts into packages. In other words, your User.groovy class is probably in grails-app/domain/racetrack/User.groovy.

It would be nice if Grails "just knew" what you were talking about when you told it to "grails generate-all User", but instead you need to be a bit more specific: "grails generate-all racetrack.User".

HTH, s Scott Davis [email protected]

ThirstyHead: training done right http://thirstyhead.com

On Mar 17, 2011, at 3:42 AM, bocode wrote:

Hi Scott, I've reading the second issue and found an issue after invoking "grails generate-all User" command. I'm using grails 1.3.7 version on windows xp and java compiler is 1.6.0_10..

BTW i cut pasted the User's domain code and issued the generate-all command.

Here is the error:

C:\web\racetrack>grails generate-all User
Welcome to Grails 1.3.7 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: C:\grails-1.3.7

Base Directory: C:\web\racetrack
Resolving dependencies...
Dependencies resolved in 2391ms.
Running script C:\grails-1.3.7\scripts\GenerateAll.groovy
Environment set to development
 [groovyc] Compiling 2 source files to C:\web\racetrack\target\classes
 [groovyc] Compiling 1 source file to C:\web\racetrack\target\classes
Domain class not found in grails-app/domain, trying hibernate mapped
classes...
 [groovyc] Compiling 1 source file to C:\web\racetrack\target\classes
 [groovyc] Compiling 1 source file to C:\web\racetrack\target\classes
No domain class found for name User. Please try again and enter a valid
domain class nam
e
Application context shutting down...
Application context shutdown.

Reply to this email directly or view it on GitHub: https://github.com/scottdavis99/gswg-v2/issues/1

Reply to this email directly or view it on GitHub: https://github.com/scottdavis99/gswg-v2/issues/1#comment_904315

bocode avatar Mar 23 '11 23:03 bocode

This solution worked for me. I was having the same issue. Thanks!

happycampo avatar May 17 '11 19:05 happycampo

I am still having this issue, even when adding the package name. Any oher solution ??

Euloiix avatar Aug 16 '11 11:08 Euloiix

My bad ... I was typing a wrong package name :)

Euloiix avatar Aug 16 '11 12:08 Euloiix