• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

re: basic question on Spring framework

 
Ranch Hand
Posts: 46
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I just try to learn the Spring framework , and I ran into an error message when I try to run a simple spring "helloWorld" application.
The error stated that "org.springframework.core.io.ClassPathResource cannot be cast to org.springframework.beans.factory.BeanFactory" which refer to this code in my program:



and the file SpringHelloWorld.xml is located in /Spring/src/SpringHelloWorld.xml

The complete program is as follow





Please help me if you know what's going wrong.

Thnaks so much in advance.

Mark
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let me save you much time.

If you are learning Spring new, then you will never ever use that type of code. That is over 5 years old style of Spring coding. I recommend finding Spring materials that are up to date.

You will use a class that implements ApplicationContext instead.

Mark
 
Mark Curlette
Ranch Hand
Posts: 46
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much Mark for showing me the right direction.

Yes, I followed your advice to get new text material on Spring , and changed my code to ApplicationContext and it worked wonderfully.




Thanks again and have a great day.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic