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

有没有人解决过这个有关问题啊偶不知是那的配置有有关问题了,请各位帮帮忙啊

2013-09-11 
有没有人解决过这个问题啊?偶不知是那的配置有问题了,请各位帮帮忙啊!?这是STRUTS+HIBERNATE的配置有问题,

有没有人解决过这个问题啊?偶不知是那的配置有问题了,请各位帮帮忙啊!?
这是STRUTS+HIBERNATE的配置有问题,但不知在那出错.麻烦大家帮帮忙!
2007-03-16   15:57:29,593   -   [ERROR]   [ContextLoader]   -   Context   initialization   failed
org.springframework.beans.factory.BeanCreationException:   Error   creating   bean   with   name   'transactionManager '   defined   in   ServletContext   resource   [/WEB-INF/spring/applicationContext-hibernate.xml]:   Can 't   resolve   reference   to   bean   'sessionFactory '   while   setting   property   'sessionFactory ';   nested   exception   is   org.springframework.beans.factory.BeanCreationException:   Error   creating   bean   with   name   'sessionFactory '   defined   in   ServletContext   resource   [/WEB-INF/spring/applicationContext-hibernate.xml]:   Initialization   of   bean   failed;   nested   exception   is   java.lang.NoClassDefFoundError:   null
org.springframework.beans.factory.BeanCreationException:   Error   creating   bean   with   name   'sessionFactory '   defined   in   ServletContext   resource   [/WEB-INF/spring/applicationContext-hibernate.xml]:   Initialization   of   bean   failed;   nested   exception   is   java.lang.NoClassDefFoundError:   null
java.lang.NoClassDefFoundError
at   org.hibernate.tuple.EntityMetamodel.class$(EntityMetamodel.java:41)
at   org.hibernate.tuple.EntityMetamodel. <init> (EntityMetamodel.java:122)
at   org.hibernate.persister.entity.AbstractEntityPersister. <init> (AbstractEntityPersister.java:412)
at   org.hibernate.persister.entity.SingleTableEntityPersister. <init> (SingleTableEntityPersister.java:108)
at   org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at   org.hibernate.impl.SessionFactoryImpl. <init> (SessionFactoryImpl.java:216)
at   org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
at   org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:767)
at   org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:693)
at   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1003)
at   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:348)
at   org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
at   org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at   org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:176)
at   org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:105)
at   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:957)
at   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:768)
at   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:330)
at   org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
at   org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)


at   org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:275)
at   org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:317)
at   org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
at   org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:230)
at   org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:156)
at   org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:48)
at   org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
at   org.apache.catalina.core.StandardContext.start(StandardContext.java:4343)
at   org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at   org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
at   org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at   org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
at   org.apache.catalina.core.StandardService.start(StandardService.java:480)
at   org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
at   org.apache.catalina.startup.Catalina.start(Catalina.java:556)
at   sun.reflect.NativeMethodAccessorImpl.invoke0(Native   Method)
at   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at   java.lang.reflect.Method.invoke(Method.java:585)
at   org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
at   org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
Caused   by:   java.lang.ClassNotFoundException:   net.sf.cglib.transform.impl.InterceptFieldEnabled
at   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340)
at   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
at   java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at   java.lang.Class.forName0(Native   Method)
at   java.lang.Class.forName(Class.java:164)
...   41   more

[解决办法]
exception is java.lang.NoClassDefFoundError: null
java.lang.NoClassDefFoundError
类没有发现
是不是xml和对应的table的bean没有生成
[解决办法]
<bean id= "HibernateSessionFactory " class= "org.springframework.orm.hibernate3.LocalSessionFactoryBean ">
<property name= "configLocation ">
<value> /hibernate-informix.cfg.xml </value>
</property>
</bean>

<!-- Session end -->

<bean id= "transactionManager " class= "org.springframework.orm.hibernate3.HibernateTransactionManager ">
<property name= "sessionFactory ">
<ref local= "HibernateSessionFactory " />
</property>
</bean>
[解决办法]
hibernate-informix.cfg.xml是数据源配置文件!

热点排行