求助 springmvc+hibernate项目启动报错,卡这 好天了找不到原因
spring吧
全部回复
仅看楼主
level 1
s15245462516 楼主
2016年05月09日 01点05分 1
level 1
s15245462516 楼主
<?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:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="userDao" class="com.lib.dao.impl.IUserDao">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean id="studentDao" class="com.lib.dao.impl.IStudentDao">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean id="userManagerBase" class="com.lib.manager.impl.IUserManager">
<property name="userDao" ref="userDao"></property>
</bean>
<bean id= "studentManagerBase" class="com.lib.manager.impl.IStudentManager">
<property name="studentDao" ref="studentDao"></property>
</bean>
<!-- 此处为代理 -->
<bean name="userManager" parent="transactionProxy">
<property name="target" ref="userManagerBase"></property>
</bean>
<bean name="studentManager" parent="transactionProxy">
<property name="target" ref="studentManagerBase"></property>
</bean>
</beans>
2016年05月09日 01点05分 2
level 1
s15245462516 楼主
<!-- 配置数据源 -->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >
<property name="driverClassName"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver">
</property>
<property name="url"
value="jdbc:sqlserver://127.0.0.1:1433;databaseName=library">
</property>
<property name="username" value="sa"></property>
<property name="password" value="syl19950927"></property>
</bean>
<!-- 配置SessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop>
</props>
</property>
<property name="annotatedClasses">
<list>
<value>com.lib.entity.User</value>
<value>com.lib.entity.Student</value>
</list>
</property>
</bean>
<!-- 配置一个事务管理器 -->
<bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<!-- 配置事务,使用代理的方式 -->
<bean id="transactionProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" abstract="true">
<property name="transactionManager" ref="transactionManager"></property>
<property name="transactionAttributes">
<props>
<prop key="add*">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="modify*">PROPAGATION_REQUIRED,-myException</prop>
<prop key="del*">PROPAGATION_REQUIRED</prop>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
</beans>
2016年05月09日 01点05分 3
level 1
s15245462516 楼主
<?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:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">
<!-- 注解扫描包 -->
<context:component-scan base-package="com.lib" />
<!-- 开启注解 -->
<mvc:annotation-driven />
<!-- 静态资源(js/image)的访问 -->
<mvc:resources location="/js/" mapping="/js/**"/>
<!-- 定义视图解析器 -->
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
</beans>
2016年05月09日 01点05分 4
level 1
第一个图的报错都告诉你了原因了吧
2016年05月22日 13点05分 6
level 1
caused by 后面的错误贴出来,估计是注入失败,bean配置有问题
2016年05月28日 03点05分 7
1