• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

spring inside eclipse

 
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Thanks
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

How to start a program basically in spring.


By using an IDE you are comfortable with !
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Why is it so?


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
Posts: 518
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic