Q:

MissingMethodException showing up on save action

I'm working an example from Grails in Action, specifically implementing a Service for the first time and shifting the work from the Controller to the Service.
I have a Post object containing a User and String content.
The service code is
class PostService {
  boolean transactional= true

  Post createPost(String user, String content){
    def thisUser = User.findByUserID(user)
      if (user){
        def post = new Post(content:content)
          if (user.save()){
            return post
        } else
            throw new PostException(message: "Invalid post", post:post)
      }

    throw new PostException(message:"Invalid User ID")
    }

}
and the controller code is 
def addPost = {
  try{
    def newPost = postService.createPost(params.id, params.content)
    flash.message= "Added new Post: $newPost.content}"

  } catch (PostException pe){
    flash.message = pe.message
  }
  redirect(action:'timeline', id:params.id)
}

The way this code is supposed to work is an input is made in the form, which is passed to addPost as a params object.  Said params object is then handed off to the Service, where a new Post is to be made and bound to the User.
However, I'm getting the error at user.save().  The specific error message is
No signature of method: java.lang.String.save() is applicable for argument 
types: () values: []
If I erase the service connector and implement the service code in the controller as
def user = User.findByUserID(params.id)

  if (user) {
    def post= new Post(params)
    user.addToPosts(post)

    if (user.save()){
      flash.message= "Sucessfully created Post"
} 

else {
      user.discard()
      flash.message = "Invalid or empty post"
    }

  } else {
    flash.message = "Invalid User ID"
  }
  redirect(action: 'timeline', id:params.id)
}

the action works.  So why am I getting a user.save() error on the service implementation, but not the controller?

A:

user is the String you're passing to the service method. thisUser is the actual User object you're getting that you can call save() on.

