项目整合了struts2,spring,hibernate,最近启动项目的时候经常跑
不起来,但有时又可以,可是今晚就老是跑不起来,下面是最后的几行日志,求大神赐教:
十一月 30, 2017 10:35:13 下午 org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
2017-11-30 22:35:13,935 INFO (org.springframework.web.context.ContextLoader:187) - Root WebApplicationContext: initialization started
2017-11-30 22:35:14,208 INFO (org.springframework.web.context.support.XmlWebApplicationContext:456) - Refreshing Root WebApplicationContext: startup date [Thu Nov 30 22:35:14 CST 2017]; root of context hierarchy
2017-11-30 22:35:14,567 INFO (org.springframework.beans.factory.xml.XmlBeanDefinitionReader:315) - Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
2017-11-30 22:35:15,601 INFO (org.springframework.beans.factory.support.DefaultListableBeanFactory:555) - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@5bed0458: defining beans [dataSource,sessionFactory,HibernateConfig,baseDao,loginService,goodService,wsMsgService,LoginAction,WsMsgAction,GoodAction]; root of factory hierarchy
我的spring配置文件如下:
<?xml version="1.0" encoding="UTF-8"?>
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<!-- <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://localhost:3506/xmesdb</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value>123456</value>
</property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource"/>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.current_session_context_class">thread</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com/model/User.hbm.xml</value>
<value>com/model/WsMsg.hbm.xml</value>
<value>com/model/GoodMobilePhone.hbm.xml</value>
<value>com/model/GoodBook.hbm.xml</value>
<value>com/model/GoodComputer.hbm.xml</value>
<value>com/model/GoodMobike.hbm.xml</value>
</list>
</property>
</bean>
<bean id="HibernateConfig" class="com.hibernate.HibernateConfig">
<property name="sessionFactory">
<ref local="sessionFactory"/>
</property>
</bean>
<bean id="baseDao" class="com.dao.BaseDaoImpl" scope="prototype">
<property name="sessionFactory">
<ref local="sessionFactory"/>
</property>
</bean>
<bean id="loginService" class="com.service.impl.LoginServiceImpl" scope="prototype">
<property name="baseDao">
<ref local="baseDao"/>
</property>
</bean>
<bean id='goodService' class="com.service.impl.GoodServiceImpl" scope="prototype">
<property name="baseDao">
<ref local="baseDao"/>
</property>
</bean>
<bean id="wsMsgService" class="com.webSocket.Service.impl.WsMsgServiceImpl" scope="prototype">
</bean>
<bean id="LoginAction" class="com.action.LoginAction" scope="prototype">
<property name="baseDao" ref="baseDao"></property>
<property name="loginService" ref="loginService"></property>
<property name="wsMsgService" ref="wsMsgService"></property>
</bean>
<bean id="WsMsgAction" class="com.action.WsMsgAction" scope="prototype">
<property name="wsMsgService" ref="wsMsgService"></property>
</bean>
<bean id="GoodAction" class="com.action.GoodAction" scope="prototype">
<property name="goodService" ref="goodService"></property>
</bean>
菜鸟一枚,求教求教