• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Spring MVC: NotWritablePropertyException

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm doing a Spring MVC application with this tutorial:
http://static.springsource.org/docs/Spring-MVC-step-by-step/

It all works perfectly, but my real goal is to build a bookshop application, so I have to substitute class Product for class Book (& all related names like 'product' -> 'book').
I've done the substitution just by:
1. Find/Replace (with Case sensitive off course): 'Product' -> 'Book', 'product' -> 'book', 'PRODUCT' -> 'BOOK'
2. changing file names appropriately
3. Change some names of Book attribute like Product.id' -> 'Book.isbn'

and that's all. The project compiles without errors, builds & deploys with Ant build.xml script. But when I restart Tomcat, the exception occurs:
"Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'bookManager' of bean class [web.InventoryController]: Bean property 'bookManager' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?"

Of course I've checked & everything is OK with bookManager - it has correct setter etc.

Here is the stack trace from Eclipse console:
http://home.elka.pw.edu.pl/~zfabijan/springmvc/stackTrace.txt

After every change in code, I always rebuild, deploy & restart the Tomcat server in Eclipse. And the HSQL database is running too

Here are these projects, made in Eclipse 3.4 Ganymede JEE & Tomcat 6.0.20, so You can check everything yourself.
1. From tutorial (works fine): http://home.elka.pw.edu.pl/~zfabijan/springmvc/springapp.rar
2. My bookshop with books instead of products: http://home.elka.pw.edu.pl/~zfabijan/springmvc/bookshop.rar


If any of You had this problem or knows the solution or has some time to check these 2 projects, I would be greatful.

Regards,
Zbyszek.





Ok, I've done the tutorial once again but this time straightly with Book class from the very beginning ;) I think the problem was that the bean 'productManager' was still somewhere deployed in Tomcat, instead of the 'bookManager' bean. Thanks for help! ;P
 
reply
    Bookmark Topic Watch Topic
  • New Topic