Announcement Announcement Module
Collapse
No announcement yet.
Unable to run STS template MVC app using Maven and Hibernate dependencies Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to run STS template MVC app using Maven and Hibernate dependencies

    I'm using the latest version of STS. I created a Spring MVC template project. When trying to run the app in the tc server, I get the following error:

    ERROR: org.springframework.web.servlet.DispatcherServlet - Context initialization failed
    org.springframework.beans.factory.CannotLoadBeanCl assException: Cannot find class [org.springframework.orm.hibernate3.LocalSessionFac toryBean] for bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.orm.hibernate3.LocalSessionFac toryBean

    My spring-servlet.xml is:

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:jee="http://www.springframework.org/schema/jee"
    xmlns:lang="http://www.springframework.org/schema/lang"
    xmlns="http://www.springframework.org/schema/p"

    xmlns:util="http://www.springframework.org/schema/util"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...ring-beans.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schem...spring-aop.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schem...ng-context.xsd
    http://www.springframework.org/schema/jee http://www.springframework.org/schem...spring-jee.xsd
    http://www.springframework.org/schema/lang http://www.springframework.org/schem...pring-lang.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
    <context:annotation-config />
    <context:component-scan base-package="net.viralpatel.docmanager" />
    <bean id="jspViewResolver"
    class="org.springframework.web.servlet.view.Intern alResourceViewResolver">
    <property name="viewClass"
    value="org.springframework.web.servlet.view.JstlVi ew" />
    <property name="prefix" value="/WEB-INF/jsp/" />
    <property name="suffix" value=".jsp" />
    </bean>
    <bean id="propertyConfigurer"
    class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer"
    p:location="/WEB-INF/jdbc.properties" />
    <bean id="dataSource"
    class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"
    p:driverClassName="${jdbc.driverClassName}"
    p:url="${jdbc.databaseurl}" p:username="${jdbc.username}"
    password="${jdbc.password}" />
    <bean id="sessionFactory"
    class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
    <property name="dataSource" ref="dataSource" />
    <property name="configLocation">
    <value>classpath:hibernate.cfg.xml</value>
    </property>
    <property name="configurationClass">
    <value>org.hibernate.cfg.AnnotationConfiguration </value>
    </property>
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">${jdbc.dialect}</prop>
    <prop key="hibernate.show_sql">true</prop>
    <prop key="hibernate.connection.SetBigStringTryClob">tru e</prop>
    <prop key="hibernate.jdbc.batch_size">0</prop>
    </props>
    </property>
    </bean>
    <bean id="multipartResolver"
    class="org.springframework.web.multipart.commons.C ommonsMultipartResolver">
    <!-- one of the properties available; the maximum file size in bytes -->
    <property name="maxUploadSize" value="10000000" />
    </bean>

    <bean id="transactionManager"
    class="org.springframework.orm.hibernate3.Hibernat eTransactionManager">
    <property name="sessionFactory" ref="sessionFactory" />
    </bean>
    </beans>


    Would appreciate any advice on what might be causing this error and please let me know if you need any additional info such as the pom.xml. THANK YOU!
Working...
X