- This topic has 4 replies, 2 voices, and was last updated 17 years, 8 months ago by Riyad Kalla.
-
AuthorPosts
-
Muhammad FAisalMemberHello,
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
Riyad KallaMemberFaisal,
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.
Muhammad FAisalMemberoh yeah, thanks for pointing out, i will check this.
Muhammad FAisalMemberfinaly 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
Riyad KallaMemberGood catch Faisal, glad you found it.
-
AuthorPosts