aspose file tools*
The moose likes Spring and the fly likes re: basic question on Spring framework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "re: basic question on Spring framework" Watch "re: basic question on Spring framework" New topic
Author

re: basic question on Spring framework

Mark Curlette
Ranch Hand

Joined: May 26, 2011
Posts: 46

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

Joined: Feb 05, 2001
Posts: 17259
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Mark Curlette
Ranch Hand

Joined: May 26, 2011
Posts: 46

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: re: basic question on Spring framework