zoukankan      html  css  js  c++  java
  • port: ${SERVER_PORT:9190} #首先取环境变量,如果环境变量中没有,就取 9190 这个固定值

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': Initialization of bean failed; nested exception is java.lang.IllegalStateException: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1acf9e76 has been closed already

    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'eurekaInstanceConfigBean' defined in class path resource [org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration.class]: Unsatisfied dependency expressed through method 'eurekaInstanceConfigBean' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'inetUtils' defined in class path resource [org/springframework/cloud/commons/util/UtilAutoConfiguration.class]: Unsatisfied dependency expressed through method 'inetUtils' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'inetUtilsProperties' defined in class path resource [org/springframework/cloud/commons/util/UtilAutoConfiguration.class]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@6e6c3152 has been closed already

    org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
    ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: HikariDataSource HikariDataSource (HikariPool-1) has been closed.
    ### The error may exist in  Mapper.java (best guess)
    ### The error may involve  Mapper.findAllToE 
    ### The error occurred while executing a query
    ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: HikariDataSource HikariDataSource (HikariPool-1) has been closed.

    我使用的是一个纯  org.springframework.scheduling.annotation.Scheduled 的任务..但是每次执行都报错..

    解决办法:配置文件添加端口号

    如:

    server:
    port: ${SERVER_PORT:9190} #首先取环境变量,如果环境变量中没有,就取 9190 这个固定值

    我估计这个错误的原因是: 

    因为你的代码里没有controller,没有服务端口..springboot 以为不会被外部调用.而释放了资源..

  • 相关阅读:
    非域,非匿名用户访问远程企业服务的详细步骤
    调用远程的企业服务的安全问题
    未能加载文件或程序集“****”或它的某一个依赖项的一种情况
    XAMPP使用非80端口的安装配置修改
    Lucene 的存储结构概述
    .NET Framework 4.0 SDK的安装
    lucene 文件存储相关的几个类
    ASP.NET 状态服务 及 session丢失问题解决方案总结
    不安装.net framework框架运行.Net 程序的方法<收藏>
    net面试题集及答案
  • 原文地址:https://www.cnblogs.com/suizhikuo/p/11128749.html
Copyright © 2011-2022 走看看