This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

re: basic question on Spring framework

 
Mark Curlette
Ranch Hand
Posts: 46
Java
  • Mark post as helpful
  • send pies
  • 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
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic