This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund 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.
In Eclipse, in your project settings, did you set the spring.jar library ? Right-click your project, select Properties... In Java Build Path/Library, you need to add spring.jar.
Thankyou.I have added the spring.jar. Now i am getting only one error.
The constructor XmlBeanFactory(FileInputStream) is undefined
Why is it so?
Is it tough working with an ide in initial stage?Then how should i start to work in spring.please do help me.I dont know anything about spring framework.
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.
preethi Ayyappan
Ranch Hand
Joined: Oct 04, 2007
Posts: 518
posted
0
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
Sp sunil
Greenhorn
Joined: Jan 20, 2010
Posts: 1
posted
0
just change the location of hello.xml file
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.
Please let us know if you have any issue further.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.