帮我看看SSH applicationContext.xml配置后 运行到这一步就不走了,然后提示报错超过45秒停止。
2011-4-29 10:32:20 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
0 main [INFO ] org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:189) :
Root WebApplicationContext: initialization started
31 main [INFO ] org.springframework.context.support.AbstractApplicationContext.prepareRefresh(AbstractApplicationContext.java:411) :
Refreshing org.springframework.web.context.support.XmlWebApplicationContext@4fc156: display name [Root WebApplicationContext]; startup date [Fri Apr 29 10:32:20 CST 2011]; root of context hierarchy
78 main [INFO ] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:323) :
Loading XML bean definitions from URL [file:/E:/Study/JAVA/IS/tools/IS_workSpace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/HouseRent/WEB-INF/classes/applicationContext.xml]
156 main [INFO ] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:323) :
Loading XML bean definitions from URL [file:/E:/Study/JAVA/IS/tools/IS_workSpace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/HouseRent/WEB-INF/classes/config/spring/applicationContext-common.xml]
219 main [INFO ] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:323) :
Loading XML bean definitions from URL [file:/E:/Study/JAVA/IS/tools/IS_workSpace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/HouseRent/WEB-INF/classes/config/spring/applicationContext-idm.xml]
219 main [INFO ] org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:426) :
Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@4fc156]: org.springframework.beans.factory.support.DefaultListableBeanFactory@d56b37
344 main [INFO ] org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:414) :
Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@d56b37: defining beans [loginAction,classInfoAction,exitSystemAction,auUserInfoAction,departmentAction,studentInfoAction,auUserInfoBs,classInfoBs,departmentBs,studentInfoBs,auUserInfoDao,baseDao,classInfoDao,departmentDao,studentInfoDao,transactionManager,transactionInterceptor,org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator#0,dataSource,sessionFactory]; root of factory hierarchy
391 main [INFO ] com.mchange.v2.log.MLog.<clinit>(MLog.java:80) :
MLog clients using log4j logging.
406 main [INFO ] com.mchange.v2.c3p0.C3P0Registry.banner(C3P0Registry.java:77) :
Initializing c3p0-0.9.0.4 [built 23-January-2006 22:20:29 -0500; debug? true; trace: 10]
469 main [INFO ] org.hibernate.cfg.Environment.<clinit>(Environment.java:514) :
Hibernate 3.2.7
469 main [INFO ] org.hibernate.cfg.Environment.<clinit>(Environment.java:547) :
hibernate.properties not found
469 main [INFO ] org.hibernate.cfg.Environment.buildBytecodeProvider(Environment.java:681) :
Bytecode provider name : cglib
484 main [INFO ] org.hibernate.cfg.Environment.<clinit>(Environment.java:598) :
using JDK 1.4 java.sql.Timestamp handling
641 main [INFO ] org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:300) :
Mapping class: com.zheng.rent.model.AuUserInfo -> au_user_info
672 main [INFO ] org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:300) :
Mapping class: com.zheng.rent.model.BedInfo -> au_bed_info
734 main [INFO ] org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:300) :
Mapping class: com.zheng.rent.model.BuildInfo -> au_build_info
750 main [INFO ] org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:300) :
Mapping class: com.zheng.rent.model.BuildTypeInfo -> au_buildtype_info
750 main [INFO ] org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:300) :
Mapping class: com.zheng.rent.model.ClassInfo -> au_class_info
750 main [INFO ] org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:300) :
Mapping class: com.zheng.rent.model.CostItem -> cost_item
766 main [INFO ] org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:300) :
Mapping class: com.zheng.rent.model.Department -> department
781 main [INFO ] org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:300) :
Mapping class: com.zheng.rent.model.EstateInfo -> au_estate_info
781 main [INFO ] org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:300) :
Mapping class: com.zheng.rent.model.RegInfo -> au_reg_info
781 main [INFO ] org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:300) :
Mapping class: com.zheng.rent.model.RoomCost -> room_cost
797 main [INFO ] org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:300) :
Mapping class: com.zheng.rent.model.RoomEstate -> room_estate
797 main [INFO ] org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:300) :
Mapping class: com.zheng.rent.model.RoomInfo -> au_room_info
812 main [INFO ] org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:300) :
Mapping class: com.zheng.rent.model.RoomTypeInfo -> au_roomtype_info
812 main [INFO ] org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:300) :
Mapping class: com.zheng.rent.model.StudentCost -> student_cost
812 main [INFO ] org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:300) :
Mapping class: com.zheng.rent.model.StudentInfo -> au_student_info
812 main [INFO ] org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2382) :
Mapping collection: com.zheng.rent.model.AuUserInfo.classInfos -> au_class_info
828 main [INFO ] org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2382) :
Mapping collection: com.zheng.rent.model.BedInfo.regInfos -> au_reg_info
828 main [INFO ] org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2382) :
Mapping collection: com.zheng.rent.model.BuildInfo.roomInfos -> au_room_info
828 main [INFO ] org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2382) :
Mapping collection: com.zheng.rent.model.BuildTypeInfo.buildInfos -> au_build_info
828 main [INFO ] org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2382) :
Mapping collection: com.zheng.rent.model.ClassInfo.studentInfos -> au_student_info
828 main [INFO ] org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2382) :
Mapping collection: com.zheng.rent.model.Department.classInfos -> au_class_info
828 main [INFO ] org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2382) :
Mapping collection: com.zheng.rent.model.RoomInfo.bedInfos -> au_bed_info
828 main [INFO ] org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2382) :
Mapping collection: com.zheng.rent.model.RoomInfo.estateInfos -> au_estate_info
828 main [INFO ] org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2382) :
Mapping collection: com.zheng.rent.model.RoomTypeInfo.roomInfos -> au_room_info
828 main [INFO ] org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2382) :
Mapping collection: com.zheng.rent.model.StudentInfo.regInfos -> au_reg_info
828 main [INFO ] org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:730) :
Building new Hibernate SessionFactory
828 main [INFO ] org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:72) :
Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
875 main [INFO ] com.mchange.v2.c3p0.PoolBackedDataSource.getPoolManager(PoolBackedDataSource.java:257) :
Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource@a23610[ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, description -> null, driverClass -> net.sourceforge.jtds.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> a23610, idleConnectionTestPeriod -> -1, initialPoolSize -> 1, jdbcUrl -> jdbc:jtds:sqlserver://localhost:1433/camis, loginTimeout -> 0, maxIdleTime -> 20, maxPoolSize -> 500, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 1, numHelperThreads -> 3, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ]

解决方案 »

  1.   

    applicationContext.xml配置是这样的<?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    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-2.5.xsd"> <!-- Action类 -->
    <bean id="loginAction"
    class="com.zheng.rent.action.LoginAction" scope="prototype">
    <!-- 依赖注入 -->
    <property name="auUserInfoBs" ref="auUserInfoBs" />
    </bean>

    <bean id="classInfoAction"
    class="com.zheng.rent.action.ClassInfoAction" scope="prototype">
        <property name="classInfoBs" ref="classInfoBs" />
    </bean> <bean id="exitSystemAction"
    class="com.zheng.rent.action.ExitSystemAction"
    scope="prototype">
    <property name="auUserInfoBs" ref="auUserInfoBs" />
    </bean> <bean id="auUserInfoAction"
    class="com.zheng.rent.action.AuUserInfoAction"
    scope="prototype">
    <property name="auUserInfoBs" ref="auUserInfoBs" />
    </bean>

    <bean id="departmentAction"
    class="com.zheng.rent.action.DepartmentAction"
    scope="prototype">
    <property name="departmentBs" ref="departmentBs" />
    </bean>

    <bean id="studentInfoAction"
    class="com.zheng.rent.action.StudentInfoAction"
    scope="prototype">
    <property name="studentInfoBs" ref="studentInfoBs" />
    </bean>



    <!-- Service类 -->
    <bean id="auUserInfoBs"
    class="com.zheng.rent.service.impl.AuUserInfoBs">
    <property name="auUserInfoDao" ref="auUserInfoDao" />
    </bean>

    <bean id="classInfoBs"
    class="com.zheng.rent.service.impl.ClassInfoBs">
    <property name="classInfoDao" ref="classInfoDao"/>
    </bean>

    <bean id="departmentBs"
    class="com.zheng.rent.service.impl.DepartmentBs">
    <property name="departmentDao" ref="departmentDao" />
    </bean>

    <bean id="studentInfoBs"
    class="com.zheng.rent.service.impl.StudentInfoBs">
    <property name="studentInfoDao" ref="studentInfoDao" />
    </bean>

    <!-- DAO类 -->
    <bean id="auUserInfoDao"
    class="com.zheng.rent.dao.impl.AuUserInfoDao" parent="baseDao" >
    <property name="sessionFactory" ref="sessionFactory" />
    </bean>
    <bean id="baseDao" class="com.zheng.rent.dao.impl.BaseDao">
    <property name="sessionFactory" ref="sessionFactory" />
    </bean>

    <bean id="classInfoDao"
    class="com.zheng.rent.dao.impl.ClassInfoDao">
    <property name="sessionFactory" ref="sessionFactory"/>
    </bean>

    <bean id="departmentDao"
    class="com.zheng.rent.dao.impl.DepartmentDao">
    <property name="sessionFactory" ref="sessionFactory" />
    </bean>

    <bean id="studentInfoDao"
    class="com.zheng.rent.dao.impl.StudentInfoDao">
    <property name="sessionFactory" ref="sessionFactory" />
    </bean>

    <!-- 公共类 -->
    <bean id="transactionManager"
    class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory" ref="sessionFactory" />
    </bean> <bean id="transactionInterceptor"
    class="org.springframework.transaction.interceptor.TransactionInterceptor">
    <!-- 事务拦截器bean需要依赖注入一个事务管理器  -->
    <property name="transactionManager" ref="transactionManager" />
    <property name="transactionAttributes">
    <!-- 下面定义事务传播属性 -->
    <props>
    <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
    <prop key="*">PROPAGATION_REQUIRED</prop>
    </props>
    </property>
    </bean> <!-- 定义BeanNameAutoProxyCreator -->
    <bean
    class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
    <!--  指定对满足哪些bean name的bean自动生成业务代理 -->
    <property name="beanNames">
    <!-- 下面是所有需要自动创建事务代理的bean -->
    <list>
    <value>*Bs</value>
    </list>
    <!-- 此处可增加其他需要自动创建事务代理的bean -->
    </property>
    <!-- 下面定义BeanNameAutoProxyCreator所需的事务拦截器-->
    <property name="interceptorNames">
    <list>
    <!-- 此处可增加其他新的Interceptor -->
    <value>transactionInterceptor</value>
    </list>
    </property>
    </bean> <!-- 定义数据源Bean 使用C3P0数据源实现 -->
    <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close" dependency-check="none">
            <property name="driverClass">
                <value>net.sourceforge.jtds.jdbc.Driver</value>
            </property>
            <property name="jdbcUrl">
               <value>jdbc:jtds:sqlserver://localhost:1433/camis</value>
            </property>
            <property name="user">
               <value>sa</value>
            </property>
            <property name="password">
               <value>123</value>
            </property>
            <!-- 指定连接数据库连接池的最大连接数 -->
    <property name="maxPoolSize" value="500" />
    <!-- 指定连接数据库连接池的最小连接数 -->
    <property name="minPoolSize" value="1" />
    <!-- 指定连接数据库连接池的初始化连接数 -->
    <property name="initialPoolSize" value="1" />
    <!-- 指定连接数据库连接池的连接的最大空闲时间 -->
    <property name="maxIdleTime" value="20" />
      </bean> <!--定义了Hibernate的SessionFactory -->
    <bean id="sessionFactory"
    class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="dataSource" ref="dataSource" />
    <property name="mappingLocations">
    <list>
    <value>
    classpath:/com/zheng/rent/**/model/*.hbm.xml
    </value>
    </list>
    </property>
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">
    org.hibernate.dialect.MySQLDialect
    </prop>
    <prop key="hibernate.show_sql">true</prop>
    <prop key="hibernate.format_sql">true</prop>
    <prop key="hibernate.use_sql_comments">true</prop>
    <prop key="hibernate.hbm2ddl.auto">update</prop>
    <prop key="hibernate.jdbc.batch_size">20</prop>
    </props>
    </property>
    </bean>
    </beans>
      

  2.   

    强调一点就是 我把配置改成mysql ,那就没问题,我现在是想用sqlserver2005 <bean id="dataSource"
    class="com.mchange.v2.c3p0.ComboPooledDataSource"
    destroy-method="close">
    <!-- 指定连接数据库的驱动 -->
    <property name="driverClass" value="com.mysql.jdbc.Driver" />
    <!-- 指定连接数据库的URL -->
    <property name="jdbcUrl"
    value="jdbc:mysql://localhost:3306/camis?characterEncoding=utf-8" />
    <!-- 指定连接数据库的用户名 -->
    <property name="user" value="root" />
    <!-- 指定连接数据库的密码 -->
    <property name="password" value="root" />
    <!-- 指定连接数据库连接池的最大连接数 -->
    <property name="maxPoolSize" value="500" />
    <!-- 指定连接数据库连接池的最小连接数 -->
    <property name="minPoolSize" value="1" />
    <!-- 指定连接数据库连接池的初始化连接数 -->
    <property name="initialPoolSize" value="1" />
    <!-- 指定连接数据库连接池的连接的最大空闲时间 -->
    <property name="maxIdleTime" value="20" />
    </bean>
    这样配置就能运行
      

  3.   

    连sqlserver2005时怎么配的,代码贴出来看看
      

  4.   

    连接 sql2005  上面贴出来了的 
    <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close" dependency-check="none">
            <property name="driverClass">
                <value>net.sourceforge.jtds.jdbc.Driver</value>
            </property>
            <property name="jdbcUrl">
               <value>jdbc:jtds:sqlserver://localhost:1433/camis</value>
            </property>
            <property name="user">
               <value>sa</value>
            </property>
            <property name="password">
               <value>123</value>
            </property>
            <!-- 指定连接数据库连接池的最大连接数 -->
            <property name="maxPoolSize" value="500" />
            <!-- 指定连接数据库连接池的最小连接数 -->
            <property name="minPoolSize" value="1" />
            <!-- 指定连接数据库连接池的初始化连接数 -->
            <property name="initialPoolSize" value="1" />
            <!-- 指定连接数据库连接池的连接的最大空闲时间 -->
            <property name="maxIdleTime" value="20" />
      </bean>
      

  5.   

     <prop key="hibernate.dialect">
                        org.hibernate.dialect.MySQLDialect
                    </prop>
    方言改成SqlServer的
      

  6.   


    改了以后还是不行
    <prop key="hibernate.dialect">
    org.hibernate.dialect.SQLServerDialect
    </prop>
      

  7.   

    遇到过相同的问题,把asm.jar和cglib-2.1.3.jar删除了就好了
    可能和c3p0包有冲突
      

  8.   

    报错超过45秒停止,你把Tomcat的开始时间和停止时间设置一下就OK了。
      

  9.   

            <property name="driverClass">
                <value>net.sourceforge.jtds.jdbc.Driver</value>
            </property>
            <property name="jdbcUrl">
               <value>jdbc:jtds:sqlserver://localhost:1433/camis</value>
            </property>
    改成
            <property name="driverClass">
                <value>com.microsoft.sqlserver.jdbc.SQLServerDriver</value>
            </property>
            <property name="jdbcUrl">
               <value>jdbc:sqlserver://localhost:1433;databaseName=camis</value>
            </property>
          
      

  10.   

    数据库不同的话,hibernate的映射文件可能不同.
      

  11.   

    会不会是  
    <bean id="DataSource"
    class="org.apache.commons.dbcp.BasicDataSource">
    <property name="driverClassName"
    value="com.microsoft.sqlserver.jdbc.SQLServerDriver">
    </property>
    <property name="url"
    value="jdbc:sqlserver://localhost:1433;databaseName=camis">
    </property>
    <property name="username" value="sa"></property>
    <property name="password" value="123"></property>
    </bean>
      

  12.   


    不对, 你这有报错了   Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' defined in URL