This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Hi, I have downloaded and installed eclipse.I want to work in spring framework.But i am very new to spring and eclipse too.I have installed the spring ide(spring-ide_updatesite_2.0.0_v200706271108.zip) inside the eclipse through update manager site.Then i have tried a sample program in the new spring project.First i had selected the interface and typed the GreetingService.java in src folder in the NewSpringProject.
Then i had typed the class file GreetingServiceImpl.java in src folder
After that I had selected an xml file and typed the following code
Finally i have typed the class file HelloApp.java . here I am getting the following errors:
BeanFactory cannot be resolved to a type The import org.springframework cannot be resolved XmlBeanFactory cannot be resolved to a type
.please guide me why i am getting the following errors and please anyone gude me how to work in spring initially.How to start a program basically in spring.
Because if you look at Spring's API, you'll see that there is no such constructor in XmlBeanFactory. Maybe you wanted to write it like this :
It's ok to use an IDE if you're not going to wasted hours trying to figure out how to configure something Well, it's compiling now, so you should be ok.
Joined: Oct 04, 2007
Hi, Thanks for your reply.It is working fine.But when i give like this:
I am getting the following error:
May 3, 2008 12:48:58 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from class path resource [hello.xml] Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [hello.xml]; nested exception is java.io.FileNotFoundException: class path resource [hello.xml] cannot be opened because it does not exist at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310) at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:73) at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:61) at HelloApp.main(HelloApp.java:14) Caused by: java.io.FileNotFoundException: class path resource [hello.xml] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:142) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) ... 4 more
like currently i assume your file should me in root directory of the application but you have to put this file in src folder , in my case i got same error so i changed the location and it is working fine.