账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    ssm项目结合druid配置,启动一直提示连接被拒绝
    27
    0

    ssm项目结合druid配置,启动一直提示连接被拒绝,莫名其妙出现了120.194.120.72这个ip和hisun-datasource.xml
    配置代码:

    springContent.xml

    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
        <property name="driverClassName" value="${db.driverClassName}" />
        <property name="url" value="${db.url}" />
        <property name="username" value="${db.username}" />
        <property name="password" value="${db.password}" />
        <property name="initialSize" value="3" />
        <property name="minIdle" value="3" />
        <property name="maxActive" value="20" />
        <property name="maxWait" value="60000" />
        <property name="filters" value="stat,wall" />
    </bean>
    <bean id="stat-filter" class="com.alibaba.druid.filter.stat.StatFilter">
        <property name="slowSqlMillis" value="3000" />
        <property name="logSlowSql" value="true" />
        <property name="mergeSql" value="true" />
    </bean>
    <bean id="wall-filter" class="com.alibaba.druid.wall.WallFilter">
        <property name="dbType" value="mysql" />
    </bean>

    web.xml

    <servlet>
      <servlet-name>DruidStatServlet</servlet-name>
      <servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class>
      <init-param>
        <param-name>loginUsername</param-name>
        <param-value>druid</param-value>
      </init-param>
      <init-param>
        <param-name>loginPassword</param-name>
        <param-value>druid</param-value>
      </init-param>
    </servlet>
    <servlet-mapping>
      <servlet-name>DruidStatServlet</servlet-name>
      <url-pattern>/sys/druid/*</url-pattern>
    </servlet-mapping>
    <filter>
      <filter-name>DruidWebStatFilter</filter-name>
      <filter-class>com.alibaba.druid.support.http.WebStatFilter</filter-class>
      <init-param>
        <param-name>exclusions</param-name>
        <param-value>*.js,*.css,*.jpg,*.png,*.ico,*.gif,/sys/druid/*</param-value>
      </init-param>
    </filter>
    <filter-mapping>
      <filter-name>DruidWebStatFilter</filter-name>
      <url-pattern>/*</url-pattern>
    </filter-mapping>

    数据库用户名和密码以及url都没有问题,但是项目启动一直报错,报错信息如下:

    ERROR [com.alibaba.druid.pool.DruidDataSource] - <init datasource error, url: jdbc:oracle:thin:@120.194.120.72:2127:orcl>

    java.sql.SQLRecoverableException: IO 错误: The Network Adapter could not establish the connection

    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:774)

    at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:688)

    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:39)

    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:691)

    at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:148)

    at com.alibaba.druid.filter.FilterAdapter.connection_connect(FilterAdapter.java:785)

    at com.alibaba.druid.filter.FilterEventAdapter.connection_connect(FilterEventAdapter.java:38)

    at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:142)

    at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:211)

    at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:142)

    at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1410)

    at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1464)

    at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:683)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke(Method.java:498)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1706)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1645)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)

    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)

    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)

    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)

    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)

    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)

    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1481)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1226)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)

    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)

    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)

    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)

    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)

    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)

    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1481)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1226)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)

    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)

    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)

    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)

    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)

    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:120)

    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678)

    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520)

    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446)

    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)

    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)

    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4859)

    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)

    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)

    at java.util.concurrent.FutureTask.run(FutureTask.java:266)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

    at java.lang.Thread.run(Thread.java:745)

    Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection

    at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:523)

    at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:521)

    at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:660)

    at oracle.net.ns.NSProtocol.connect(NSProtocol.java:286)

    at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1438)

    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:518)

    ... 60 more

    Caused by: java.io.IOException: Connection refused: connect, socket connect lapse 1246 ms. /120.194.120.72 2127 0 1 true

    at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:209)

    at oracle.net.nt.ConnOption.connect(ConnOption.java:161)

    at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:470)

    ... 65 more

    Caused by: java.net.ConnectException: Connection refused: connect

    at sun.nio.ch.Net.connect0(Native Method)

    at sun.nio.ch.Net.connect(Net.java:454)

    at sun.nio.ch.Net.connect(Net.java:446)

    at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:648)

    at java.nio.channels.SocketChannel.open(SocketChannel.java:189)

    at oracle.net.nt.TimeoutSocketChannel.<init>(TimeoutSocketChannel.java:81)

    at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:169)

    ... 67 more

    2018-09-30 18:16:45,957 ERROR [com.alibaba.druid.pool.DruidDataSource] - <{dataSource-1} init error>

    java.sql.SQLRecoverableException: IO 错误: The Network Adapter could not establish the connection

    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:774)

    at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:688)

    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:39)

    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:691)

    at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:148)

    at com.alibaba.druid.filter.FilterAdapter.connection_connect(FilterAdapter.java:785)

    at com.alibaba.druid.filter.FilterEventAdapter.connection_connect(FilterEventAdapter.java:38)

    at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:142)

    at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:211)

    at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:142)

    at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1410)

    at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1464)

    at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:683)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke(Method.java:498)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1706)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1645)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)

    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)

    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)

    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)

    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)

    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)

    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1481)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1226)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)

    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)

    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)

    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)

    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)

    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)

    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1481)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1226)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)

    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)

    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)

    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)

    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)

    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:120)

    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678)

    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520)

    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446)

    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)

    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)

    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4859)

    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)

    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)

    at java.util.concurrent.FutureTask.run(FutureTask.java:266)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

    at java.lang.Thread.run(Thread.java:745)

    Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection

    at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:523)

    at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:521)

    at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:660)

    at oracle.net.ns.NSProtocol.connect(NSProtocol.java:286)

    at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1438)

    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:518)

    ... 60 more

    Caused by: java.io.IOException: Connection refused: connect, socket connect lapse 1246 ms. /120.194.120.72 2127 0 1 true

    at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:209)

    at oracle.net.nt.ConnOption.connect(ConnOption.java:161)

    at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:470)

    ... 65 more

    Caused by: java.net.ConnectException: Connection refused: connect

    at sun.nio.ch.Net.connect0(Native Method)

    at sun.nio.ch.Net.connect(Net.java:454)

    at sun.nio.ch.Net.connect(Net.java:446)

    at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:648)

    at java.nio.channels.SocketChannel.open(SocketChannel.java:189)

    at oracle.net.nt.TimeoutSocketChannel.<init>(TimeoutSocketChannel.java:81)

    at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:169)

    ... 67 more

    2018-09-30 18:16:46,023 INFO [com.alibaba.druid.pool.DruidDataSource] - <{dataSource-1} inited>

    2018-09-30 18:16:46,024 WARN [org.springframework.web.context.support.AnnotationConfigWebApplicationContext] - <Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.mybatis.spring.mapper.MapperScannerConfigurer#0' defined in class path resource [hisun-datasource.xml]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [hisun-datasource.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [hisun-datasource.xml]: Invocation of init method failed; nested exception is java.sql.SQLRecoverableException: IO 错误: The Network Adapter could not establish the connection>

    2018-09-30 18:16:46,024 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@572055f7: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.event.internalEventListenerProcessor,org.springframework.context.event.internalEventListenerFactory,obanksAppConfig,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor,item,agreementController,authorizeController,batchController,indexController,roleController,userController,branchInfoServiceImpl,resourceSerivceImpl,roleResourceServiceImpl,roleServiceImpl,tellerInfoServiceImpl,tellerRoleServiceImpl,org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration,mvcPathMatcher,mvcViewResolver,mvcValidator,mvcUrlPathHelper,mvcResourceUrlProvider,defaultServletHandlerMapping,mvcContentNegotiationManager,mvcConversionService,simpleControllerHandlerAdapter,requestMappingHandlerMapping,viewControllerHandlerMapping,requestMappingHandlerAdapter,beanNameHandlerMapping,httpRequestHandlerAdapter,resourceHandlerMapping,mvcUriComponentsContributor,handlerExceptionResolver,getTilesViewResolver,getExceptionResolver,getTilesConfigurer,org.springframework.context.support.PropertySourcesPlaceholderConfigurer#0,org.springframework.transaction.config.internalTransactionalEventListenerFactory,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,dsConfig,mappingJackson2HttpMessageConverter,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0,messageSource,multipartResolver,org.springframework.context.annotation.internalAsyncAnnotationProcessor,org.springframework.context.annotation.internalScheduledAnnotationProcessor,dataSource,transactionManager,sqlSessionFactory,org.mybatis.spring.mapper.MapperScannerConfigurer#0,roleStatusList,druid-stat-interceptor,druid-stat-pointcut,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0]; root of factory hierarchy>

    2018-09-30 18:16:46,027 ERROR [org.springframework.web.context.ContextLoader] - <Context initialization failed>

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.mybatis.spring.mapper.MapperScannerConfigurer#0' defined in class path resource [hisun-datasource.xml]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [hisun-datasource.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [hisun-datasource.xml]: Invocation of init method failed; nested exception is java.sql.SQLRecoverableException: IO 错误: The Network Adapter could not establish the connection

    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)

    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)

    30-Sep-2018 18:16:46.101 严重 [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1481)

    30-Sep-2018 18:16:46.103 严重 [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [/mfs] startup failed due to previous errors

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1226)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)

    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)

    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)

    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)

    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)

    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:120)

    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678)

    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520)

    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446)

    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)

    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)

    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4859)

    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)

    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)

    at java.util.concurrent.FutureTask.run(FutureTask.java:266)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

    at java.lang.Thread.run(Thread.java:745)

    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [hisun-datasource.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [hisun-datasource.xml]: Invocation of init method failed; nested exception is java.sql.SQLRecoverableException: IO 错误: The Network Adapter could not establish the connection

    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)

    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1481)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1226)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)

    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)

    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)

    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)

    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)

    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)

    ... 24 more

    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [hisun-datasource.xml]: Invocation of init method failed; nested exception is java.sql.SQLRecoverableException: IO 错误: The Network Adapter could not establish the connection

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)

    1
    打赏
    收藏
    点击回答
        全部回答
    • 0
    更多回答
    扫一扫访问手机版

    回答动态

    师傅被妖怪抓走了:发布了悬赏问题火爆全网的“元宇宙”到底是什么?预计能赚取 1积分收益
    酒后略带风情:发布了悬赏问题Android内存中Graphics与Code占用过高预计能赚取 10积分收益
    扛起拖把扫天下:发布了悬赏问题typescript如何导出接口配置?求解,谢谢!预计能赚取 10积分收益
    发布了悬赏问题Vue 如何改变返回页面的路径?如让B页面只能返回到A页面.预计能赚取 11积分收益
    发布了悬赏问题vue H5移动端;底部bottom固定定位,安卓弹起键盘导致页面变形如何解决?预计能赚取 10积分收益
    发布了悬赏问题请问为什么tomcat8.5 GET请求中文正常,POST请求还需要设置UTF-8.预计能赚取 10积分收益
    发布了悬赏问题vue2.5+ts创建以及引入jq的方法预计能赚取 11积分收益
    情场浪女:发布了悬赏问题import ggplot时报错module 'pandas' has no attribute 'tslib'预计能赚取 10积分收益
    见心书画许老师18753375161:发布了悬赏问题echarts3 legend禁止点击事件,允许悬浮事件预计能赚取 11积分收益
    aa_92cb0bd09f:发布了悬赏问题codewar上的一个问题预计能赚取 11积分收益