Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Error: No setter found for property 'packagesToScan'. At servlet-context.xml

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

Trying to connect Hibernate 3 with my Spring application, I wrote this bean at servlet-context.xml:




No errors, except packagesToScan. I have no idea about how to create a setter for 'packagesToScan', where it has suppose to be created, or how to set it.

I read in some forums looking for an answer, that application has to be implemented under a recent Spring version, 3.1 or upper, but I already have 3.2.0.RELEASE version, as 'Help' main-menu option indicates me



Any Idea?
 
Ranch Hand
Posts: 138
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is just a wild guess, not sure if thats the reason.

I looked at the AnnotationSessionFactoryBean class and it has 'packagesToScan' as a String[] as opposed to String.
(I have Spring3.0 installed though)
So if at all there is a different way to set array property in Spring configuration file..
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you try the below code

 
Ramon Bonet
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Issue fixed: packagesToScan needs the 'orm' artifact, from 'org.springframework' group dependences, and it has to be a 3.2.2 version or newer

Using maven, at pom.xml file, include de newest version of org.springframework, inside <properties> element before <dependency> declarations:



3.2.3.RELEASE is the current last version

Then include the following dependency:



REMEMBER: all artifacts of the same group Id dependencies must have the same version. So if you are using others org.springframwork artifacts, be sure they are running under ${org.springframework-version} value version (3.2.3.RELEASE in this case)

Thread solved!

 
Everybody! Do the Funky Monkey! Like this tiny ad!
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic