Announcement Announcement Module
No announcement yet.
hibernate config Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • hibernate config

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "">

    <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer">
    <property name="location"><value>/WEB-INF/</value></property>

    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverM anagerDataSource">
    <property name="url"><value>${hibernate.connection.url}</value></property>
    <property name="driverClassName"><value>${hibernate.connecti on.driver_class}</value></property>
    <property name="username"><value>${hibernate.connection.user name}</value></property>
    <property name="password"><value>${hibernate.connection.pass word}</value></property>

    <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSess ionFactoryBean">
    <property name="dataSource"><ref bean="dataSource"/></property>
    <property name="mappingResources">
    <property name="hibernateProperties">
    <prop key="hibernate.dialect">${hibernate.dialect}</prop>

    <bean id="catalogItemDao" class="com.test.dao.hibernate.CatalogItemDaoImp">
    <property name="sessionFactory"><ref bean="sessionFactory"/></property>

    I'm not sure how to go about debugging this stuff. I'm having a problems with the sessionFactory bean. If I comment it out, then the application will load on tomcat without any problems. As soon as I uncomment won't load. I've looked at the tomcat logs and they don't really have very much information.

  • #2
    Does your application have its own log file separated from tomcat's (depending on how log4j is configured)? You need to tell us more than "it won't load" for us to be able to help you.


    • #3
      For some reason my log4j was not working correctly but after I reinstalled some things. The log messages showed that I needed to set org.springframework.orm.hibernate3.LocalSessionFac toryBean instead of what I had above. Looks like the packaging structure was changed dramatically since hibernate 2.0.