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 6254425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:10:37+00:00 2026-05-24T14:10:37+00:00

We’re using Eclipse STS for a simple Grails project. We started with something simple

  • 0

We’re using Eclipse STS for a simple Grails project. We started with something simple to understand the basics, and this is about as basic as it gets. The project has a simple controller and a java bean wired through resources.groovy. No matter what we do, we can’t seem to get the bean wired properly, Grails complains that the bean property is not writable or may not have a getter/setter….

/* TestBean.groovy */
    class TestBean {    
        def message 
        String getMessage(){
            return message
        }
    }

.

/* resources.groovy */
import com.ofi.test.TestBean;

beans = {   
    helloWorldBean( TestBean){
        message = "HelloWorld"
    }   
}

.

/* TestController */
class TestController {

    def index = { }

    def helloWorldBean
    def show = {
        def message = helloWorldBean.message
        render message
    }
}

.

/* UrlMappings.groovy */
class UrlMappings {    
    static mappings = {

        "/test/$var"(controller:"Test"){
            action = [GET: "get"]
        }   
    }

.

The project compiles, but we get the following error message when the app loads up in Eclipse (we can’t even get to the controller, the TestBean config is failing)

2011-08-10 11:18:55,252 [main] ERROR context.GrailsContextLoader  - Error executing bootstraps: Error creating bean with name 'helloWorldBean': Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'message' of bean class [com.ofi.test.TestBean]: Bean property 'message' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloWorldBean': Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'message' of bean class [com.ofi.test.TestBean]: Bean property 'message' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
    at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:212)
    at grails.web.container.EmbeddableServer$start.call(Unknown Source)
    at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy:158)
    at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy)
    at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:280)
    at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
    at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:149)
  • 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-05-24T14:10:38+00:00Added an answer on May 24, 2026 at 2:10 pm

    Since your bean is a groovy bean, you don’t even need the accessors. The following should be fine:

    class TestBean {
        def message
    }
    

    In your case, the error’s probably occurring because the message field is typed as a def, but your accessor is typed as a String. If you must have the accessor there, try typing them the same.

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

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6

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.