Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8582441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:17:36+00:00 2026-06-11T21:17:36+00:00

I get the following error when I try to save a domain class, in

  • 0

I get the following error when I try to save a domain class, in grails:

No signature of method: java.lang.String.save() is applicable for argument types: () values: []
Possible solutions: size(), size(), take(int), wait(), any(), wait(long). Stacktrace follows:

I have a service that pareses an XML string into domain objects. I then try to save the domain and get that error. I’ve debugged and know that all the data is valid. Here is my code:

   def newProfile="";

      newProfile = new LinkedinProfile(
        firstName               :   "${linkedinProfileFeed.'first-name'}",
        lastName                :   "${linkedinProfileFeed.'last-name'}",
        dobYear                 :   "${linkedinProfileFeed.'date-of-birth'.'year'}",
        dobMonth                :   "${linkedinProfileFeed.'date-of-birth'.'month'}",
        dobDay                  :   "${linkedinProfileFeed.'date-of-birth'.'day'}"  ,   
        imgUrl                  :   "${linkedinProfileFeed.'picture-url'}", 
        siteStandardAddress     :   "${linkedinProfileFeed.'site-standard-profile-request'}",           
        oAuthToken              :   accessTokenKey.toString(),
        secretKey               :   accessTokenSecret.toString()
       )
      .id="${linkedinProfileFeed.id}".toString()

      log.debug("${linkedinProfileFeed.id}".toString())
      log.debug("${linkedinProfileFeed.'first-name'}")
      log.debug("${linkedinProfileFeed.'last-name'}")
      log.debug("${linkedinProfileFeed.'date-of-birth'.'year'}")
      log.debug("${linkedinProfileFeed.'date-of-birth'.'month'}")
      log.debug("${linkedinProfileFeed.'date-of-birth'.'day'}")
      log.debug("${linkedinProfileFeed.'picture-url'}")
      log.debug("${linkedinProfileFeed.'site-standard-profile-request'}")
      log.debug(accessTokenKey.toString())
      log.debug(accessTokenSecret.toString())
      log.debug("end debug")





      newProfile.save();

Also, I’m not to familiar with grails and springsource, but in .Net, I can access an objects properties using the dot operator. For example, if I had an object as described above, I could just type newProfile. and would have access to all the properties. In grails this doesnt happen. is this by design or an error in my code?

below is my domain class, as well.

   class LinkedinProfile {
String firstName
String lastName
String dobYear
String dobMonth
String dobDay
String oAuthToken
String secretKey
String id
String imgUrl
String siteStandardAddress
Date dateCreated
Date lastUpdated
long version

static hasMany = [
    linkedinLocation        : LinkedinLocation,
    linkedinSkill           : LinkedinSkill
]

static mapping = {
    cache true
    id generator: 'assigned'

    columns {
        firstName           type:'text'
        lastName            type:'text'         
        oAuthToken          type:'text'
        secretKey           type:'text'         
        dobYear             type:'text'
        dobMonth            type:'text'
        dobDay              type:'text'
        imgUrl              type:'text'
        siteStandardAddress type:'text'
    }


}
static constraints = {
    firstName           (nullable:true)
    lastName            (nullable:true)     
    oAuthToken          (nullable:false)
    secretKey           (nullable:false)
    dobYear             (nullable:true)
    dobMonth            (nullable:true)
    dobDay              (nullable:true)     
    id                  (nullable:false)
    imgUrl              (nullable:true)
    siteStandardAddress (nullable:true)
}


def beforeInsert = {
//to do:  before insert, capture current email that is stored in the db
}

def afterInsert={
    //resave email
}

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:17:38+00:00Added an answer on June 11, 2026 at 9:17 pm

    The error indicates you are calling save() on a String. If we investigate, we see that you are. This is because you are assigning

     newProfile = new LinkedinProfile().id="${linkedinProfileFeed.id}".toString()
    

    and so newProfile is actually the String linkedinProfileFeed.id, not a new LinkedinProfile() as one might expect.

    Compare

    groovy> def foo = new Post().id="1" 
    groovy> foo.class 
    
    Result: class java.lang.String
    

    with

    groovy> def foo = new Post(id: "1") 
    groovy> foo.class 
    
    Result: class test.Post
    

    You probably want to put the id into the constructor arguments. Regardless, you need newProfile to end up as a LinkedinProfile instance. Then you can call save() on it.

    Also yes, you can use the dot operator in Groovy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get following error message, when I try to run git rebase -i for
I get the following error when I try and execute the code down below.
I get the following error when I try to run sample example of Google
I get the following error message when I try the following: Dim XL As
I get the following error on my Cloud Foundry installation when I try to
I get the following error in the UDK Frontend when I try to make
When I try to I get the following error in SQL Server Management Studio:
When I try to start an IntentService over adb i get tho following error
When I try to compile this project I get the following error. I would
When I try to run a routine I get the following error: Error Code:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.