WSAD, Hibernate 3.0
Really strange exception. When the hmb file is changed from:
<hibernate-mapping>
<class name="reservatio.CustomerScheduleSeat" table="customer_schedule_seat" catalog="reservatio">
<composite-id name="id" class="reservatio.CustomerScheduleSeatId">
<key-property name="idSchedule" type="integer">
<column name="idSchedule" />
</key-property>
<key-property name="idSeat" type="integer">
<column name="idSeat" />
</key-property>
</composite-id>
<timestamp name="audLsupTs" column="AUD_LSUP_TS" unsaved-value="null"/>
<many-to-one name="customer" class="reservatio.Customer" fetch="select">
<column name="idCustomer" />
</many-to-one>
.....
to
<hibernate-mapping>
<class name="reservatio.CustomerScheduleSeat" table="customer_schedule_seat" catalog="reservatio">
<composite-id name="id" class="reservatio.CustomerScheduleSeatId">
<key-property name="idSchedule" type="integer">
<column name="idSchedule" />
</key-property>
<key-property name="idSeat" type="integer">
<column name="idSeat" />
</key-property>
</composite-id>
<timestamp name="audLsupTs" column="AUD_LSUP_TS" unsaved-value="null" generated="always"/>
<many-to-one name="customer" class="reservatio.Customer" fetch="select">
<column name="idCustomer" />
</many-to-one>
....
I get the xml parser choking. It gives:
[@APPNAME@] DEBUG [Thread-2] DefaultListableBeanFactory.applyBeanPostProcessorsBeforeInitialization(231) | Invoking BeanPostProcessors before initialization of bean 'sessionFactory'
[@APPNAME@] DEBUG [Thread-2] DefaultListableBeanFactory.invokeInitMethods(960) | Invoking afterPropertiesSet() on bean with name 'sessionFactory'
[@APPNAME@] ERROR [Thread-2] XMLHelper.error(59) | Error parsing XML: XML InputStream(15) Attribute "generated" must be declared for element type "timestamp".
[@APPNAME@] INFO [Thread-2] DefaultListableBeanFactory.destroySingletons(525) | Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [sessionFactory,transactionManager,dao,customerScheduleSeatDao,customerDao,codeListManagerDao,showsDao,scheduleDao,venueDao,seatOnTemporaryHold,validatorFactory,beanValidator,propertyConfigurer,dataSource,filterChainProxy,filterInvocationInterceptor,authenticationManager,loggerListener,daoAuthenticationProvider,jdbcAuthenticationDao,userCache,anonymousAuthenticationProvider,roleVoter,accessDecisionManager,httpSessionContextIntegrationFilter,authenticationProcessingFilter,anonymousProcessingFilter,securityEnforcementFilter,remoteUserFilter,authenticationProcessingFilterEntryPoint,userManager,userManagerSecurity,txProxyTemplate,purchaseManager,recommendationSearchManager,searchManager,codeListManager]; root of BeanFactory hierarchy}
[@APPNAME@] ERROR [Thread-2] ContextLoader.initWebApplicationContext(177) | Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext-hibernate.xml]: Initialization of bean failed; nested exception is org.hibernate.MappingException: invalid mapping
org.hibernate.MappingException: invalid mapping
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:399)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:608)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:962)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:354)
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:312)
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.appfuse.webapp.listener.StartupListener.contextInitialized(StartupListener.java:38)
at com.ibm.ws.webcontainer.srt.WebGroup.notifyServletContextCreated(WebGroup.java:1698)
Any ideas why this additional attribute is not being recognized? If I remove the generated= property no problems. The dtd I am using is 3.0 at build time anyways. At runtime I assume it connects to the server to fetch the dtd.
Any help would be greatly appreciated.
|