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

  • SEARCH
  • Home
  • 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 8726099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:11:02+00:00 2026-06-13T08:11:02+00:00

Having issues with BootStrap.groovy loading development data. Prior it had always loaded data, but

  • 0

Having issues with BootStrap.groovy loading development data. Prior it had always loaded data, but now has stopped throwing the below error when running grails run-app.

Message: Validation Error(s) occurred during save():
- Field error in object 'spotlight.content.Profile' on field 'portfolio': rejected value  [null];

My 2 models are as follows;

class Portfolio {
   Profile profile

String portfolioName
String portdescrip
Integer portpublished
Date dateCreated
Date lastUpdated

AND

class Profile {
   static belongsTo = [portfolio: Portfolio]

String portfoliohtml
String portfolioEmail
String portfoliocc
String portfolioAdmin
String portfolioFilestore
String portfolioColor
String bugzillaproduct
String bugzillacomponent
String rtqueue
String teamqueueemail
String etherpadurl
Integer siteupload
Date dateCreated
Date lastUpdated

Within the BootStrap.groovy file I have the following;

import java.util.Date;
import spotlight.content.Profile
import spotlight.content.Portfolio

class BootStrap { 

def init = { servletContext ->

    def profile = new Profile(portfoliohtml:"No",
            portfolioEmail: "ian@ian.com",
            portfolioAdmin:"Ian Neilsen",
            bugzillaproduct:"bz prod name",
            bugzillacomponent:"comp name",
            siteupload:1,
            portfoliocc: "ian@ian.com",
            portfolioColor:"red",
            portfolioFilestore:"blah",
            rtqueue:"queue name",
            teamqueueemail:"ian@ian.com",
            etherpadurl:"http://url.com",
            ).save(failOnError: true)

    def portfolio = new Portfolio(portfolioName:"Portfolio 1",
                            portdescrip:"portfolio descrition field",
                            portpublished:1,
                            portfolio:profile).save(failOnError: true)

}

I have tried every incarnation of adding my profile object to the portfolio object without any luck. As I said previously this worked and has now stopped throwing the null error.

has got me stumped any ideas?

cheers

  • 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-13T08:11:03+00:00Added an answer on June 13, 2026 at 8:11 am

    It looks like you have several mistakes.
    One (but not causing the error message) is, that you try to add your profile instance to portfolio property of your portfolia instance. Portfolio has no property portfolio.

    Regarding your errormessage, try following:

    def portfolio = new Portfolio(portfolioName:"Portfolio 1", ...)
    portfolio.profile = new Profile(...)
    portfolio.save(failOnError: true)
    

    For further reading, look at the Many-to-one and one-to-one (GORM) section of the grails docs.

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

Sidebar

Related Questions

I'm using bootstrap-sass to integrate Twitter Bootstrap in Rails but I'm having issues with
Having issues with Twitter Bootstrap responsive navigation. The best way to explain this is
I am using bootstrap on my site and am having issues with the navbar
I'm trying to implement autoloading in Php5.3 using namespaces but I'm having some issues
I'm using django-crispy-forms with Twitter Bootstrap , and I'm having some issues with customizing
New to Bootstrap and having some issues with accordion. Hoping someone would help me
I'm having a few issues with trying to customize Twitter Bootstrap for my rails
I am new to Bootstrap and am having a few issues getting modal dialogs
I'm having an issue while developing a basic Rails application. I've implemented Twitter Bootstrap
I'm having a design/css issue. I'm using Twitter Bootstrap and have a .row-fluid, with

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.