问题描述
upgradedatabasestart...loadspringapplicationcontextexception:Errorcreatingbeanwithname'sessionFactory'definedinclasspathresource[suite-hibernate.xml]:Invocationofinitmethodfailed;nestedexceptionisorg.hibernate.MappingException:Duplicatepropertymappingofpanelfoundincom.dascom.dafc.appserver.model.portal.hibernate.PanelCustomBlockImplorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'sessionFactory'definedinclasspathresource[suite-hibernate.xml]:Invocationofinitmethodfailed;nestedexceptionisorg.hibernate.MappingException:Duplicatepropertymappingofpanelfoundincom.dascom.dafc.appserver.model.portal.hibernate.PanelCustomBlockImplatorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)atjava.security.AccessController.doPrivileged(NativeMethod)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)atorg.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)atorg.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)atorg.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)atorg.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)atorg.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)atorg.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)atcom.dascom.dafc.appserver.hibernate.SpringHelper.<clinit>(SpringHelper.java:15)atcom.dascom.elearning.setup.upgrade.SkillsUpgrader.work(SkillsUpgrader.java:28)atcom.dascom.elearning.setup.DatabaseToolkit.upgrade(DatabaseToolkit.java:109)atcom.dascom.elearning.setup.AbToolkit.deploy(AbToolkit.java:93)atcom.dascom.elearning.setup.AbToolkit.main(AbToolkit.java:32)Causedby:org.hibernate.MappingException:Duplicatepropertymappingofpanelfoundincom.dascom.dafc.appserver.model.portal.hibernate.PanelCustomBlockImplatorg.hibernate.mapping.PersistentClass.checkPropertyDuplication(PersistentClass.java:477)atorg.hibernate.mapping.PersistentClass.validate(PersistentClass.java:467)atorg.hibernate.mapping.RootClass.validate(RootClass.java:215)atorg.hibernate.cfg.Configuration.validate(Configuration.java:1149)atorg.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1334)atorg.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814)atorg.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:732)atorg.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)...19moreExceptioninthread"main"java.lang.NullPointerExceptionatcom.dascom.dafc.appserver.hibernate.SpringHelper.loadBeanByName(SpringHelper.java:24)atcom.dascom.dafc.appserver.hibernate.SpringHelper.getTransaction(SpringHelper.java:28)atcom.dascom.elearning.setup.upgrade.SkillsUpgrader.work(SkillsUpgrader.java:28)atcom.dascom.elearning.setup.DatabaseToolkit.upgrade(DatabaseToolkit.java:109)atcom.dascom.elearning.setup.AbToolkit.deploy(AbToolkit.java:93)atcom.dascom.elearning.setup.AbToolkit.main(AbToolkit.java:32)
解决方案
解决方案二:
错误信息提示的很明确:Duplicatepropertymappingofpanelfoundincom.dascom.dafc.appserver.model.portal.hibernate.PanelCustomBlockImpl
解决方案三:
Exceptioninthread"main"java.lang.NullPointerExceptionatcom.dascom.dafc.appserver.hibernate.SpringHelper.loadBeanByName(SpringHelper.java:24).NullPointerException这里不是报了空指针?从这里看看