質問編集履歴

1

質問の一部文言・フォーマットを修正しました。

2024/04/13 14:48

投稿

naoto2013487
naoto2013487

スコア2

test CHANGED
File without changes
test CHANGED
@@ -21,14 +21,16 @@
21
21
  ```
22
22
 
23
23
  ### エラーメッセージ
24
- ```error
24
+
25
25
  ■画面上
26
+ ```
26
27
  Whitelabel Error Page
27
28
  This application has no explicit mapping for /error, so you are seeing this as a fallback.
28
29
  Sat Apr 13 14:12:04 UTC 2024
29
30
  There was an unexpected error (type=Internal Server Error, status=500).
30
- ---------------
31
+ ```
31
32
  ■コマンドライン
33
+ ```
32
34
  org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
33
35
  at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:342) ~[postgresql-42.6.0.jar!/:42.6.0]
34
36
  at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:54) ~[postgresql-42.6.0.jar!/:42.6.0]
@@ -61,13 +63,12 @@
61
63
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
62
64
  at
63
65
  ※以下略
64
-
65
66
  ```
66
67
 
67
68
  ### 該当のソースコード
68
69
 
69
- ```Java
70
70
  ■application.properties(プロジェクト内複数個所にこのファイルがあり、すべて修正しています)
71
+ ```
71
72
  spring.thymeleaf.prefix=classpath:/templates/
72
73
  spring.datasource.url=jdbc:postgresql:XXXXXXXXXX.ap-northeast-1.rds.amazonaws.com:5432/postgres
73
74
  spring.datasource.username=XXXXXXXX
@@ -76,9 +77,10 @@
76
77
  logging.level.org.springframework.web=debug
77
78
  logging.level.org.hibernate=error
78
79
  logging.file.name=hackathon-example.log
79
-
80
+ ```
80
81
  ■build.gradle
81
82
  dependencies に下記を記載しています。(一部抜粋)
83
+ ```
82
84
  implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:3.0.3'
83
85
  implementation 'org.springframework.boot:spring-boot-starter'
84
86
  runtimeOnly 'org.postgresql:postgresql'
@@ -93,10 +95,9 @@
93
95
  ##### 上記の詳細・結果
94
96
  ■RDSへの接続確認について
95
97
  EC2のセッションマネージャーを利用して、下記の通りRDSへの接続確認を行っています。
96
- ```ここに言語を入力
98
+ ```
97
99
  psql --host=DBエンドポイント --port=5432 --dbname=DB名 --username=ユーザ名
98
- ```
99
- ```password for user postgres:
100
+ password for user postgres:
100
101
  psql (15.5, server 15.4)
101
102
  SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off)
102
103
  Type "help" for help.