From 76a51aa8571813e115af34c87cc9197dff9e1328 Mon Sep 17 00:00:00 2001 From: anilgupta Date: Mon, 18 Mar 2024 13:04:15 +0530 Subject: [PATCH 1/5] Issue #LR-739 chore: Upgraded the scala major version from 2.11 to 2.12 --- controller/pom.xml | 3 ++- core/actor-core/pom.xml | 5 +++-- core/cassandra-utils/pom.xml | 3 ++- core/notification-utils/pom.xml | 3 ++- core/platform-common/pom.xml | 7 ++++--- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/controller/pom.xml b/controller/pom.xml index 479ec52cf2..ff2a32c589 100644 --- a/controller/pom.xml +++ b/controller/pom.xml @@ -38,6 +38,7 @@ 2.12 2.12.11 2.5.22 + 2.13.5 @@ -46,7 +47,7 @@ com.fasterxml.jackson.core jackson-databind - 2.10.5.1 + ${jackson.version} diff --git a/core/actor-core/pom.xml b/core/actor-core/pom.xml index e0c8c0b2f8..1d94f5577f 100644 --- a/core/actor-core/pom.xml +++ b/core/actor-core/pom.xml @@ -25,6 +25,7 @@ 1.6.1 1.0.7 2.5.22 + 2.13.5 @@ -55,12 +56,12 @@ com.fasterxml.jackson.core jackson-core - 2.10.5 + ${jackson.version} com.fasterxml.jackson.core jackson-databind - 2.10.5.1 + ${jackson.version} diff --git a/core/cassandra-utils/pom.xml b/core/cassandra-utils/pom.xml index 32564d93cb..6d3f6cfd22 100644 --- a/core/cassandra-utils/pom.xml +++ b/core/cassandra-utils/pom.xml @@ -20,6 +20,7 @@ UTF-8 1.1.1 3.7.0 + 2.13.5 @@ -54,7 +55,7 @@ com.fasterxml.jackson.core jackson-databind - 2.10.5.1 + ${jackson.version} org.sunbird diff --git a/core/notification-utils/pom.xml b/core/notification-utils/pom.xml index 267e135864..6f44e5d0fe 100644 --- a/core/notification-utils/pom.xml +++ b/core/notification-utils/pom.xml @@ -18,6 +18,7 @@ 11 11 UTF-8 + 2.13.5 @@ -53,7 +54,7 @@ com.fasterxml.jackson.core jackson-databind - 2.10.5.1 + ${jackson.version} org.sunbird diff --git a/core/platform-common/pom.xml b/core/platform-common/pom.xml index c269a05da9..08864575e3 100644 --- a/core/platform-common/pom.xml +++ b/core/platform-common/pom.xml @@ -22,6 +22,7 @@ UTF-8 2.5.22 2.7.2 + 2.13.5 org.sunbird cloud-store-sdk_2.12 1.4.6 @@ -52,17 +53,17 @@ com.fasterxml.jackson.core jackson-core - 2.10.5 + ${jackson.version} com.fasterxml.jackson.core jackson-databind - 2.10.5.1 + ${jackson.version} com.fasterxml.jackson.core jackson-annotations - 2.10.5 + ${jackson.version} com.typesafe.akka From bbd135abb4c7a4822762c5eb965cdf5197de7ded Mon Sep 17 00:00:00 2001 From: anilgupta Date: Mon, 18 Mar 2024 13:49:51 +0530 Subject: [PATCH 2/5] Issue #LR-739 chore: Upgraded the scala major version from 2.11 to 2.12 --- controller/pom.xml | 17 ++++++++++++++++- core/platform-common/pom.xml | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/controller/pom.xml b/controller/pom.xml index ff2a32c589..5ae07fd0bf 100644 --- a/controller/pom.xml +++ b/controller/pom.xml @@ -241,8 +241,23 @@ net.logstash.logback logstash-logback-encoder - 6.3 + 6.6 + + ch.qos.logback + logback-classic + 1.2.3 + + + ch.qos.logback + logback-core + 1.2.3 + + + + + + userorg-service-${version} diff --git a/core/platform-common/pom.xml b/core/platform-common/pom.xml index 08864575e3..6141220f25 100644 --- a/core/platform-common/pom.xml +++ b/core/platform-common/pom.xml @@ -73,7 +73,7 @@ net.logstash.logback logstash-logback-encoder - 6.3 + 6.6 com.googlecode.libphonenumber From ce866bd97805110b889a94bab184626261e3681f Mon Sep 17 00:00:00 2001 From: anilgupta Date: Mon, 18 Mar 2024 14:17:15 +0530 Subject: [PATCH 3/5] Issue #LR-739 chore: Upgraded the scala major version from 2.11 to 2.12 --- core/platform-common/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/platform-common/pom.xml b/core/platform-common/pom.xml index 6141220f25..4ba18005d1 100644 --- a/core/platform-common/pom.xml +++ b/core/platform-common/pom.xml @@ -130,10 +130,10 @@ com.sun.jersey jersey-server - - com.fasterxml.jackson.module - jackson-module-scala_${scala.major.version} - + + + + slf4j-log4j12 org.slf4j From e82ce9996d337e206abcedb5170ead4a0fa0a4b9 Mon Sep 17 00:00:00 2001 From: anilgupta Date: Mon, 18 Mar 2024 17:08:00 +0530 Subject: [PATCH 4/5] Issue #LR-739 chore: Upgraded the scala major version from 2.11 to 2.12 --- controller/conf/application.conf | 1 + core/platform-common/pom.xml | 28 +++++++++---------- .../resources/externalresource.properties | 1 + service/pom.xml | 5 ++++ service/src/main/resources/application.conf | 5 +++- .../actor/user/UserMergeActorTest.java | 25 ++++++++++------- .../resources/externalresource.properties | 3 +- 7 files changed, 42 insertions(+), 26 deletions(-) diff --git a/controller/conf/application.conf b/controller/conf/application.conf index a7c0bc1887..f037c48f53 100644 --- a/controller/conf/application.conf +++ b/controller/conf/application.conf @@ -8,6 +8,7 @@ akka { stdout-loglevel = "OFF" loglevel = "OFF" + jvm-exit-on-fatal-error = off log-config-on-start = off actor { provider = "akka.actor.LocalActorRefProvider" diff --git a/core/platform-common/pom.xml b/core/platform-common/pom.xml index 4ba18005d1..3639df6842 100644 --- a/core/platform-common/pom.xml +++ b/core/platform-common/pom.xml @@ -25,7 +25,7 @@ 2.13.5 org.sunbird cloud-store-sdk_2.12 - 1.4.6 + 1.4.7 @@ -38,7 +38,7 @@ org.jboss.resteasy resteasy-jackson2-provider - 3.1.3.Final + 3.14.0.Final com.fasterxml.jackson.core @@ -130,38 +130,38 @@ com.sun.jersey jersey-server - - - - slf4j-log4j12 org.slf4j - - log4j - log4j - io.netty * + + ch.qos.reload4j + reload4j + + + org.slf4j + slf4j-reload4j + org.apache.kafka kafka-clients - 0.10.2.2 + 3.4.0 org.jboss.resteasy jaxrs-api - 3.0.11.Final + 3.0.12.Final org.jboss.resteasy resteasy-client - 3.1.0.Final + 3.14.0.Final @@ -196,7 +196,7 @@ org.json json - 20200518 + 20231013 com.typesafe.play diff --git a/core/platform-common/src/main/resources/externalresource.properties b/core/platform-common/src/main/resources/externalresource.properties index 481e1508db..594cc0bc7b 100644 --- a/core/platform-common/src/main/resources/externalresource.properties +++ b/core/platform-common/src/main/resources/externalresource.properties @@ -111,3 +111,4 @@ userProfileConfigMap={\"type\":\"profileconfig\",\"subtype\":\"28\",\"action\":\ sunbird_userorg_keyspace=sunbird user-deletion-roles=public +user-deletion-broadcast-topic={{env_name}}.delete.user \ No newline at end of file diff --git a/service/pom.xml b/service/pom.xml index 0c45ac8dc0..cfecea7fd2 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -124,6 +124,11 @@ org.everit.json.schema 1.5.1 + + org.codehaus.jackson + jackson-mapper-asl + 1.9.13 + ${basedir}/src/main/java diff --git a/service/src/main/resources/application.conf b/service/src/main/resources/application.conf index 22b3e66922..ad32db8381 100644 --- a/service/src/main/resources/application.conf +++ b/service/src/main/resources/application.conf @@ -1,2 +1,5 @@ # This is the configuration file for the service folder. -AuthenticationEnabled=true \ No newline at end of file +AuthenticationEnabled=true +akka { + jvm-exit-on-fatal-error = off +} \ No newline at end of file diff --git a/service/src/test/java/org/sunbird/actor/user/UserMergeActorTest.java b/service/src/test/java/org/sunbird/actor/user/UserMergeActorTest.java index 8685039e39..95378d5a3d 100644 --- a/service/src/test/java/org/sunbird/actor/user/UserMergeActorTest.java +++ b/service/src/test/java/org/sunbird/actor/user/UserMergeActorTest.java @@ -1,17 +1,10 @@ package org.sunbird.actor.user; -import static akka.testkit.JavaTestKit.duration; -import static org.junit.Assert.assertTrue; -import static org.powermock.api.mockito.PowerMockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; - import akka.actor.ActorRef; import akka.actor.ActorSystem; import akka.actor.Props; import akka.testkit.javadsl.TestKit; import com.typesafe.config.Config; -import java.util.HashMap; -import java.util.Map; import org.apache.kafka.clients.producer.Producer; import org.junit.Before; import org.junit.Test; @@ -42,6 +35,14 @@ import org.sunbird.util.DataCacheHandler; import org.sunbird.util.user.KafkaConfigConstants; +import java.time.Duration; +import java.util.HashMap; +import java.util.Map; + +import static org.junit.Assert.assertTrue; +import static org.powermock.api.mockito.PowerMockito.mock; +import static org.powermock.api.mockito.PowerMockito.when; + @RunWith(PowerMockRunner.class) @PrepareForTest({ SSOServiceFactory.class, @@ -61,7 +62,11 @@ "javax.net.ssl.*", "javax.security.*", "jdk.internal.reflect.*", - "javax.crypto.*" + "javax.crypto.*", + "javax.script.*", + "javax.xml.*", + "com.sun.org.apache.xerces.*", + "org.xml.*" }) @SuppressStaticInitializationFor("org.sunbird.kafka.KafkaClient") public class UserMergeActorTest { @@ -184,11 +189,11 @@ public boolean testScenario(Request reqObj, ResponseCode errorCode) { subject.tell(reqObj, probe.getRef()); if (errorCode == null) { - Response res = probe.expectMsgClass(duration("10 second"), Response.class); + Response res = probe.expectMsgClass(Duration.ofSeconds(10), Response.class); return null != res && res.getResponseCode() == ResponseCode.OK; } else { ProjectCommonException res = - probe.expectMsgClass(duration("10 second"), ProjectCommonException.class); + probe.expectMsgClass(Duration.ofSeconds(10), ProjectCommonException.class); return res.getResponseCode().name().equals(errorCode.name()) || res.getErrorResponseCode() == errorCode.getResponseCode(); } diff --git a/service/src/test/resources/externalresource.properties b/service/src/test/resources/externalresource.properties index f1f922481a..f939819ed3 100644 --- a/service/src/test/resources/externalresource.properties +++ b/service/src/test/resources/externalresource.properties @@ -109,4 +109,5 @@ sunbird_password_reset_login_page_url=/resources isFormValidationRequired=true userProfileConfigMap={\"type\":\"profileconfig\",\"subtype\":\"28\",\"action\":\"get\",\"component\":\"*\",\"framework\":\"*\",\"data\":{\"templateName\":\"profileConfig_v2\",\"action\":\"get\",\"fields\":[{\"code\":\"persona\",\"children\":{\"administrator\":[{\"code\":\"district\"},{\"code\":\"state\"},{\"code\":\"subPersona\",\"type\":\"select\",\"default\":null,\"templateOptions\":{\"options\":[{\"label\":\"Headmaster\",\"value\":\"hm\"},{\"label\":\"Cluster Resource Person\",\"value\":\"crp\"}]}},{\"code\":\"block\"},{\"code\":\"cluster\"},{\"code\":\"school\"}],\"teacher\":[{\"code\":\"state\"},{\"code\":\"district\"},{\"code\":\"block\"},{\"code\":\"cluster\"},{\"code\":\"school\"}],\"student\":[{\"code\":\"state\"},{\"code\":\"district\"},{\"code\":\"block\"},{\"code\":\"cluster\"},{\"code\":\"school\"}],\"parent\":[{\"code\":\"state\"},{\"code\":\"district\"},{\"code\":\"block\"},{\"code\":\"cluster\"},{\"code\":\"school\"}],\"other\":[{\"code\":\"state\"},{\"code\":\"district\"},{\"code\":\"subPersona\",\"templateOptions\":{\"options\":[{\"value\":\"Doctor (Allopathy)\",\"label\":\"Doctor (Allopathy)\"},{\"value\":\"AYUSH Professional\",\"label\":\"AYUSH Professional\"}]}},{\"code\":\"block\"},{\"code\":\"cluster\"},{\"code\":\"school\"}]}}]},\"created_on\":\"2022-02-10T14:16:51.852Z\",\"last_modified_on\":\"2022-11-14T05:45:02.685Z\",\"rootOrgId\":\"*\"} sunbird_userorg_keyspace=sunbird -sunbird_cloud_service_provider=azure \ No newline at end of file +sunbird_cloud_service_provider=azure +user-deletion-broadcast-topic=local.delete.user \ No newline at end of file From 321ce98b8d62a2cdf9e802d693756a6b232d4e88 Mon Sep 17 00:00:00 2001 From: anilgupta Date: Mon, 18 Mar 2024 17:10:40 +0530 Subject: [PATCH 5/5] Issue #LR-739 chore: Upgraded the scala major version from 2.11 to 2.12 --- Dockerfile.Build | 2 +- Jenkinsfile | 2 +- README.md | 2 +- setup.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile.Build b/Dockerfile.Build index 6697420cdf..3c09e4a626 100644 --- a/Dockerfile.Build +++ b/Dockerfile.Build @@ -10,6 +10,6 @@ ENV M2_HOME /opt/apache-maven-3.3.9 ENV PATH ${M2_HOME}/bin:${PATH} COPY userorg /opt/userorg/ WORKDIR /opt/userorg/services -RUN mvn clean install -DskipTests -DCLOUD_STORE_GROUP_ID=org.sunbird -DCLOUD_STORE_ARTIFACT_ID=cloud-store-sdk_2.12 -DCLOUD_STORE_VERSION=1.4.6 +RUN mvn clean install -DskipTests -DCLOUD_STORE_GROUP_ID=org.sunbird -DCLOUD_STORE_ARTIFACT_ID=cloud-store-sdk_2.12 -DCLOUD_STORE_VERSION=1.4.7 WORKDIR /opt/userorg/services/userorg-service CMD ["mvn", "play2:dist"] \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index bfa54707b8..effbb86f80 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,7 +30,7 @@ node('build-slave') { } stage('Unit Tests') { - sh "mvn clean install '-Dtest=!%regex[io.opensaber.registry.client.*]' -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false -DCLOUD_STORE_GROUP_ID=org.sunbird -DCLOUD_STORE_ARTIFACT_ID=cloud-store-sdk_2.12 -DCLOUD_STORE_VERSION=1.4.6" + sh "mvn clean install '-Dtest=!%regex[io.opensaber.registry.client.*]' -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false -DCLOUD_STORE_GROUP_ID=org.sunbird -DCLOUD_STORE_ARTIFACT_ID=cloud-store-sdk_2.12 -DCLOUD_STORE_VERSION=1.4.7" } stage('Package') { dir('controller') { diff --git a/README.md b/README.md index 6c2f0215f5..b4f7a5d7bf 100644 --- a/README.md +++ b/README.md @@ -219,7 +219,7 @@ git clone https://github.com/Sunbird-Lern/sunbird-lms-service.git 3. Build the application using the following maven command in the path `/sunbird-lms-service`: ```shell -mvn clean install -DskipTests -DCLOUD_STORE_GROUP_ID=org.sunbird -DCLOUD_STORE_ARTIFACT_ID=cloud-store-sdk_2.12 -DCLOUD_STORE_VERSION=1.4.6 +mvn clean install -DskipTests -DCLOUD_STORE_GROUP_ID=org.sunbird -DCLOUD_STORE_ARTIFACT_ID=cloud-store-sdk_2.12 -DCLOUD_STORE_VERSION=1.4.7 ``` Make sure the build is successful before proceeding to the next step. If the build is not successful, fix any configuration issues and rebuild the application. diff --git a/setup.md b/setup.md index 76efcfab9d..06bb773a0c 100644 --- a/setup.md +++ b/setup.md @@ -78,7 +78,7 @@ ## Build 1. Run "git submodule foreach git pull origin master" to pull the latest sunbird-common submodule. -2. Run "mvn clean install -DCLOUD_STORE_GROUP_ID=org.sunbird -DCLOUD_STORE_ARTIFACT_ID=cloud-store-sdk_2.12 -DCLOUD_STORE_VERSION=1.4.6" to build the services. +2. Run "mvn clean install -DCLOUD_STORE_GROUP_ID=org.sunbird -DCLOUD_STORE_ARTIFACT_ID=cloud-store-sdk_2.12 -DCLOUD_STORE_VERSION=1.4.7" to build the services. 2. Go to "controller" and run the command "mvn play2:dist" to generate the dist file for controller. 3. The build file "controller-1.0-SNAPSHOT-dist.zip" is generated in "userorg-service/controller/target" folder.