스프링 부트 어플리케이션이 'Hikari-Pool-1 - Starting...'에서 정지된다.."
Postgre에 연결된 Spring Boot 응용 프로그램을 실행하려고 합니다.SQL 데이터베이스다만, 히카리 접속 풀의 초기화에 대해서는, 막혀 버리기만 할 뿐, 아무 일도 일어나지 않습니다. HikariPool-1 - Starting...
로그에 표시되고 나서 아무 일도 일어나지 않습니다.
로그:
2018-07-09 15:32:48.475 INFO 21920 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@68999068: startup date [Mon Jul 09 15:32:48 ALMT 2018]; root of context hierarchy
2018-07-09 15:32:48.736 INFO 21920 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$1b7bd026] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.0.3.RELEASE)
2018-07-09 15:32:49.207 INFO 21920 --- [ main] o.paperplane.todoapp.TodoappApplication : No active profile set, falling back to default profiles: default
2018-07-09 15:32:49.217 INFO 21920 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@1b410b60: startup date [Mon Jul 09 15:32:49 ALMT 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@68999068
2018-07-09 15:32:49.763 INFO 21920 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean 'dataSource' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Dbcp2; factoryMethodName=dataSource; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Dbcp2.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari; factoryMethodName=dataSource; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]]
2018-07-09 15:32:50.046 INFO 21920 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean 'dataSource' with a different definition: replacing [Root bean: class [null]; scope=refresh; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=false; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari; factoryMethodName=dataSource; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]] with [Root bean: class [org.springframework.aop.scope.ScopedProxyFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in BeanDefinition defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]]
2018-07-09 15:32:50.212 INFO 21920 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=2203ab9b-5bb0-34f2-b496-2cbda1e334a2
2018-07-09 15:32:50.342 INFO 21920 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$ff61cd29] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-07-09 15:32:50.380 INFO 21920 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration' of type [org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration$$EnhancerBySpringCGLIB$$980f9563] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-07-09 15:32:50.389 INFO 21920 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'objectPostProcessor' of type [org.springframework.security.config.annotation.configuration.AutowireBeanFactoryObjectPostProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-07-09 15:32:50.393 INFO 21920 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@309028af' of type [org.springframework.security.oauth2.provider.expression.OAuth2MethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-07-09 15:32:50.397 INFO 21920 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration' of type [org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration$$EnhancerBySpringCGLIB$$bce43815] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-07-09 15:32:50.404 INFO 21920 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'methodSecurityMetadataSource' of type [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-07-09 15:32:50.424 INFO 21920 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$1b7bd026] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-07-09 15:32:50.692 INFO 21920 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2018-07-09 15:32:50.710 INFO 21920 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-07-09 15:32:50.710 INFO 21920 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.31
2018-07-09 15:32:50.714 INFO 21920 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jdk1.8.0_151\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Intel\Shared Files\cpp\bin\Intel64;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\7-Zip;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;D:\node_js\;C:\Program Files\Git\cmd;C:\WINDOWS\System32\OpenSSH\;C:\Users\User\AppData\Local\Microsoft\WindowsApps;C:\Users\User\AppData\Local\GitHubDesktop\bin;C:\Users\User\AppData\Roaming\npm;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;;.]
2018-07-09 15:32:50.817 INFO 21920 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-07-09 15:32:50.817 INFO 21920 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1600 ms
2018-07-09 15:32:51.784 INFO 21920 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-07-09 15:32:51.785 INFO 21920 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-07-09 15:32:51.785 INFO 21920 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-07-09 15:32:51.785 INFO 21920 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-07-09 15:32:51.785 INFO 21920 --- [ost-startStop-1] .s.DelegatingFilterProxyRegistrationBean : Mapping filter: 'springSecurityFilterChain' to: [/*]
2018-07-09 15:32:51.785 INFO 21920 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpTraceFilter' to: [/*]
2018-07-09 15:32:51.786 INFO 21920 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'webMvcMetricsFilter' to: [/*]
2018-07-09 15:32:51.786 INFO 21920 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2018-07-09 15:32:51.885 INFO 21920 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
나의pom.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.paperplane</groupId>
<artifactId>todoapp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>todoapp</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Finchley.RELEASE</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-oauth2</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.3</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
나의apllication.properties
:
spring.datasource.url=jdbc:postgresql://127.0.0.1:55491/TodoAppDatabase
spring.datasource.username=admin
spring.datasource.password=root
spring.datasource.hikari.connection-timeout=10000
spring.datasource.hikari.driver-class-name=org.postgresql.Driver
spring.datasource.hikari.maximum-pool-size=100
spring.data.jpa.repositories.enabled=true
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto = update
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQL94Dialect
spring.jpa.properties.hibernate.cache.use_query_cache=true
spring.jpa.properties.hibernate.connection.provider_class=com.zaxxer.hikari.hibernate.HikariConnectionProvider
어떻게 하면 이 문제를 극복할 수 있을까요?
보통 postgresql 포트는 5432이므로 55491로 설정했을 것입니다.
postgresql 클라이언트를 통해 다시 한 번 확인합니다.psql -h 127.0.0.1 -p 55491 -d TodoAppDatabase -U admin
마지막으로 HikariCP를 DEBUG 모드로 하면 HikariCP가 사용하는 파라미터를 확인할 수 있습니다.
properties 파일이 실제로 application.properties인 경우 스프링 부트에서는 application.properties만 자동으로 선택되기 때문에 이 문제가 발생할 수 있습니다.
application.properties를 다음과 같이 변경하면 정상적으로 동작합니다.
spring.datasource.url=jdbc:postgresql://localhost:5432/<dbName>
또한 [Fixed Port Number]박스가 오프인 것을 확인합니다.pgAdmin Configuration BOX 에서는 스크린샷을 참조해 주세요.
제 경우 spring.datasource 입니다.hikari.initializationFailTimeout이 3600000(1시간)이라는 매우 높은 값으로 설정되었습니다.그 자체로는 잘못된 구성이 아니었지만, 앱이 부팅 시 정지되어 있었기 때문에 실제 문제를 숨겼습니다.
이 값을 조정하면 스택트레이스를 알기 쉽게 할 수 있게 되어 이 경우 jHipster를 통해 얻을 수 있는 기본 MariaDB 드라이버 구성을 사용할 수 없게 되었습니다.
지금까지 AWS EC2의 MySQL8과 Ubuntu 20에서만 볼 수 있었던 매우 이상한 문제입니다.도커를 통해 Ubuntu와 MySQL8을 문제없이 로컬로 실행하고 있습니다.
DB에 연결하지 못할 수 있습니다. DB 인스턴스를 다시 시작하고 액세스할 수 있는지 확인하십시오.
jar 파일을 실행할 때 다음 매개 변수를 전달해 보십시오.
-Djava.security.egd=file:/dev/../dev/urandom
제 경우 네트워크 접속에 문제가 있었습니다.이 문제가 발생했을 경우는, 설정이 끝난 서버에 액세스 할 수 있는 것을 확인해 주세요.
telnet host 5432
를 사용하여 DB 서버로의 경로가 존재하는지 여부를 확인할 수 있습니다.
제 경우(Windows 10)에는 다음 세 단계를 거쳤습니다.
- postgresql 서비스 실행 중지
- 관리자 권한으로 명령 프롬프트를 열고 포트 5432에서
서비스를 종료합니다.
- 서비스 창에서 postgresql 서비스를 재시작합니다.
그리고 넌 잘해.
도 같은 이 요.AUTO_SERVER=true
application.properties 파일에서 행을 지정하기 때문에 삭제 후 응용 프로그램은 정상적으로 실행됩니다.
를제 remove remove remove를 remove remove 를 remove 。AUTO_SERVER=true
#spring.datasource.url=jdbc:... AUTO_SERVER=true
이 경우 터미널에서와 같이 다른 소스에서 데이터베이스에 액세스하는 기능이 손실됩니다. 즉, 앱 실행 중(데이터베이스 사용 중)에는 터미널에서 데이터베이스에 액세스할 수 없습니다.
, AUTO_SERVER=true
PC를 재기동해 주세요.이것에 의해, 데이타베이스가 재기동해, 문제가 해결될 가능성이 있습니다(이것은 장난이 아닙니다).
언급URL : https://stackoverflow.com/questions/51242938/spring-boot-application-gets-stuck-on-hikari-pool-1-starting
'source' 카테고리의 다른 글
관리화면 서브메뉴 항목에 커스텀 HTML 클래스 이름을 추가하는 방법 (0) | 2023.02.14 |
---|---|
HTML 웹 워커와 Jquery Ajax 호출 (0) | 2023.02.14 |
OPENJSON이 SQL Server에서 작동하지 않습니까? (0) | 2023.02.14 |
Wordpress : 구글 임베디드 맵 iframe에서 확대/축소 수준을 설정해야 합니다. (0) | 2023.02.14 |
woocommerce 테마에서 제품 페이지를 수정할 위치 (0) | 2023.02.10 |