XEZBZ 2017-11-30 14:42 采纳率: 0%
浏览 2000

Tomcat启动时,卡在了spring创建bean的地方,请问该怎么解决?

项目整合了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>


菜鸟一枚,求教求教

  • 写回答

2条回答 默认 最新

  • devmiao 2017-11-30 15:57
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值