• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

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!

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic