0
2017-07-17 19:51:54,733 [localhost-startStop-1] <INFO> com.ifugle.rap.context.AppContextListener.logAppStartupInfo(AppContextListener.java:369) - runtime.maxMemory=1799M
2017-07-17 19:51:54,733 [localhost-startStop-1] <INFO> com.ifugle.rap.context.AppContextListener.logAppStartupInfo(AppContextListener.java:370) - runtime.totalMemory=739M
2017-07-17 19:51:54,733 [localhost-startStop-1] <INFO> com.ifugle.rap.context.AppContextListener.logAppStartupInfo(AppContextListener.java:371) - runtime.freeMemory=467M
2017-07-17 19:51:55,773 [localhost-startStop-1] <INFO> com.ifugle.rap.admin.rmi.ConnectorServer.init(ConnectorServer.java:94) - Create RMI registry on port 1099
2017-07-17 19:51:55,776 [localhost-startStop-1] <INFO> com.ifugle.rap.admin.rmi.ConnectorServer.init(ConnectorServer.java:171) - Create an RMI connector server: service:jmx:rmi://localhost:8007/jndi/rmi://localhost:1099/jmxrmi
2017-07-17 19:51:55,792 [localhost-startStop-1] <INFO> com.ifugle.rap.admin.rmi.ConnectorServer.start(ConnectorServer.java:189) - Start the RMI connector server
2017-07-17 19:51:55,839 [localhost-startStop-1] <INFO> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:305) - Root WebApplicationContext: initialization started
2017-07-17 19:51:55,951 [localhost-startStop-1] <INFO> org.springframework.context.support.AbstractApplicationContext.prepareRefresh(AbstractApplicationContext.java:578) - Refreshing Root WebApplicationContext: startup date [Mon Jul 17 19:51:55 CST 2017]; root of context hierarchy
2017-07-17 19:51:56,045 [localhost-startStop-1] <INFO> org.springframework.web.context.support.AnnotationConfigWebApplicationContext.loadBeanDefinitions(AnnotationConfigWebApplicationContext.java:227) - Successfully resolved class for [com.ifugle.rap.edu.common.config.EduServiceConfig]
2017-07-17 19:51:59,395 [localhost-startStop-1] <INFO> org.springframework.beans.factory.support.DefaultListableBeanFactory.registerBeanDefinition(DefaultListableBeanFactory.java:839) - Overriding bean definition for bean 'sqlSessionFactory' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=dsbServiceConfig; factoryMethodName=sqlSessionFactory; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [com/ifugle/rap/dsb/core/config/DsbServiceConfig.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=eduServiceConfig; factoryMethodName=sqlSessionFactory; initMethodName=null; destroyMethodName=(inferred); defined in com.ifugle.rap.edu.common.config.EduServiceConfig]
2017-07-17 19:51:59,395 [localhost-startStop-1] <INFO> org.springframework.beans.factory.support.DefaultListableBeanFactory.registerBeanDefinition(DefaultListableBeanFactory.java:839) - Overriding bean definition for bean 'transactionManager' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=dsbServiceConfig; factoryMethodName=transactionManager; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [com/ifugle/rap/dsb/core/config/DsbServiceConfig.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=eduServiceConfig; factoryMethodName=transactionManager; initMethodName=null; destroyMethodName=(inferred); defined in com.ifugle.rap.edu.common.config.EduServiceConfig]
2017-07-17 19:51:59,857 [localhost-startStop-1] <INFO> com.ifugle.sql.DataSourcePool.getJNDIDataSource(DataSourcePool.java:490) - com.alibaba.druid.pool.DruidDataSource lookup(jdbc/dingtax)
2017-07-17 19:52:00,226 [localhost-startStop-1] <INFO> com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:794) - {dataSource-1} inited

在使用tomcat7的时候一直卡在这里,但是使用tomcat8的时候就可以正常走走下去,求大神指教

druid的版本是1.0.31的
java配置文件

DruidDataSource dataSource = new DruidDataSource();

        String driverClassName = JdbcUtils.getDriverClassName(url);
        String dbType = JdbcUtils.getDbType(url, driverClassName);
        String salts = PwdUtil.getSalts(dbType, username);
        SecretKey secretKey = CipherUtil.getDESKey(salts);

        // 基本属性 url、user、password
        dataSource.setUrl(url);
        dataSource.setUsername(username);
        dataSource.setPassword(CipherUtil.decryptWithHeader(secretKey, password));

        // 配置初始化大小、最小、最大
        dataSource.setInitialSize(1); // DEFAULT = 0
        dataSource.setMinIdle(10); // DEFAULT = 0
        dataSource.setMaxActive(60); // DEFAULT = 8

        // 配置获取连接等待超时的时间
        dataSource.setMaxWait(12000); // DEFAULT = -1

        // 配置间隔多久才进行一次检测需要关闭的空闲连接,单位是毫秒
        dataSource.setTimeBetweenEvictionRunsMillis(50000); // DEFAULT(60秒) = 60 * 1000
        // 配置一旦重试多次失败后等待多久再继续重试连接,单位是毫秒
        dataSource.setTimeBetweenConnectErrorMillis(18000); // DEFAULT(30秒) = 30 * 1000

        // 配置一个连接在池中最小生存的时间,单位是毫秒
        dataSource.setMinEvictableIdleTimeMillis(300000); // DEFAULT(半小时) = 1000 * 60 * 30
        // 这个特性能解决 MySQL 服务器8小时关闭连接的问题
        dataSource.setMaxEvictableIdleTimeMillis(25200000); // DEFAULT(7小时) = 1000 * 60 * 60 * 7

撰写答案

相似问题