• Grails 1.1 does not allow the classname Category

    Posted on April 18th, 2009 Nattl 6 comments

    There are tutorials around for older versions of Grails that use Category as a class name. However since v 1.1 this name collides with the Groovy-class groovy.lang.Category. If you use it you get the error  “ERROR plugins.DefaultGrailsPlugin  – Cannot generate controller logic for scaffolded class interface groovy.lang.Category. It is not a domain class!” It took me two hours to find out about that. Even googling was not very successful. As you can imagine it drove me mad. So don’t use Category, even if you want to create a category class! Use something else…

     

    6 responses to “Grails 1.1 does not allow the classname Category” RSS icon

    • Thanks God man i found ur post. I was about to get crazy. I would have another question if u could help me out. As i read everywhere create-domain-class command should create an integration test also. But in grails v1.1 it creates only a unit test, even though it’s documentation says the opposite. Do u know anything about it? thanks. aleks

      • AFAIK Grails does not automatically create a integration test. The difference between unit and integration-tests is the fact that unit-tests are for one class only (ie. unit) while the integration-tests are for several classes and their interaction. So you have to put together the integration-testcases on yourself. BTW, don’t rely to much on the grails-documentation as it is faulty and incomplete ;)

    • Thanks. I was thinking the same way. I just needed smb to confirm that. There are really few people out there who use this framework. But as an idea i found it just perfect for an application i want to build. Plus it is always a new thing to study. The documentation is really faulty.
      Bye bye.

    • I’m also getting this error even though my domain class is not Category

      “plugins.DefaultGrailsPlugin – Cannot generate controller logic for scaffolded class app.User It is not a domain class!”

    • I never understand until the end of what the heck is written here, because I do not know English so well. You possibly can write it more appears?

    • Здравствуйте. Пожалуйста не удаляйте это сообщение. Алене нужна операция. Сайт – helpalena.ru (helpalena.ru ). Кто может, помогите.


    Leave a reply