From 9b2faa36b4fb42b7d3c3f5ba409722414c036bd3 Mon Sep 17 00:00:00 2001 From: Rinjae Date: Tue, 28 Oct 2025 16:35:19 +0900 Subject: [PATCH 01/26] =?UTF-8?q?=EB=94=94=EB=B2=84=EA=B7=B8=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kjb-docs/README.md | 15 +++++- src/main/resources/application-kjb_rinjae.yml | 51 +++++++++++++++++++ src/main/resources/logback-debug.xml | 46 +++++++++++++++++ src/main/resources/logback-rinjae.xml | 49 ++++++++++++++++++ src/main/resources/logback-spring.xml | 2 +- 5 files changed, 160 insertions(+), 3 deletions(-) create mode 100644 src/main/resources/application-kjb_rinjae.yml create mode 100644 src/main/resources/logback-rinjae.xml diff --git a/kjb-docs/README.md b/kjb-docs/README.md index 0aa5631..1ecd3c0 100644 --- a/kjb-docs/README.md +++ b/kjb-docs/README.md @@ -8,7 +8,18 @@ ### 디비 접속 방법 Direct -> JNDI 로 변경 - 은행 내부 환경에선 모두 JNDI 사용하기 때문에 서버환경에서 동작하는 profile 내 application.yaml 에서 디비 접속 정보 삭제 -## 긴급 로깅이 필요할 경우 JVM 파라미터 추가 +## 서버 운영 중 긴급 로깅이 필요할 경우 JVM 파라미터 추가 하여 재기동 +- DEBUG 레벨 root 로그 / debug.log 로 파일 작성 ``` --Dlogback.configurationFile=classpath:logback-debug.xml +-Dlogging.config=classpath:logback-debug.xml +``` + +## 참고자료 +### 개발용 파라미터 +``` +-Dlogging.config=classpath:logback-rinjae.xml +-Dinst.Name=devSvr98 +-Duser.language=en +-Duser.country=US +-Dkjb_safedb.mode=fake ``` \ No newline at end of file diff --git a/src/main/resources/application-kjb_rinjae.yml b/src/main/resources/application-kjb_rinjae.yml new file mode 100644 index 0000000..51ba578 --- /dev/null +++ b/src/main/resources/application-kjb_rinjae.yml @@ -0,0 +1,51 @@ +server.port: '30200' + +spring: + jta: + enabled: true + jpa: + properties: + hibernate: + show_sql: false + format_sql: true + use_sql_comments: true + devtools: + restart: + enabled: false + livereload: + enabled: true + thymeleaf: + cache: false + +ems: + datasource: + jdbc-url: jdbc:oracle:thin:@//192.168.240.177:1599/DAPM +# jdbc-url: jdbc:oracle:thin:@//10.14.8.30:11521/ELINKDB + driver-class-name: oracle.jdbc.OracleDriver + username: EMSAPP + password: EMSAPP123! + + +gateway: + datasource: + jdbc-url: jdbc:oracle:thin:@//192.168.240.177:1599/DAPM +# jdbc-url: jdbc:oracle:thin:@//10.14.8.30:11521/ELINKDB + driver-class-name: oracle.jdbc.OracleDriver + username: AGWAPP + password: AGWAPP123! + +portal: + logging: + log-path: C:\eactive\logs + auth-virtual-code: 654321 + +proxy: + targets: + stg: http://localhost:10000/monitoring + prod: http://localhost:10000/monitoring + + # stg: http://inter-ndapiap01.k-bank.com:7090/monitoring + # prod: http://inter-ndapiap01.k-bank.com:7090/monitoring + timeout: + connect: 5000 + read: 5000 diff --git a/src/main/resources/logback-debug.xml b/src/main/resources/logback-debug.xml index d3c786a..64a003f 100644 --- a/src/main/resources/logback-debug.xml +++ b/src/main/resources/logback-debug.xml @@ -1,12 +1,39 @@ + + + + + ${PATTERN_DATE} + + + + ${LOG_PATH}/root.log + + ${LOG_PATH}/backup/root.%d{yyyy-MM-dd}.log + 30 + + ${PATTERN} + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + ${LOG_PATH}/hibernate.log + + ${LOG_PATH}/backup/hibernate.%d{yyyy-MM-dd}.log + 7 + + + ${PATTERN} + + + ${LOG_PATH}/debug.log @@ -18,4 +45,23 @@ %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/logback-rinjae.xml b/src/main/resources/logback-rinjae.xml new file mode 100644 index 0000000..99f8815 --- /dev/null +++ b/src/main/resources/logback-rinjae.xml @@ -0,0 +1,49 @@ + + + + + + + ${PATTERN_DATE} + + + + ${LOG_PATH}/root.log + + ${LOG_PATH}/backup/root.%d{yyyy-MM-dd}.log + 30 + + ${PATTERN} + + + + ${LOG_PATH}/hibernate.log + + ${LOG_PATH}/backup/hibernate.%d{yyyy-MM-dd}.log + 7 + + + ${PATTERN} + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index 47d84e7..5698dc6 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -102,7 +102,7 @@ - > + From b70c45444dec5ead0d733a5263ed44e5dd058047 Mon Sep 17 00:00:00 2001 From: Rinjae Date: Tue, 28 Oct 2025 16:42:26 +0900 Subject: [PATCH 02/26] =?UTF-8?q?weblogic.xml=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/logback-debug.xml | 20 ++++---------------- src/main/resources/weblogic.xml | 13 +++++++------ 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/main/resources/logback-debug.xml b/src/main/resources/logback-debug.xml index 64a003f..6622e1d 100644 --- a/src/main/resources/logback-debug.xml +++ b/src/main/resources/logback-debug.xml @@ -9,9 +9,9 @@ - ${LOG_PATH}/root.log + ${LOG_PATH}/debug.log - ${LOG_PATH}/backup/root.%d{yyyy-MM-dd}.log + ${LOG_PATH}/backup/debug.%d{yyyy-MM-dd}.log 30 ${PATTERN} @@ -24,9 +24,9 @@ - ${LOG_PATH}/hibernate.log + ${LOG_PATH}/debug-hibernate.log - ${LOG_PATH}/backup/hibernate.%d{yyyy-MM-dd}.log + ${LOG_PATH}/backup/debug-hibernate.%d{yyyy-MM-dd}.log 7 @@ -35,18 +35,6 @@ - - ${LOG_PATH}/debug.log - - ${LOG_PATH}/backup/debug.%d{yyyy-MM-dd}.log - 7 - - - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n - - - - diff --git a/src/main/resources/weblogic.xml b/src/main/resources/weblogic.xml index 7784cb1..b8ffd33 100644 --- a/src/main/resources/weblogic.xml +++ b/src/main/resources/weblogic.xml @@ -7,12 +7,13 @@ / - - org.slf4j.* - ch.qos.logback.* - org.apache.log4j.* - org.apache.commons.logging.* - + + + + + + + true From 5c0deb92b45728e4f61acb746a54010ff72a6eba Mon Sep 17 00:00:00 2001 From: Rinjae Date: Tue, 28 Oct 2025 16:58:45 +0900 Subject: [PATCH 03/26] =?UTF-8?q?=EC=98=A4=ED=83=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/logback-debug.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/resources/logback-debug.xml b/src/main/resources/logback-debug.xml index 6622e1d..b1917ab 100644 --- a/src/main/resources/logback-debug.xml +++ b/src/main/resources/logback-debug.xml @@ -4,6 +4,7 @@ + ${PATTERN_DATE} @@ -17,11 +18,11 @@ ${PATTERN} - + %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n - + ${LOG_PATH}/debug-hibernate.log From 684462880bfad0fea6cc82315a29a18a5bbfdc0f Mon Sep 17 00:00:00 2001 From: Rinjae Date: Tue, 28 Oct 2025 17:20:41 +0900 Subject: [PATCH 04/26] =?UTF-8?q?=EB=A1=9C=EA=B7=B8=20=EB=AC=B8=EC=A0=9C?= =?UTF-8?q?=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/logback-debug.xml | 2 +- src/main/resources/weblogic.xml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/resources/logback-debug.xml b/src/main/resources/logback-debug.xml index b1917ab..abfa1c3 100644 --- a/src/main/resources/logback-debug.xml +++ b/src/main/resources/logback-debug.xml @@ -38,7 +38,7 @@ - + diff --git a/src/main/resources/weblogic.xml b/src/main/resources/weblogic.xml index b8ffd33..7b95551 100644 --- a/src/main/resources/weblogic.xml +++ b/src/main/resources/weblogic.xml @@ -7,13 +7,13 @@ / - - - - - - - true + + org.slf4j.* + ch.qos.logback.* + org.apache.log4j.* + org.apache.commons.logging.* + + From ac058825d898eaf4d05e8c06ed4ce888c297b228 Mon Sep 17 00:00:00 2001 From: Rinjae Date: Tue, 28 Oct 2025 18:53:37 +0900 Subject: [PATCH 05/26] =?UTF-8?q?DB=20=EA=B2=80=EC=A6=9D=20profile=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../spring/DatabaseSessionVerifier.java | 97 +++++++++++++++++++ src/main/resources/logback-debug.xml | 15 +++ src/main/resources/logback-rinjae.xml | 14 +++ 3 files changed, 126 insertions(+) create mode 100644 src/main/java/com/eactive/apim/portal/spring/DatabaseSessionVerifier.java diff --git a/src/main/java/com/eactive/apim/portal/spring/DatabaseSessionVerifier.java b/src/main/java/com/eactive/apim/portal/spring/DatabaseSessionVerifier.java new file mode 100644 index 0000000..34bfc6b --- /dev/null +++ b/src/main/java/com/eactive/apim/portal/spring/DatabaseSessionVerifier.java @@ -0,0 +1,97 @@ +package com.eactive.apim.portal.spring; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.SmartInitializingSingleton; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +import javax.sql.DataSource; +import java.sql.*; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; + +@Configuration +@Profile("db_check") +@Slf4j +public class DatabaseSessionVerifier implements SmartInitializingSingleton { + private final DataSource emsDataSource; + + + public DatabaseSessionVerifier(DataSource emsDataSource) { + this.emsDataSource = emsDataSource; + } + + + @Override + public void afterSingletonsInstantiated() { + log.info("DB 검증 작업 시작 - {}", now()); + log.info("---------------------------------------------------"); + + log.info("1. 커넥션 확인"); + try (Connection conn = emsDataSource.getConnection()) { + try (PreparedStatement statement = conn.prepareStatement("select 1 from dual")) { + ResultSet rs = statement.executeQuery(); + if (rs.next()) { + log.info("DB 커넥션 확인됨"); + } + } + + log.info("\n2. Table 권한 확인 - {}", now()); + Map> grantTables = this.printTablePrivileges(conn); + + + log.info("\n3. PTL_PROPERTY 테이블 확인 - {}", now()); + if (!grantTables.containsKey("PTL_PROPERTY")) { + log.info("PTL_PROPERTY 테이블 확인 안됨. ROLE 재로딩 시도"); + + try (Statement stmt = conn.createStatement()) { + stmt.execute("SET ROLE_RL_EMS_ALL"); + } + + this.printTablePrivileges(conn); + + throw new InterruptedException("DB 검증 실패로 강제 종료"); + } else { + log.info("PTL_PROPERTY 테이블 확인 됨."); + } + + log.info("검증 작업 종료 - {}", now()); + } catch (Exception e) { + log.error("DB 세션 검증 실패", e); + throw new RuntimeException(e); + } + } + + + private LinkedHashMap> printTablePrivileges(Connection conn) throws SQLException { + LinkedHashMap> tables = new LinkedHashMap<>(); + + try (PreparedStatement stmt = conn.prepareStatement("SELECT * FROM ROLE_TAB_PRIVS WHERE role = ? ORDER BY table_name ASC")) { + stmt.setString(1, "RL_EMS_ALL"); + ResultSet rs = stmt.executeQuery(); + while(rs.next()) { + Set privileges; + if (tables.containsKey(rs.getString("table_name"))) { + privileges = tables.get(rs.getString("table_name")); + } else { + privileges = new LinkedHashSet<>(); + tables.put(rs.getString("table_name").toUpperCase(), privileges); + } + + privileges.add(rs.getString("privilege")); + } + + log.info("| Table | Privileges |"); + log.info("|---|---|"); + tables.forEach((key, value) -> log.info(String.format("| %-20s | %-36s |", key, value))); + } + + return tables; + } + + + private String now() { + return LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME); + } +} diff --git a/src/main/resources/logback-debug.xml b/src/main/resources/logback-debug.xml index abfa1c3..9edde75 100644 --- a/src/main/resources/logback-debug.xml +++ b/src/main/resources/logback-debug.xml @@ -35,6 +35,17 @@ + + ${LOG_PATH}/debug-report.log + + ${LOG_PATH}/backup/debug-report.%d{yyyy-MM-dd}.log + 7 + + + %msg%n + + + @@ -43,6 +54,7 @@ + @@ -53,4 +65,7 @@ + + + \ No newline at end of file diff --git a/src/main/resources/logback-rinjae.xml b/src/main/resources/logback-rinjae.xml index 99f8815..1bd0831 100644 --- a/src/main/resources/logback-rinjae.xml +++ b/src/main/resources/logback-rinjae.xml @@ -27,6 +27,17 @@ + + ${LOG_PATH}/report.log + + ${LOG_PATH}/backup/report.%d{yyyy-MM-dd}.log + 7 + + + %msg%n + + + @@ -45,5 +56,8 @@ + + + \ No newline at end of file From 08e8fd27062c89c0d3aab792dd8d74922685ec0e Mon Sep 17 00:00:00 2001 From: Rinjae Date: Tue, 28 Oct 2025 19:01:44 +0900 Subject: [PATCH 06/26] =?UTF-8?q?DB=20=EA=B2=80=EC=A6=9D=20profile=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/PortalDatasourceConfiguration.java | 10 +++++++++- .../apim/portal/spring/DatabaseSessionVerifier.java | 13 ++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/eactive/apim/portal/config/PortalDatasourceConfiguration.java b/src/main/java/com/eactive/apim/portal/config/PortalDatasourceConfiguration.java index f13c8bf..ab1ebd3 100644 --- a/src/main/java/com/eactive/apim/portal/config/PortalDatasourceConfiguration.java +++ b/src/main/java/com/eactive/apim/portal/config/PortalDatasourceConfiguration.java @@ -1,5 +1,6 @@ package com.eactive.apim.portal.config; +import com.eactive.apim.portal.spring.DatabaseSessionVerifier; import com.eactive.eai.data.jpa.BaseRepositoryImpl; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -73,7 +74,14 @@ public class PortalDatasourceConfiguration extends BaseDatasourceConfiguration { throw new IllegalArgumentException("DB 접속을 위한 JNDI 또는 서버 접속 정보가 설정되어 있지 않음"); } - return createDataSource(emsProp); + DataSource dataSource = createDataSource(emsProp); + + if (env.matchesProfiles("db_check")) { + DatabaseSessionVerifier verifier = new DatabaseSessionVerifier(dataSource); + verifier.afterSingletonsInstantiated(); + } + + return dataSource; } @Primary diff --git a/src/main/java/com/eactive/apim/portal/spring/DatabaseSessionVerifier.java b/src/main/java/com/eactive/apim/portal/spring/DatabaseSessionVerifier.java index 34bfc6b..b95b22c 100644 --- a/src/main/java/com/eactive/apim/portal/spring/DatabaseSessionVerifier.java +++ b/src/main/java/com/eactive/apim/portal/spring/DatabaseSessionVerifier.java @@ -2,17 +2,18 @@ package com.eactive.apim.portal.spring; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.SmartInitializingSingleton; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; import javax.sql.DataSource; import java.sql.*; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; -import java.util.*; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Set; -@Configuration -@Profile("db_check") +//@Configuration +//@Profile("db_check") @Slf4j public class DatabaseSessionVerifier implements SmartInitializingSingleton { private final DataSource emsDataSource; @@ -61,6 +62,8 @@ public class DatabaseSessionVerifier implements SmartInitializingSingleton { log.error("DB 세션 검증 실패", e); throw new RuntimeException(e); } + + throw new RuntimeException("db_check profile end."); } From 1ed0da8b7605ec3b72e7fa882095724d6a0f7404 Mon Sep 17 00:00:00 2001 From: Rinjae Date: Tue, 28 Oct 2025 19:09:41 +0900 Subject: [PATCH 07/26] =?UTF-8?q?DB=20=EA=B2=80=EC=A6=9D=20profile=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/PortalDatasourceConfiguration.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/eactive/apim/portal/config/PortalDatasourceConfiguration.java b/src/main/java/com/eactive/apim/portal/config/PortalDatasourceConfiguration.java index ab1ebd3..014503f 100644 --- a/src/main/java/com/eactive/apim/portal/config/PortalDatasourceConfiguration.java +++ b/src/main/java/com/eactive/apim/portal/config/PortalDatasourceConfiguration.java @@ -58,29 +58,34 @@ public class PortalDatasourceConfiguration extends BaseDatasourceConfiguration { @Primary @Bean public DataSource portalDataSource(EmsDatasourceProperty emsProp) { + DataSource dataSource = null; + // JNDI 이용 if (StringUtils.isNotEmpty(emsProp.getJndiName())) { try { - return this.jndiLookup(emsProp.getJndiName()); + dataSource = this.jndiLookup(emsProp.getJndiName()); } catch (NamingException e) { log.warn("JNDI lookup failed.", e); } } - log.info("개발환경을 위해 JNDI 대신 직접 DB 접속 시도"); + if (dataSource == null) { + log.info("개발환경을 위해 JNDI 대신 직접 DB 접속 시도"); - // JNDI 실패시 직접 접속 이용 - if (StringUtils.isEmpty(emsProp.getJdbcUrl())) { - throw new IllegalArgumentException("DB 접속을 위한 JNDI 또는 서버 접속 정보가 설정되어 있지 않음"); + // JNDI 실패시 직접 접속 이용 + if (StringUtils.isEmpty(emsProp.getJdbcUrl())) { + throw new IllegalArgumentException("DB 접속을 위한 JNDI 또는 서버 접속 정보가 설정되어 있지 않음"); + } + + dataSource = createDataSource(emsProp); } - DataSource dataSource = createDataSource(emsProp); - - if (env.matchesProfiles("db_check")) { + if (dataSource != null && env.matchesProfiles("db_check")) { DatabaseSessionVerifier verifier = new DatabaseSessionVerifier(dataSource); verifier.afterSingletonsInstantiated(); } + return dataSource; } From 5082fc4f99d0697ad1243e262ba0407f707e5ef5 Mon Sep 17 00:00:00 2001 From: Rinjae Date: Tue, 28 Oct 2025 19:14:54 +0900 Subject: [PATCH 08/26] =?UTF-8?q?db=5Fcheck=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apim/portal/config/PortalDatasourceConfiguration.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/eactive/apim/portal/config/PortalDatasourceConfiguration.java b/src/main/java/com/eactive/apim/portal/config/PortalDatasourceConfiguration.java index 014503f..91eb1b2 100644 --- a/src/main/java/com/eactive/apim/portal/config/PortalDatasourceConfiguration.java +++ b/src/main/java/com/eactive/apim/portal/config/PortalDatasourceConfiguration.java @@ -63,6 +63,7 @@ public class PortalDatasourceConfiguration extends BaseDatasourceConfiguration { // JNDI 이용 if (StringUtils.isNotEmpty(emsProp.getJndiName())) { try { + log.debug("Try get JNDI datasource : {}", emsProp.getJndiName()); dataSource = this.jndiLookup(emsProp.getJndiName()); } catch (NamingException e) { log.warn("JNDI lookup failed.", e); @@ -81,6 +82,7 @@ public class PortalDatasourceConfiguration extends BaseDatasourceConfiguration { } if (dataSource != null && env.matchesProfiles("db_check")) { + log.debug("Activated 'db_check' profile."); DatabaseSessionVerifier verifier = new DatabaseSessionVerifier(dataSource); verifier.afterSingletonsInstantiated(); } From 2d9998d97c4260fdde90257c575e7e8977a0b139 Mon Sep 17 00:00:00 2001 From: Rinjae Date: Tue, 28 Oct 2025 22:01:05 +0900 Subject: [PATCH 09/26] =?UTF-8?q?db=5Fcheck=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apim/portal/config/PortalDatasourceConfiguration.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/eactive/apim/portal/config/PortalDatasourceConfiguration.java b/src/main/java/com/eactive/apim/portal/config/PortalDatasourceConfiguration.java index 91eb1b2..8e66dd4 100644 --- a/src/main/java/com/eactive/apim/portal/config/PortalDatasourceConfiguration.java +++ b/src/main/java/com/eactive/apim/portal/config/PortalDatasourceConfiguration.java @@ -60,6 +60,8 @@ public class PortalDatasourceConfiguration extends BaseDatasourceConfiguration { public DataSource portalDataSource(EmsDatasourceProperty emsProp) { DataSource dataSource = null; + log.debug("Portal datasource initialize."); + // JNDI 이용 if (StringUtils.isNotEmpty(emsProp.getJndiName())) { try { From dbcd538fc17c5af71bd0676b0a35ef779dbff476 Mon Sep 17 00:00:00 2001 From: Rinjae Date: Wed, 29 Oct 2025 13:15:54 +0900 Subject: [PATCH 10/26] =?UTF-8?q?=EB=A1=9C=EC=BB=AC=20=ED=99=95=EC=9D=B8?= =?UTF-8?q?=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-dev.yml | 17 +++++++++++++++++ src/main/resources/logback-debug.xml | 14 ++++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 9b9da74..09dae30 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -18,6 +18,23 @@ spring: thymeleaf: cache: false +ems: + datasource: + jdbc-url: jdbc:oracle:thin:@//192.168.240.177:1599/DAPM +# jdbc-url: jdbc:oracle:thin:@//192.168.240.177:1599/PAPM + driver-class-name: oracle.jdbc.OracleDriver + username: EMSAPP + password: EMSAPP123! + + +gateway: + datasource: + jdbc-url: jdbc:oracle:thin:@//192.168.240.177:1599/DAPM +# jdbc-url: jdbc:oracle:thin:@//192.168.240.177:1599/PAPM + driver-class-name: oracle.jdbc.OracleDriver + username: AGWAPP + password: AGWAPP123! + portal: auth-virtual-code: 654321 diff --git a/src/main/resources/logback-debug.xml b/src/main/resources/logback-debug.xml index 9edde75..a322856 100644 --- a/src/main/resources/logback-debug.xml +++ b/src/main/resources/logback-debug.xml @@ -2,7 +2,7 @@ - + @@ -47,14 +47,16 @@ - + - + + + @@ -65,7 +67,7 @@ - - - + + + \ No newline at end of file From 0be61f3c78d725bf498d637a2bf1e19cf226ca4e Mon Sep 17 00:00:00 2001 From: Rinjae Date: Wed, 29 Oct 2025 14:51:01 +0900 Subject: [PATCH 11/26] =?UTF-8?q?DB=20=EA=B4=80=EB=A0=A8=20=EC=9D=BC?= =?UTF-8?q?=EB=B6=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apim/portal/config/BaseDatasourceConfiguration.java | 2 +- src/main/resources/logback-debug.xml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/eactive/apim/portal/config/BaseDatasourceConfiguration.java b/src/main/java/com/eactive/apim/portal/config/BaseDatasourceConfiguration.java index dd17a85..c5c5903 100644 --- a/src/main/java/com/eactive/apim/portal/config/BaseDatasourceConfiguration.java +++ b/src/main/java/com/eactive/apim/portal/config/BaseDatasourceConfiguration.java @@ -95,7 +95,7 @@ public class BaseDatasourceConfiguration { } // 개발 환경용 - if (env.matchesProfiles("dev", "local")) { + if (env.matchesProfiles("local")) { properties.put("hibernate.hbm2ddl.auto", "validate"); } diff --git a/src/main/resources/logback-debug.xml b/src/main/resources/logback-debug.xml index a322856..77ee1eb 100644 --- a/src/main/resources/logback-debug.xml +++ b/src/main/resources/logback-debug.xml @@ -58,7 +58,7 @@ - + @@ -67,7 +67,7 @@ - - - + + + \ No newline at end of file From 6246a7beaeef334e929b51dbe78d5060fc40ab59 Mon Sep 17 00:00:00 2001 From: Rinjae Date: Tue, 4 Nov 2025 20:50:13 +0900 Subject: [PATCH 12/26] =?UTF-8?q?=EB=A1=9C=EA=B9=85=20=EC=84=A4=EC=A0=95?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/logback-rinjae.xml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/resources/logback-rinjae.xml b/src/main/resources/logback-rinjae.xml index 99f8815..e03b261 100644 --- a/src/main/resources/logback-rinjae.xml +++ b/src/main/resources/logback-rinjae.xml @@ -36,13 +36,32 @@ + - + + + + + + + + + + + + + + + + + + + From 8c4c9e4c32391a034a73fd522538b31787592317 Mon Sep 17 00:00:00 2001 From: Rinjae Date: Wed, 5 Nov 2025 18:54:15 +0900 Subject: [PATCH 13/26] =?UTF-8?q?ums=20=EC=97=B0=EB=8F=99=20=EB=A1=9C?= =?UTF-8?q?=EC=BB=AC=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 1 + .../apim/portal/apps/auth/service/MessageSender.java | 11 +++++++---- .../apps/user/facade/OrgRegisterFacadeImpl.java | 4 ++-- .../apps/user/facade/UserRegisterFacadeImpl.java | 4 ++-- .../apps/user/service/PortalUserAuthService.java | 3 +-- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 27c8ddc..779fd1e 100644 --- a/build.gradle +++ b/build.gradle @@ -27,6 +27,7 @@ dependencies { implementation project(':elink-online-core-jpa') implementation project(':elink-portal-common') + implementation project(':kjb-safedb') implementation('org.springframework.boot:spring-boot-starter') implementation 'org.springframework.boot:spring-boot-starter-jta-atomikos' diff --git a/src/main/java/com/eactive/apim/portal/apps/auth/service/MessageSender.java b/src/main/java/com/eactive/apim/portal/apps/auth/service/MessageSender.java index 70a0ab9..851f865 100644 --- a/src/main/java/com/eactive/apim/portal/apps/auth/service/MessageSender.java +++ b/src/main/java/com/eactive/apim/portal/apps/auth/service/MessageSender.java @@ -1,6 +1,9 @@ package com.eactive.apim.portal.apps.auth.service; +import com.eactive.apim.portal.portaluser.event.UserVerificationEmailEvent; import com.eactive.apim.portal.portaluser.event.UserVerificationMobilePhoneEvent; +import com.eactive.apim.portal.template.entity.MessageCode; +import com.eactive.apim.portal.template.service.MessageEventHandler; import com.eactive.apim.portal.template.service.MessageHandlerService; import com.eactive.apim.portal.template.service.MessageRecipient; import org.springframework.beans.factory.annotation.Autowired; @@ -31,15 +34,15 @@ public class MessageSender { // 이메일, SMS MESSAEG_CODE 다름 처리 - String messageCode = ""; + MessageCode messageCode; if ("email".equalsIgnoreCase(msgType)) { - messageCode = "USER_VERIFICATION_EMAIL"; + messageCode = MessageCode.USER_VERIFICATION_EMAIL; } else if ("sms".equalsIgnoreCase(msgType)) { - messageCode = "USER_VERIFICATION_MOBILEPHONE"; + messageCode = MessageCode.USER_VERIFICATION_MOBILEPHONE; } else { throw new IllegalArgumentException("Unsupported message type: " + msgType); } - messageHandlerService.publishEvent(UserVerificationMobilePhoneEvent.KEY, recipient, params); + messageHandlerService.publishEvent(messageCode, recipient, params); } } diff --git a/src/main/java/com/eactive/apim/portal/apps/user/facade/OrgRegisterFacadeImpl.java b/src/main/java/com/eactive/apim/portal/apps/user/facade/OrgRegisterFacadeImpl.java index 6868743..b23c960 100644 --- a/src/main/java/com/eactive/apim/portal/apps/user/facade/OrgRegisterFacadeImpl.java +++ b/src/main/java/com/eactive/apim/portal/apps/user/facade/OrgRegisterFacadeImpl.java @@ -19,8 +19,8 @@ import com.eactive.apim.portal.file.service.FileTypeContext; import com.eactive.apim.portal.portalorg.entity.PortalOrg; import com.eactive.apim.portal.portaluser.entity.PortalUser; import com.eactive.apim.portal.portaluser.entity.PortalUserEnums; -import com.eactive.apim.portal.portaluser.event.UserEmailActivationEvent; import com.eactive.apim.portal.portaluser.repository.PortalUserRepository; +import com.eactive.apim.portal.template.entity.MessageCode; import com.eactive.apim.portal.template.service.MessageHandlerService; import com.eactive.apim.portal.template.service.MessageRecipient; import lombok.RequiredArgsConstructor; @@ -206,7 +206,7 @@ public class OrgRegisterFacadeImpl implements OrgRegisterFacade { try { String encToken = encryptionUtil.encrypt(tokenValue); params.put("token", Base64.encode(encToken.getBytes(StandardCharsets.UTF_8))); - messageHandlerService.publishEvent(UserEmailActivationEvent.KEY, recipient, params); + messageHandlerService.publishEvent(MessageCode.USER_VERIFICATION_EMAIL, recipient, params); } catch (NoSuchPaddingException | NoSuchAlgorithmException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) { throw new SystemException("암호화 모듈 오류"); } diff --git a/src/main/java/com/eactive/apim/portal/apps/user/facade/UserRegisterFacadeImpl.java b/src/main/java/com/eactive/apim/portal/apps/user/facade/UserRegisterFacadeImpl.java index 1af158c..8c06d09 100644 --- a/src/main/java/com/eactive/apim/portal/apps/user/facade/UserRegisterFacadeImpl.java +++ b/src/main/java/com/eactive/apim/portal/apps/user/facade/UserRegisterFacadeImpl.java @@ -16,8 +16,8 @@ import com.eactive.apim.portal.invitation.entity.UserInvitation; import com.eactive.apim.portal.invitation.entity.UserInvitationEnums; import com.eactive.apim.portal.invitation.repository.UserInvitationRepository; import com.eactive.apim.portal.portaluser.entity.PortalUser; -import com.eactive.apim.portal.portaluser.event.UserEmailActivationEvent; import com.eactive.apim.portal.portaluser.repository.PortalUserRepository; +import com.eactive.apim.portal.template.entity.MessageCode; import com.eactive.apim.portal.template.service.MessageHandlerService; import com.eactive.apim.portal.template.service.MessageRecipient; import lombok.RequiredArgsConstructor; @@ -219,7 +219,7 @@ public class UserRegisterFacadeImpl implements UserRegisterFacade { String tokenValue = String.valueOf(authNumberGenerator.generateAuthNumber()); // String tokenValue = registeredUser.getCreatedDate().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + ":" + registeredUser.getId(); params.put("token", tokenValue); - messageHandlerService.publishEvent(UserEmailActivationEvent.KEY, recipient, params); + messageHandlerService.publishEvent(MessageCode.USER_VERIFICATION_EMAIL, recipient, params); // try { // String encToken = encryptionUtil.encrypt(tokenValue); diff --git a/src/main/java/com/eactive/apim/portal/apps/user/service/PortalUserAuthService.java b/src/main/java/com/eactive/apim/portal/apps/user/service/PortalUserAuthService.java index a92dd5d..dba3d17 100644 --- a/src/main/java/com/eactive/apim/portal/apps/user/service/PortalUserAuthService.java +++ b/src/main/java/com/eactive/apim/portal/apps/user/service/PortalUserAuthService.java @@ -11,7 +11,6 @@ import com.eactive.apim.portal.config.PortalProperties; import com.eactive.apim.portal.portaluser.entity.PortalUser; import com.eactive.apim.portal.portaluser.entity.PortalUserEnums; import com.eactive.apim.portal.portaluser.entity.PortalUserEnums.RoleCode; -import com.eactive.apim.portal.portaluser.event.UserEmailActivationEvent; import com.eactive.apim.portal.portaluser.event.UserPasswordResetEvent; import com.eactive.apim.portal.portaluser.repository.PortalUserRepository; import com.eactive.apim.portal.template.entity.MessageCode; @@ -134,7 +133,7 @@ public class PortalUserAuthService implements UserDetailsService { String encToken = encryptionUtil.encrypt(tokenValue); params.put("token", Base64.encode(encToken.getBytes(StandardCharsets.UTF_8))); MessageRecipient recipient = createMessageRecipient(user); - messageHandlerService.publishEvent(UserEmailActivationEvent.KEY, recipient, params); + messageHandlerService.publishEvent(MessageCode.USER_VERIFICATION_EMAIL, recipient, params); } catch (NoSuchPaddingException | NoSuchAlgorithmException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) { throw new SystemException("암호화 모듈 오류"); } From 84c36831ad1e29f5ba264415e425a397b3bac82f Mon Sep 17 00:00:00 2001 From: Rinjae Date: Wed, 5 Nov 2025 21:38:43 +0900 Subject: [PATCH 14/26] =?UTF-8?q?gateway=20datasource=20configuration=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GatewayDatasourceConfiguration.java | 43 ------------------- 1 file changed, 43 deletions(-) diff --git a/src/main/java/com/eactive/apim/portal/config/GatewayDatasourceConfiguration.java b/src/main/java/com/eactive/apim/portal/config/GatewayDatasourceConfiguration.java index 940e5ba..d824550 100644 --- a/src/main/java/com/eactive/apim/portal/config/GatewayDatasourceConfiguration.java +++ b/src/main/java/com/eactive/apim/portal/config/GatewayDatasourceConfiguration.java @@ -1,7 +1,6 @@ package com.eactive.apim.portal.config; import com.eactive.eai.data.jpa.BaseRepositoryImpl; -import com.zaxxer.hikari.HikariDataSource; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Qualifier; @@ -9,20 +8,14 @@ import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Primary; import org.springframework.core.env.Environment; -import org.springframework.data.domain.AuditorAware; import org.springframework.data.jpa.repository.config.EnableJpaAuditing; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; -import org.springframework.jndi.JndiObjectFactoryBean; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; import javax.annotation.PostConstruct; import javax.naming.NamingException; import javax.sql.DataSource; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.HashMap; @Configuration @EntityScan(basePackages = {"com.eactive.apim.gateway"}) @@ -78,28 +71,6 @@ public class GatewayDatasourceConfiguration extends BaseDatasourceConfiguration return createDataSource(gatewayProp); } - @Primary - @Bean - public DataSource portalDataSource(EmsDatasourceProperty emsProp) { - // JNDI 이용 - if (StringUtils.isNotEmpty(emsProp.getJndiName())) { - try { - return this.jndiLookup(emsProp.getJndiName()); - } catch (NamingException e) { - log.warn("JNDI lookup failed.", e); - } - } - - log.info("개발환경을 위해 JNDI 대신 직접 DB 접속 시도"); - - // JNDI 실패시 직접 접속 이용 - if (StringUtils.isEmpty(emsProp.getJdbcUrl())) { - throw new IllegalArgumentException("DB 접속을 위한 JNDI 또는 서버 접속 정보가 설정되어 있지 않음"); - } - - return createDataSource(emsProp); - } - @Bean(name = "gatewayEntityManagerFactory") public LocalContainerEntityManagerFactoryBean gatewayEntityManagerFactory( EntityManagerFactoryBuilder builder, @@ -107,18 +78,4 @@ public class GatewayDatasourceConfiguration extends BaseDatasourceConfiguration GatewayDataSourceProperty gatewayProp) { return createEntityManagerFactory(builder, dataSource, gatewayProp); } - - @Primary - @Bean(name = "entityManagerFactory") - public LocalContainerEntityManagerFactoryBean entityManagerFactory( - EntityManagerFactoryBuilder builder, - @Qualifier("gatewayDataSource") DataSource dataSource, - EmsDatasourceProperty emsProp) { - return createEntityManagerFactory(builder, dataSource, emsProp); - } - - @Bean - public AuditorAware auditorProvider() { - return new AuditorAwareImpl(); - } } From 0b19dd602bd5e0ee75bede7b48fc46d57c008ed9 Mon Sep 17 00:00:00 2001 From: Rinjae Date: Wed, 5 Nov 2025 21:56:38 +0900 Subject: [PATCH 15/26] =?UTF-8?q?DB=20=EA=B4=80=EB=A0=A8=20=EC=9D=BC?= =?UTF-8?q?=EB=B6=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/BaseDatasourceConfiguration.java | 1 + src/main/resources/logback-debug.xml | 19 ++++++++++++++----- src/main/resources/weblogic.xml | 14 +++++++------- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/eactive/apim/portal/config/BaseDatasourceConfiguration.java b/src/main/java/com/eactive/apim/portal/config/BaseDatasourceConfiguration.java index c5c5903..e8100b3 100644 --- a/src/main/java/com/eactive/apim/portal/config/BaseDatasourceConfiguration.java +++ b/src/main/java/com/eactive/apim/portal/config/BaseDatasourceConfiguration.java @@ -73,6 +73,7 @@ public class BaseDatasourceConfiguration { properties.put("hibernate.default_schema", prop.getSchema()); properties.put("javax.persistence.validation.mode", "none"); properties.put("javax.persistence.transactionType", "JTA"); + properties.put("hibernate.format_sql", "true"); if (prop instanceof EmsDatasourceProperty) { persistenceUnit = "portal"; diff --git a/src/main/resources/logback-debug.xml b/src/main/resources/logback-debug.xml index 77ee1eb..3892104 100644 --- a/src/main/resources/logback-debug.xml +++ b/src/main/resources/logback-debug.xml @@ -49,7 +49,6 @@ - @@ -58,16 +57,26 @@ - + + - + - - + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/weblogic.xml b/src/main/resources/weblogic.xml index 7b95551..b8ffd33 100644 --- a/src/main/resources/weblogic.xml +++ b/src/main/resources/weblogic.xml @@ -7,13 +7,13 @@ / - - org.slf4j.* - ch.qos.logback.* - org.apache.log4j.* - org.apache.commons.logging.* - - + + + + + + + true From baf2fe8e6d7667a80d2dbc7e67aeac57833a3235 Mon Sep 17 00:00:00 2001 From: Rinjae Date: Wed, 5 Nov 2025 22:20:16 +0900 Subject: [PATCH 16/26] jpa error interceptor --- .../portal/tools/JpaErrorLoggingAspect.java | 27 +++++++++++++++++++ src/main/resources/weblogic.xml | 14 +++++----- 2 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 src/main/java/com/eactive/apim/portal/tools/JpaErrorLoggingAspect.java diff --git a/src/main/java/com/eactive/apim/portal/tools/JpaErrorLoggingAspect.java b/src/main/java/com/eactive/apim/portal/tools/JpaErrorLoggingAspect.java new file mode 100644 index 0000000..ae2ea69 --- /dev/null +++ b/src/main/java/com/eactive/apim/portal/tools/JpaErrorLoggingAspect.java @@ -0,0 +1,27 @@ +package com.eactive.apim.portal.tools; + +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.annotation.AfterThrowing; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.stereotype.Component; + +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; + +@Component +@Aspect +@Slf4j +public class JpaErrorLoggingAspect { + @PersistenceContext + private EntityManager em; + + @AfterThrowing(pointcut = "@annotation(org.springframework.transaction.annotation.Transactional)", throwing = "ex") + public void onError(Exception ex) { + try { + String user = (String) em.createNativeQuery("select user from user").getSingleResult(); + log.error("DB USER = {}, SQL ERROR = {}", user, ex.getMessage() ); + } catch (Exception e) { + log.error("Failed to fetch DB User", e); + } + } +} diff --git a/src/main/resources/weblogic.xml b/src/main/resources/weblogic.xml index b8ffd33..7b95551 100644 --- a/src/main/resources/weblogic.xml +++ b/src/main/resources/weblogic.xml @@ -7,13 +7,13 @@ / - - - - - - - true + + org.slf4j.* + ch.qos.logback.* + org.apache.log4j.* + org.apache.commons.logging.* + + From e3f579a9abc990b6f89c8ce5c294722878325498 Mon Sep 17 00:00:00 2001 From: Rinjae Date: Wed, 5 Nov 2025 22:52:05 +0900 Subject: [PATCH 17/26] =?UTF-8?q?property=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-stage.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/main/resources/application-stage.yml b/src/main/resources/application-stage.yml index 0cd16bd..d9a4f86 100644 --- a/src/main/resources/application-stage.yml +++ b/src/main/resources/application-stage.yml @@ -18,6 +18,25 @@ spring: portal: auth-virtual-code: 654321 + +ems: + datasource: + jndi-name: jdbc/dsOBP_EMS + schema: EMSADM + + hibernate-dialect: org.hibernate.dialect.Oracle12cDialect + hibernate-physical-naming-strategy: com.eactive.apim.portal.common.entity.CustomPhysicalNamingStrategy + entity-package: com.eactive.apim.portal + +gateway: + datasource: + jndi-name: jdbc/dsOBP_AGW + schema: AGWADM + + hibernate-dialect: org.hibernate.dialect.Oracle12cDialect + hibernate-physical-naming-strategy: com.eactive.apim.portal.common.entity.CustomPhysicalNamingStrategy + entity-package: com.eactive.eai.data.entity.onl + #proxy: # targets: # stg: http://inter-dapiwas01.k-bank.com:7090/monitoring From fce34fd98b38c0750fe603ffc99f104706368914 Mon Sep 17 00:00:00 2001 From: Rinjae Date: Thu, 6 Nov 2025 14:43:42 +0900 Subject: [PATCH 18/26] =?UTF-8?q?kbank=20=EC=86=8C=EC=8A=A4=20=EC=9D=BC?= =?UTF-8?q?=EB=B6=80=20=EB=B3=B5=EC=9B=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../portal/tools/JpaErrorLoggingAspect.java | 5 +- .../templates/views/apps/login/login.html | 171 ++-- .../templates/views/apps/main/index.html | 743 ++++++++++-------- 3 files changed, 506 insertions(+), 413 deletions(-) diff --git a/src/main/java/com/eactive/apim/portal/tools/JpaErrorLoggingAspect.java b/src/main/java/com/eactive/apim/portal/tools/JpaErrorLoggingAspect.java index ae2ea69..bad9ac7 100644 --- a/src/main/java/com/eactive/apim/portal/tools/JpaErrorLoggingAspect.java +++ b/src/main/java/com/eactive/apim/portal/tools/JpaErrorLoggingAspect.java @@ -7,6 +7,7 @@ import org.springframework.stereotype.Component; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; +import java.sql.SQLException; @Component @Aspect @@ -16,9 +17,9 @@ public class JpaErrorLoggingAspect { private EntityManager em; @AfterThrowing(pointcut = "@annotation(org.springframework.transaction.annotation.Transactional)", throwing = "ex") - public void onError(Exception ex) { + public void onError(SQLException ex) { try { - String user = (String) em.createNativeQuery("select user from user").getSingleResult(); + String user = (String) em.createNativeQuery("select user from dual").getSingleResult(); log.error("DB USER = {}, SQL ERROR = {}", user, ex.getMessage() ); } catch (Exception e) { log.error("Failed to fetch DB User", e); diff --git a/src/main/resources/templates/views/apps/login/login.html b/src/main/resources/templates/views/apps/login/login.html index 514b64c..b2eb5da 100644 --- a/src/main/resources/templates/views/apps/login/login.html +++ b/src/main/resources/templates/views/apps/login/login.html @@ -1,90 +1,104 @@ + xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout/kbank_base_layout}"> - -