java - NoClassDefinitionFoundError foundjavax/transaction/TransactionManager -


hi getting problem while trying integrate spring 3.0 hibernate 3.1, why getting type of error. in "hibernatedao" class used "autowired" technique "hibernatetemplate" , throwing error... enclosing "applicationcontext" , "web.xml"

 applicationcontext:@      <?xml version="1.0" encoding="utf-8"?>        <beans      xmlns="http://www.springframework.org/schema/beans"     xmlns:p="http://www.springframework.org/schema/p"     xmlns:mvc="http://www.springframework.org/schema/mvc"    xmlns:context="http://www.springframework.org/schema/context"    xmlns:aop="http://www.springframework.org/schema/aop"    xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"      xsi:schemalocation=    "http://www.springframework.org/schema/beans      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd     http://www.springframework.org/schema/context    http://www.springframework.org/schema/context/spring-context-3.0.xsd     http://www.springframework.org/schema/mvc      http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd      http://www.springframework.org/schema/aop      http://www.springframework.org/schema/aop/spring-aop-3.0.xsd" >      <!--<context:annotation-config />-->     <mvc:annotation-driven/>    <context:component-scan base-package="com.spring" />        <bean              class="org.springframework.web.servlet.view.internalresourceviewresolver">     <property name="viewclass"      value="org.springframework.web.servlet.view.internalresourceview"/>     <property name="prefix"  value="/" />     <property name="suffix" value=".jsp" />     </bean>      <bean id="bs" class="com.spring.bookserviceimpl"  />      <bean id="hbdao" class="com.spring.hibernatebookdao"  />      <bean id="htemp" class="org.springframework.orm.hibernate3.hibernatetemplate"  autowire="constructor" />      <!--<bean id="txmanger"     class="org.springframework.orm.hibernate3.transactionmanager" autowire="byname" />-->      <!--<bean id="transactionmanager" class="org.springframework.orm.hibernate.hibernate transactionmanager">    <property name="sessionfactory">     <ref bean="sessionfactory"/>    </property>   </bean>      -->     <bean id="sessionfactory"     class="org.springframework.orm.hibernate3.localsessionfactorybean">     <property name="datasource" ref="datasource" />      <property name="hibernateproperties">     <map>     <entry key="hibernate.dialect"    value="org.hibernate.dialect.mysqldialect" />     <entry key="hibernate.show_sql" value="true" />     <entry key="hibernate.hbm2ddl.auto" value="update" />     </map>     </property>      <property name="mappingresources">     <list>     <value>com/spring/book.hbm.xml</value>     </list>     </property>      </bean>    <bean id="datasource"     class="org.springframework.jdbc.datasource.drivermanagerdatasource">     <property name="driverclassname"         value="com.mysql.jdbc.driver">     </property>     <property name="url"         value="jdbc:mysql://loacalhost:3306/napiertest">     </property>     <property name="username" value="root"></property>     <property name="password" value="napier"></property>     </bean>      </beans> 

web.xml :@

  <?xml version="1.0" encoding="utf-8"?>  <web-app version="3.0"      xmlns="http://java.sun.com/xml/ns/javaee"      xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"      xsi:schemalocation="http://java.sun.com/xml/ns/javaee      http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">  <display-name></display-name>    <welcome-file-list>  <welcome-file>index.jsp</welcome-file>  </welcome-file-list>   <servlet>  <servlet-name>applicationcontext</servlet-name>  <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-  class>     <init-param>         <param-name>contextconfiglocation</param-name>         <param-value>/web-inf/applicationcontext-servlet.xml</param-value>     </init-param>     <load-on-startup>1</load-on-startup>      </servlet>     <servlet-mapping>    <servlet-name>applicationcontext</servlet-name>        <url-pattern>*.do</url-pattern>        </servlet-mapping>        </web-app> 

in case, applicationcontext dispatcher servlet having *.do extension.

<servlet-mapping>    <servlet-name>applicationcontext</servlet-name>        <url-pattern>*.do</url-pattern> </servlet-mapping> 

change controller this.. requestmapping should have .do extension. requests coming web.xml .do extension, requests should match controller @requestmapping annotation. add this,

@controller @requestmapping("/") public class appcontroller {  @requestmapping(value="/home.do" method=requestmethod.get)     public string samplemethod(model model){ 

Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -