diff --git a/.gitignore b/.gitignore index b520596..546de91 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ WebContent/generated/ bin/ tmp/ *.iml +*.ipr *.tmp *.bak *.swp @@ -236,4 +237,6 @@ gradle-app.setting *.patch Doc/ -docs \ No newline at end of file +docs +build-gf63.sh +gradle-gf63.sh \ No newline at end of file diff --git a/WebContent/META-INF/context.xml b/WebContent/META-INF/context-kbank-mysql.xml similarity index 100% rename from WebContent/META-INF/context.xml rename to WebContent/META-INF/context-kbank-mysql.xml diff --git a/WebContent/META-INF/context-kjb-mysql.xml b/WebContent/META-INF/context-kjb-mysql.xml new file mode 100644 index 0000000..04cbfb2 --- /dev/null +++ b/WebContent/META-INF/context-kjb-mysql.xml @@ -0,0 +1,22 @@ + + + + + + + + + + \ No newline at end of file diff --git a/WebContent/META-INF/persistence.xml b/WebContent/META-INF/persistence.xml new file mode 100644 index 0000000..2668051 --- /dev/null +++ b/WebContent/META-INF/persistence.xml @@ -0,0 +1,30 @@ + + org.hibernate.jpa.HibernatePersistenceProvider + jdbc/dsOBP_EMS + + + + + + com.eactive.eai.rms.data.entity.onl.bzwkdstcd.UserBusiness + + com.eactive.eai.data.entity.onl.unifbwk.UnifBwkTp + false + + + org.hibernate.jpa.HibernatePersistenceProvider + jdbc/dsOBP_EMS + + + + + + com.eactive.eai.rms.data.entity.onl.bzwkdstcd.UserBusiness + + com.eactive.eai.data.entity.onl.unifbwk.UnifBwkTp + false + \ No newline at end of file diff --git a/WebContent/WEB-INF/applicationContext-datasource-DEV.xml b/WebContent/WEB-INF/applicationContext-datasource-DEV.xml index 45b8991..2c45aca 100644 --- a/WebContent/WEB-INF/applicationContext-datasource-DEV.xml +++ b/WebContent/WEB-INF/applicationContext-datasource-DEV.xml @@ -24,15 +24,15 @@ class="com.eactive.eai.rms.common.datasource.DataSourceType" p:name="APIGW" p:text="APIGW" - p:schema="ndapigw" + p:schema="AGWADM" p:dynamic="true" p:online="true" - p:jndiName="NDAPIGW_APP_NXA" + p:jndiName="jdbc/dsOBP_AGW" p:render="ONL,COM" /> - + /> --> - + /> --> - + /> --> diff --git a/WebContent/WEB-INF/applicationContext-datasource-PROD.xml b/WebContent/WEB-INF/applicationContext-datasource-PROD.xml index 09da4be..ffbf4f8 100644 --- a/WebContent/WEB-INF/applicationContext-datasource-PROD.xml +++ b/WebContent/WEB-INF/applicationContext-datasource-PROD.xml @@ -27,12 +27,12 @@ p:schema="apigw" p:dynamic="true" p:online="true" - p:jndiName="APIGW_APP_NXA" + p:jndiName="jdbc/dsOBP_AGW" p:render="ONL,COM" /> - + /> --> - + /> --> - + /> --> diff --git a/WebContent/WEB-INF/applicationContext-datasource-STG.xml b/WebContent/WEB-INF/applicationContext-datasource-STG.xml index 2aa52aa..76116e5 100644 --- a/WebContent/WEB-INF/applicationContext-datasource-STG.xml +++ b/WebContent/WEB-INF/applicationContext-datasource-STG.xml @@ -24,15 +24,15 @@ class="com.eactive.eai.rms.common.datasource.DataSourceType" p:name="APIGW" p:text="APIGW" - p:schema="dapigw" + p:schema="AGWADM" p:dynamic="true" p:online="true" - p:jndiName="DAPIGW_APP_NXA" + p:jndiName="jdbc/dsOBP_AGW" p:render="ONL,COM" /> - + /> --> - + /> --> - + /> --> diff --git a/WebContent/WEB-INF/applicationContext-jpa.xml b/WebContent/WEB-INF/applicationContext-jpa.xml index 753b9a0..287b55e 100644 --- a/WebContent/WEB-INF/applicationContext-jpa.xml +++ b/WebContent/WEB-INF/applicationContext-jpa.xml @@ -93,7 +93,7 @@ none true true - ${hibernate.dialect:org.hibernate.dialect.PostgreSQL10Dialect} + ${hibernate.dialect:org.hibernate.dialect.Oracle12cDialect} 100 100 diff --git a/WebContent/WEB-INF/properties/env.D.properties b/WebContent/WEB-INF/properties/env.D.properties index 2e38be4..b83da1a 100644 --- a/WebContent/WEB-INF/properties/env.D.properties +++ b/WebContent/WEB-INF/properties/env.D.properties @@ -6,11 +6,11 @@ db.vendor=mariadb # - oracle10g : org.hibernate.dialect.Oracle10gDialect # - MySQL8 : org.hibernate.dialect.MySQL8Dialect # - MariaDB 10.3 : org.hibernate.dialect.MariaDB103Dialect -hibernate.dialect=org.hibernate.dialect.MySQL5Dialect +hibernate.dialect=org.hibernate.dialect.Oracle12cDialect # Priority of the was -D option inst.Name=apimsSvr11 -eai.tableowner=apims +eai.tableowner=EMSADM # P/T/D/S eai.systemmode=D eai.drmode=N diff --git a/WebContent/WEB-INF/properties/env.P.properties b/WebContent/WEB-INF/properties/env.P.properties index 18a7407..908dbda 100644 --- a/WebContent/WEB-INF/properties/env.P.properties +++ b/WebContent/WEB-INF/properties/env.P.properties @@ -6,13 +6,13 @@ db.vendor=mariadb # - oracle10g : org.hibernate.dialect.Oracle10gDialect # - MySQL8 : org.hibernate.dialect.MySQL8Dialect # - MariaDB 10.3 : org.hibernate.dialect.MariaDB103Dialect -hibernate.dialect=org.hibernate.dialect.MySQL5Dialect +hibernate.dialect=org.hibernate.dialect.Oracle12cDialect # Priority of the was -D option -inst.Name=apimsSvr11 -eai.tableowner=apims +inst.Name=admSvr11 +eai.tableowner=EMSADM # P/T/D/S eai.systemmode=D eai.drmode=N # black / blue / green / orange / yellow -theme.color=orange +theme.color=orange \ No newline at end of file diff --git a/WebContent/WEB-INF/properties/env.T.properties b/WebContent/WEB-INF/properties/env.T.properties index 78c3625..806baae 100644 --- a/WebContent/WEB-INF/properties/env.T.properties +++ b/WebContent/WEB-INF/properties/env.T.properties @@ -6,13 +6,13 @@ db.vendor=mariadb # - oracle10g : org.hibernate.dialect.Oracle10gDialect # - MySQL8 : org.hibernate.dialect.MySQL8Dialect # - MariaDB 10.3 : org.hibernate.dialect.MariaDB103Dialect -hibernate.dialect=org.hibernate.dialect.MySQL5Dialect +hibernate.dialect=org.hibernate.dialect.Oracle12cDialect # Priority of the was -D option -inst.Name=apimsSvr11 -eai.tableowner=apims +inst.Name=admSvr11 +eai.tableowner=EMSADM # P/T/D/S -eai.systemmode=D +eai.systemmode=T eai.drmode=N # black / blue / green / orange / yellow theme.color=green diff --git a/WebContent/WEB-INF/web.xml b/WebContent/WEB-INF/web.xml index 5e2ea54..2342bdd 100644 --- a/WebContent/WEB-INF/web.xml +++ b/WebContent/WEB-INF/web.xml @@ -63,7 +63,7 @@ --> - + org.springframework.web.context.ContextLoaderListener diff --git a/WebContent/WEB-INF/weblogic-web.xml b/WebContent/WEB-INF/weblogic-web.xml new file mode 100644 index 0000000..18e2775 --- /dev/null +++ b/WebContent/WEB-INF/weblogic-web.xml @@ -0,0 +1,146 @@ + + + monitoring + + contextConfigLocation + /WEB-INF/applicationContext.xml + + + + CrossScriptingFilter + com.eactive.eai.rms.common.filter.CrossScriptingFilter + + + CrossScriptingFilter + /* + + + + encodingFilter + org.springframework.web.filter.CharacterEncodingFilter + + encoding + UTF-8 + + + forceEncoding + true + + + + encodingFilterEUCKR + org.springframework.web.filter.CharacterEncodingFilter + + encoding + utf-8 + + + forceEncoding + true + + + + encodingFilterEUCKR + *.excel + + + encodingFilter + *.file + + + + + + default + weblogic.servlet.FileServlet + + + default + /static/* + + + + + org.springframework.web.context.ContextLoaderListener + + + + + springapp + + org.springframework.web.servlet.DispatcherServlet + + 1 + + 10485760 + 15728640 + 1048576 + + + + + springapp + *.do + + + springapp + *.json + + + springapp + *.view + + + springapp + *.excel + + + springapp + *.file + + + + /emergency.jsp + + + + + + + 404 + /common/errors/error404.jsp + + + + 500 + /common/errors/error500.jsp + + + + + http://java.sun.com/jsp/jstl/core + /WEB-INF/tld/c.tld + + + http://java.sun.com/jsp/jstl/functions + /WEB-INF/tld/fn.tld + + + + + 120 + + \ No newline at end of file diff --git a/WebContent/WEB-INF/weblogic.xml b/WebContent/WEB-INF/weblogic.xml index c5310e1..3e2e27d 100644 --- a/WebContent/WEB-INF/weblogic.xml +++ b/WebContent/WEB-INF/weblogic.xml @@ -10,4 +10,14 @@ JSESSIONID_EMS replicated_if_clustered + + + +org.slf4j.* +ch.qos.logback.* + + +org/slf4j/impl/StaticLoggerBinder.class + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 9a73829..8f1fafa 100644 --- a/build.gradle +++ b/build.gradle @@ -16,17 +16,17 @@ def quartzVersion = "2.2.1" def queryDslVersion = "5.0.0" def hibernateVersion = "5.6.15.Final" -def nexusUrl = "https://nexus.eactive.synology.me:8090" +/*def nexusUrl = "https://nexus.eactive.synology.me:8090"*/ //def useOnJboss = false def generatedJavaDir = "$buildDir/generated/java" -repositories { +/*repositories { maven { url "${nexusUrl}/repository/maven-public/" allowInsecureProtocol = true } -} +}*/ project.webAppDirName = 'WebContent' @@ -47,10 +47,20 @@ compileJava { } war { - rootSpec.exclude '**/persistence.xml' + def profile = project.findProperty("profile") ?: "tomcat" + + if (profile == "weblogic") { + webXml = file("WebContent/WEB-INF/weblogic-web.xml") + } + + + // rootSpec.exclude '**/persistence.xml' exclude '**/context.xml' + archiveFileName = "eapim-admin.war" + duplicatesStrategy = DuplicatesStrategy.WARN } + tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } diff --git a/readme.md b/readme.md index bdfffa8..2ab5794 100644 --- a/readme.md +++ b/readme.md @@ -46,3 +46,11 @@ eLink 모듈을 참조하여 구성되어있으며, 추후 필요 모듈외에 -Dfile.encoding=utf-8 -DLOGBACK_LOG_LEVEL=info ``` + +### Gradle 빌드 옵션 +```bash +# Weblogic 배포용 (테스트 제외) +gradle build -x test -Pprofile=weblogic +``` + +- -Pprofile=weblogic 사용시 weblogic-web.xml 을 web.xml 로 사용 (DefaultServlet 이슈) \ No newline at end of file diff --git a/src/main/java/com/eactive/eai/rms/data/config/ConfigurableMultiTenantConnectionProvider.java b/src/main/java/com/eactive/eai/rms/data/config/ConfigurableMultiTenantConnectionProvider.java index 030bf6d..4743b02 100644 --- a/src/main/java/com/eactive/eai/rms/data/config/ConfigurableMultiTenantConnectionProvider.java +++ b/src/main/java/com/eactive/eai/rms/data/config/ConfigurableMultiTenantConnectionProvider.java @@ -53,12 +53,8 @@ public class ConfigurableMultiTenantConnectionProvider implements MultiTenantCon } public Connection changeSchema(Connection connection, String tenantIdentifier) throws SQLException { - // connection.setSchema() 를 이용하여 schema를 설정 하려 했으나 postgresql 에서는 대문자로 넣으면 에러가 - // 발생 한다. 에러가 발생 하지 않게 하려면 applicationContext-datasource.xml 에서 스키마명을 소문자로 변경 - // 한다. - // 일단 schema 설정을 하지 않고 사용 String schema = DataSourceTypeManager.getDataSourceType(tenantIdentifier).getSchema(); - // connection.setSchema(schema); + connection.setSchema(schema); log.debug("change schema : {} connection : {}", schema, connection); return connection; } diff --git a/src/main/java/com/eactive/eai/rms/data/config/EMSTenantConfiguration.java b/src/main/java/com/eactive/eai/rms/data/config/EMSTenantConfiguration.java index 06bbb2f..b25ec18 100644 --- a/src/main/java/com/eactive/eai/rms/data/config/EMSTenantConfiguration.java +++ b/src/main/java/com/eactive/eai/rms/data/config/EMSTenantConfiguration.java @@ -1,10 +1,13 @@ package com.eactive.eai.rms.data.config; +import java.util.HashMap; +import java.util.Map; import java.util.Properties; import javax.persistence.EntityManagerFactory; import javax.sql.DataSource; +import org.hibernate.cfg.AvailableSettings; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan.Filter; @@ -13,10 +16,12 @@ import org.springframework.data.jpa.repository.config.EnableJpaAuditing; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.orm.jpa.JpaTransactionManager; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; +import org.springframework.orm.jpa.support.SharedEntityManagerBean; import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; import org.springframework.transaction.TransactionManager; import org.springframework.transaction.annotation.EnableTransactionManagement; +import com.eactive.eai.common.dao.Keys; import com.eactive.eai.data.jpa.BaseRepositoryImpl; import com.eactive.eai.rms.common.datasource.DataSourceTypeManager; import com.eactive.eai.rms.data.EMSDataSource; @@ -31,13 +36,17 @@ public class EMSTenantConfiguration { public LocalContainerEntityManagerFactoryBean entityManagerFactoryForEMS( @Qualifier(DataSourceTypeManager.MONITORING) DataSource dataSource, @Qualifier("hibernateProperties") Properties hibernateProperties) { - + LocalContainerEntityManagerFactoryBean bean = new LocalContainerEntityManagerFactoryBean(); bean.setDataSource(dataSource); bean.setPackagesToScan("com.eactive.eai.data", "com.eactive.eai.rms.data", "com.eactive.apim.portal"); bean.setJpaVendorAdapter(new HibernateJpaVendorAdapter()); - bean.setJpaProperties(hibernateProperties); + + Map settings = new HashMap<>(); + settings.put(AvailableSettings.DEFAULT_SCHEMA, System.getProperty(Keys.TABLE_OWNER_KEY)); + bean.setJpaPropertyMap(settings); + return bean; } @@ -49,5 +58,12 @@ public class EMSTenantConfiguration { jpaTransactionManager.setEntityManagerFactory(entityManagerFactory); return jpaTransactionManager; } + + @Bean("entityManagerForEMS") + public SharedEntityManagerBean entityManager(@Qualifier("entityManagerFactoryForEMS") EntityManagerFactory entityManagerFactory) { + SharedEntityManagerBean sharedEntityManagerBean = new SharedEntityManagerBean(); + sharedEntityManagerBean.setEntityManagerFactory(entityManagerFactory); + return sharedEntityManagerBean; + } } diff --git a/src/main/resources/.gitignore b/src/main/resources/.gitignore new file mode 100644 index 0000000..bf62d4f --- /dev/null +++ b/src/main/resources/.gitignore @@ -0,0 +1 @@ +/logback-rinjae.xml diff --git a/src/main/resources/logback-dev.xml b/src/main/resources/logback-dev.xml index 520fcbe..ca1d61f 100644 --- a/src/main/resources/logback-dev.xml +++ b/src/main/resources/logback-dev.xml @@ -1,9 +1,21 @@ + + + + - + + + + + + + %d{yyyy-MM-dd HH:mm:ss} %-5level [%thread] %logger{36} - %msg%n + + @@ -16,7 +28,6 @@ 10 - MS949 ${LOG_PATTERN} @@ -31,7 +42,7 @@ - MS949 + utf-8 ${LOG_PATTERN} @@ -46,8 +57,8 @@ 10 - MS949 - -%msg%n + utf-8 + ${LOG_PATTERN} 10 - MS949 + utf-8 ${LOG_PATTERN} @@ -74,9 +85,20 @@ ${LOG_HOME}/${PREFIX}_dynamic.log-%d{yyyy-MM-dd} 10 - + - MS949 + utf-8 + ${LOG_PATTERN} + + + + ${LOG_HOME}/${PREFIX}_hibernate.log + + ${LOG_HOME}/${PREFIX}_hibernate.log-%d{yyyy-MM-dd} + 10 + + + utf-8 ${LOG_PATTERN} @@ -85,10 +107,12 @@ - - - - + + + + + + @@ -152,5 +176,6 @@ + \ No newline at end of file diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index d8e7a3e..b16a368 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -1,9 +1,9 @@ - - - + + + 10 - MS949 + utf-8 ${LOG_PATTERN} @@ -32,7 +32,7 @@ - MS949 + utf-8 ${LOG_PATTERN} @@ -47,8 +47,8 @@ 10 - MS949 - -%msg%n + utf-8 + ${LOG_PATTERN} 10 - MS949 + utf-8 ${LOG_PATTERN} @@ -75,9 +75,9 @@ ${LOG_HOME}/${PREFIX}_dynamic.log-%d{yyyy-MM-dd} 10 - + - MS949 + utf-8 ${LOG_PATTERN}