facebook

[Closed] Spring-hibernate tutorial exception

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #269950 Reply

    Hello,

    I followd this tutorial

    http://www.myeclipseide.com/images/tutorials/quickstarts/hibernate_and_spring/tutorial.html

    when i try to run in the end i found exception

    ——————————————————————————————————–
    og4j:WARN No appenders could be found for logger (org.springframework.core.CollectionFactory).
    log4j:WARN Please initialize the log4j system properly.
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘persistenceLayer’ is defined
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:360)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:686)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:219)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)
    at com.myeclipse.hibernateSpring.BusinessLogic.main(BusinessLogic.java:25)
    Exception in thread “main”
    ——————————————————————————————————–

    If i download sample project from
    http://www.myeclipseide.com/images/tutorials/quickstarts/hibernate_and_spring/resources/HibernateSpringProject.zip
    it works fine, may be there is some thing missing in my project any Idea ?

    Thanks
    Faisal khan

    #269972 Reply

    Riyad Kalla
    Member

    Faisal,
    If the demo project works fine, and yours doesn’t work I would encourage you to go step by step through the two, comparing all the code and figure out where you went wrong. Check for spelling errors as well, that can sometimes throw people off.

    For example, if in your spring config file, you called it “persistanceLayer” with an “a” instead of an “e”, then in your code you try and load the correct spelling, it can’t find your bean.

    #269996 Reply

    oh yeah, thanks for pointing out, i will check this.

    #270071 Reply

    finaly i found issue in it.

    in applicationContext.xml we were declaring bean with name of “persistenceLayer” with ‘P’ with cap letter and was trying to access “persistenceLayer” from BusinessLogic.java with ‘p’ with small letter.
    posting b/c might help for new guys.

    Thanks
    Faisal khan

    #270080 Reply

    Riyad Kalla
    Member

    Good catch Faisal, glad you found it.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: [Closed] Spring-hibernate tutorial exception

You must be logged in to post in the forum log in