0

The code listed here works, but STS shows an annoying error: Groovy: unable to resolve class Comentario:

printscreen with the error

This is a extract of the Service code with the line of the error (new Comentario(params).save())":

package alojamiento

import org.springframework.transaction.annotation.Transactional

class ComentarioJQGridService {

    static transactional = true

    @Transactional
    def cambiarComentario(params) { 

        Comentario.withTransaction { status ->
            new Comentario(params).save()
        }

    }
}

This is an extract of the domain class:

package alojamiento

class Comentario implements Serializable {
    Integer id
    String comentario
    ...

It looks similar to the official Grails documentation, so I think it is a STS issue. Why is it? How could I remove this error?

tim_yates
  • 167,322
  • 27
  • 342
  • 338
chelder
  • 3,819
  • 6
  • 56
  • 90
  • `grails-app/domain` is not present in the project's source path, try adding that. – dmahapatro Jun 04 '13 at 02:34
  • I think it is in the Build Path: https://dl.dropboxusercontent.com/u/3653993/domain%20src%20in%20java%20build%20path.png – chelder Jun 04 '13 at 12:19
  • 1
    Saw the snapshot. It only includes `*.java`. Either `include all` or add `*.groovy` in `included`. BTW you need not include `*.java`. – dmahapatro Jun 05 '13 at 01:36
  • It works perfectly! Thanks. Specifically I did: right click to the project - properties - Java BuildPath. Look for: ProjectName/grails-app/domain - Included, then Edit, Add - **/*.groovy. – chelder Jun 05 '13 at 02:15

0 Answers0