首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

Hibernat+Spring 有关问题

2013-09-11 
Hibernat+Spring 问题 org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithn

Hibernat+Spring 问题

org.springframework.beans.factory.BeanCreationException:   Error   creating   bean   with   name   'userTarget '   defined   in   class   path   resource   [applicationContext.xml]:   Can 't   resolve   reference   to   bean   'userDAO '   while   setting   property   'userDAO ';   nested   exception   is   org.springframework.beans.factory.BeanCreationException:   Error   creating   bean   with   name   'userDAO '   defined   in   class   path   resource   [applicationContext.xml]:   Instantiation   of   bean   failed;   nested   exception   is   java.lang.NoClassDefFoundError:   org/hibernate/SessionFactory
org.springframework.beans.factory.BeanCreationException:   Error   creating   bean   with   name   'userDAO '   defined   in   class   path   resource   [applicationContext.xml]:   Instantiation   of   bean   failed;   nested   exception   is   java.lang.NoClassDefFoundError:   org/hibernate/SessionFactory
java.lang.NoClassDefFoundError:   org/hibernate/SessionFactory
at   java.lang.Class.getDeclaredMethods0(Native   Method)
at   java.lang.Class.privateGetDeclaredMethods(Unknown   Source)
at   java.lang.Class.getDeclaredMethods(Unknown   Source)
at   java.beans.Introspector$1.run(Unknown   Source)
at   java.security.AccessController.doPrivileged(Native   Method)
at   java.beans.Introspector.getPublicDeclaredMethods(Unknown   Source)
at   java.beans.Introspector.getTargetMethodInfo(Unknown   Source)
at   java.beans.Introspector.getBeanInfo(Unknown   Source)
at   java.beans.Introspector.getBeanInfo(Unknown   Source)
at   java.beans.Introspector.getBeanInfo(Unknown   Source)
at   java.beans.Introspector. <init> (Unknown   Source)
at   java.beans.Introspector.getBeanInfo(Unknown   Source)
at   org.springframework.beans.CachedIntrospectionResults. <init> (CachedIntrospectionResults.java:140)
at   org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:82)
at   org.springframework.beans.BeanWrapperImpl.setIntrospectionClass(BeanWrapperImpl.java:310)
at   org.springframework.beans.BeanWrapperImpl.setWrappedInstance(BeanWrapperImpl.java:268)
at   org.springframework.beans.BeanWrapperImpl.setWrappedInstance(BeanWrapperImpl.java:250)
at   org.springframework.beans.BeanWrapperImpl. <init> (BeanWrapperImpl.java:203)
at   org.springframework.beans.factory.support.AbstractBeanFactory.createBeanWrapper(AbstractBeanFactory.java:558)
at   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:317)
at   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:257)
at   org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:223)
at   org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveReference(AbstractAutowireCapableBeanFactory.java:1021)
at   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:944)
at   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:885)


at   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:714)
at   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:331)
at   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:257)
at   org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:223)
at   org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveReference(AbstractAutowireCapableBeanFactory.java:1021)
at   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:944)
at   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:885)
at   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:714)
at   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:331)
at   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:257)
at   org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:223)
at   org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at   org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:271)
at   org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:319)
at   org.springframework.context.support.ClassPathXmlApplicationContext. <init> (ClassPathXmlApplicationContext.java:80)
at   org.springframework.context.support.ClassPathXmlApplicationContext. <init> (ClassPathXmlApplicationContext.java:65)
at   org.springframework.context.support.ClassPathXmlApplicationContext. <init> (ClassPathXmlApplicationContext.java:56)
at   springdemo.com.dao.UserHibernateDAO.main(UserHibernateDAO.java:42)


说什么东西找不到?是我没有加某个包吗?

[解决办法]
java.lang.NoClassDefFoundError:
org/hibernate/SessionFactory
----------------------------------

hibernate3.jar包加进来没?

热点排行