java.lang.ExceptionInInitializerError at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:202) at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:251) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:248) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFactory‘ defined in class path resource [spring/applicationContext-db.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from file E:\workspace\webworkspace\movetest\WebRoot\WEB-INF\classes\com\itjb\movie\domain\Movie.hbm.xml at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:546) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:872) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) at com.itjb.movie.test.SpringUtils.<clinit>(SpringUtils.java:9) ... 22 more Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from file E:\workspace\webworkspace\movetest\WebRoot\WEB-INF\classes\com\itjb\movie\domain\Movie.hbm.xml at org.hibernate.cfg.Configuration.addFile(Configuration.java:406) at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:764) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:710) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1469) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409) ... 34 more Caused by: org.hibernate.PropertyNotFoundException: field [classify] not found on com.itjb.movie.domain.Movie at org.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:182) at org.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:174) at org.hibernate.property.DirectPropertyAccessor.getGetter(DirectPropertyAccessor.java:197) at org.hibernate.util.ReflectHelper.getter(ReflectHelper.java:241) at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:229) at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:301) at org.hibernate.cfg.HbmBinder.createProperty(HbmBinder.java:2267) at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2244) at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2134) at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:407) at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:321) at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:172) at org.hibernate.cfg.Configuration.add(Configuration.java:771) at org.hibernate.cfg.Configuration.addFile(Configuration.java:396) ... 39 more
问题:
持久化类中使用int 没有使用Interger.
持久化类多添加一个属性.
时间: 2024-10-12 09:17:46