org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory ' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/transaction/TransactionManager救命啊,各位大虾<beans ><bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close" >
<property name="driverClassName" >
<value >com.microsoft.sqlserver.jdbc.SQLServerDriver </value >
</property >
<property name="url" >
<value >jdbc:sqlserver://localhost:1433;DatabaseName=kimmy </value >
</property >
<property name="username" >
<value >sa </value >
</property >
<property name="password" >
<value >sa </value >
</property >
</bean ><bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" >
<property name="dataSource" ref="dataSource" / >
<property name="mappingResources" >
<list >
<value >com/pojo/User.hbm.xml </value >
</list >
</property >
<property name="hibernateProperties" >
<props >
<prop key="hibernate.dialect" >
org.hibernate.dialect.SQLServerDialect
</prop >
<!--
<prop key="hibernate.query.substitutions" >
true 'Y ', false 'N '
</prop >
-- >
<prop key="hibernate.show_sql" >true </prop >
</props >
</property >
</bean >
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close" >
<property name="driverClassName" >
<value >com.microsoft.sqlserver.jdbc.SQLServerDriver </value >
</property >
<property name="url" >
<value >jdbc:sqlserver://localhost:1433;DatabaseName=kimmy </value >
</property >
<property name="username" >
<value >sa </value >
</property >
<property name="password" >
<value >sa </value >
</property >
</bean ><bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" >
<property name="dataSource" ref="dataSource" / >
<property name="mappingResources" >
<list >
<value >com/pojo/User.hbm.xml </value >
</list >
</property >
<property name="hibernateProperties" >
<props >
<prop key="hibernate.dialect" >
org.hibernate.dialect.SQLServerDialect
</prop >
<!--
<prop key="hibernate.query.substitutions" >
true 'Y ', false 'N '
</prop >
-- >
<prop key="hibernate.show_sql" >true </prop >
</props >
</property >
</bean >
添加上即可
同意楼上jta.jar
严重: Error listenerStart
2007-10-15 9:15:41 org.apache.catalina.core.StandardContext start
严重: Context [/kimmySSH] startup failed due to previous errors
tomcat控制台报出来的错误org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.hibernate.MappingException: invalid mapping还是报这样的异常,,,hibernate 映射文件已经检查过,问题~~~~
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName">
<value>com.microsoft.sqlserver.jdbc.SQLServerDriver</value>
</property>
<property name="url">
<value>jdbc:sqlserver://localhost:1433;DatabaseName=kimmy</value>
</property>
<property name="username">
<value>sa</value>
</property>
<property name="password">
<value>sa</value>
</property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="mappingResources">
<list>
<value>com/pojo/User.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</prop>
<!--
<prop key="hibernate.query.substitutions">
true 'Y', false 'N'
</prop>
-->
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>配置文件是这么写的,,用的是2005的驱动!!!