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

  • hibernate config

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

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

    <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>

    <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSess ionFactoryBean">
    <property name="dataSource"><ref bean="dataSource"/></property>
    <property name="mappingResources">
    <list>
    <value>com/test/model/CatalogItem.hbm.xml</value>
    </list>
    </property>
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">${hibernate.dialect}</prop>
    </props>
    </property>
    </bean>
    <!--
    -->

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



    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 it...it 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.

    Comment


    • #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.

      Comment

      Working...
      X