Hi
Hope someone can help.
Got a Spring application up and running (in Tomcat 5) following a tutorial. Decided to convert it to using Hibernate and bang! hit a brick wall.
I get this Exception when I open the page that does a DB read:
Code:
org.springframework.beans.factory.BeanDefinitionStoreException: Line 81 in XML document from resource [/WEB-INF/springapp-servlet.xml] of ServletContext is invalid; nested exception is org.xml.sax.SAXParseException: The content of element type "property" must match "(description?,(bean|ref|idref|list|set|map|props|value|null))"
Funny thing is that all my <property> elements do contain the correct content. The other funny thing is that the exception sometimes changes to complain about a class not being found (either javax/transaction/transaction or javax/transaction/SystemException or someting similar).
Anyone have any idea please ?
Edward
PS Here's my springapp-servlet.xml that it's complaining about
[code]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<!--
- Application context definition for "springapp" DispatcherServlet.
-->
<beans>
<!-- Controller for the initial "Hello" page -->
<bean id="springappController" class="web.SpringappController">
<property name="productManager">
<ref bean="prodMan"/>
</property>
</bean>
<!-- Validator and Form Controller for the "Price Increase" page -->
<bean id="priceIncreaseValidator" class="bus.PriceIncreaseValidator"/>
<bean id="priceIncreaseForm" class="web.PriceIncreaseFormController">
<property name="sessionForm"><value>true</value></property>
<property name="commandName"><value>priceIncrease</value></property>
<property name="commandClass"><value>bus.PriceIncrease</value></property>
<property name="validator"><ref bean="priceIncreaseValidator"/></property>
<property name="formView"><value>priceincrease</value></property>
<property name="successView"><value>hello.htm</value></property>
<property name="productManager">
<ref bean="prodMan"/>
</property>
</bean>
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName"><value>org.hsqldb.jdbcDriver</value></property>
<property name="url">
<value>jdbc:hsqldb:/Users/edward/Development/Java/springapp/db/test</value>
</property>
<property name="username"><value>sa</value></property>
<property name="password"><value/></property>
</bean>
<!-- -->
<!-- Hibernate SessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="dataSource"><ref local="dataSource"/></property>
<!-- Must references all OR mapping files. -->
<property name="mappingResources">
<list>
<value>db/Product.hbm.xml</value>
</list>
</property>
<!-- Set the type of database; changing this one property will port this to Oracle, MS SQL etc. -->
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">net.sf.hibernate.dialect.HSQLDialect</prop>
</props>
</property>
</bean>
<bean id="prodManDao" class="db.ProductManagerDaoHibernate">
<property name="sessionFactory"><ref local="sessionFactory"/></property>
</bean>
<bean id="prodMan" class="bus.ProductManager">
<property name="productManagerDao">
<ref bean="prodManDao"/>
</property>
</bean>
<!-- -->
<bean id="MyTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"/>
<bean id="MyTransactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager"><ref bean="MyTransactionManager"/></property>
<property name="transactionAttributeSource">
<value>