今天给系统增加了一个表,要给这个表增加一个hibernate的映射文件,增加完映射文件后启动,抱错了
ERROR [org.hibernate.util.XMLHelper] - Error parsing XML: XML InputStream(53) Value must be quoted.
INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [propertymap,propertyConfigurer,dataSource,sessionFactory,transactionManager,proxyTemplate,dao,service,jdbcTemplate,updateService,priceService,createPriceUtil,createRoomNumberUtil,deletePriceUtil,roomNumberTimeoutUtil,jobDetailCreateDayprice,jobDetailCreateRoomNumber,jobDetailDeletePrice,jobDetailRoomNumberTimeout,cronTriggerDayprice,cronTriggerRoomNumber,cronTriggerDeletePrice,cronTriggerRoomNumberTimeout,org.springframework.scheduling.quartz.SchedulerFactoryBean]; root of BeanFactory hierarchy}
ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext-hibernate.xml]: Initialization of bean failed; nested exception is org.hibernate.MappingException: Could not read mapping document from file: ....../Price.hbm.xml
org.hibernate.MappingException: Could not read mapping document from file: ..../Price.hbm.xml
一看,肯定是映射文件出现问题了,首先检查了类型,没有问题
最后发现,原来是在复制字段时,将
<property
name="startdate"
type="timestamp"
column="startdate"
length="23"
/>
改成
<property
name=startdate
type="timestamp"
column="startdate"
length="23"
/>
少了一对双引号,编辑器没有报错.但是启动时却无法正常启动了.
改回来后启动正常了.
随后想了一下,将双引号改成单引号试试,启动系统还是正常启动.