Steps to test MOSIP authentication

Greetings !

I am following this Steps to test MOSIP authentication https://mosip.atlassian.net/wiki/spaces/MSD/pages/892796967/Steps+to+test+MOSIP+authentication

I am right in assuming this needs to be installed in the machine also used as regclient, because that is where Mock MDS is running ?

Also are there more materials/tutorials regarding the installation of Postman? A more detailed step by step procedure on how to do 2). Install postman and import the collection attached in prerequisites. ?

Thank you so much.

Yes, your assumptions are correct. But you should run the MDS/SBI in the authentication mode

Need more help in this. In this post https://mosip.atlassian.net/wiki/spaces/MSD/pages/892796967/Steps+to+test+MOSIP+authentication

the link to Authentication Demo UI: https://github.com/mosip/mosip-ref-impl/tree/develop/authentication-demo-ui

is not working, results to page not found 404 error message

Can anyone provide me with the correct link?

Aside from the correct link for Authentication Demo UI , I also need help locating the file application.properties referred to in step c. Change the URL in the application.properties

I have successfully run mvn clean install, yet I could not find this file in the entire mosip-functional-tests-1.2.0.1-B1 directory.

In addition, a step by step tutorial for step 2 would really be useful and greatly appreciated

2. Install the postman and import the collection attached in the prerequisites

Thank you very much for your kind assistance and generous support.

1 Like

@rcsampang , The authentication-demo-ui is now moved to a separate repository: GitHub - mosip/authentication-demo-ui at develop

Regarding the authentication-demo-service, that application.properties can be found from the resource folder… mosip-functional-tests/authentication-demo-service/src/main/resources at develop · mosip/mosip-functional-tests · GitHub

I have updated these information to the confluence page also.

Postman can be downloaded from : Download Postman | Get Started for Free
And details on how to import a collection can be referred in: Importing and exporting data | Postman Learning Center.

@LoganathanSekar7627 Thank you very much.

However, I am having issues. Let us say my Mosip url is https://mymosip.edu.ph and my api-internal is https:api-internal.mymosip.edu.ph

So, in the application.properties I should edit it to :
mosip.base.url=${mymosip.edu.ph}

So I edited this file and save it after running mvn clean install, right?

I change directory to the directory - target

cd C:\Users\mosip\mosip-functional-tests-develop\authentication-demo-service\target

Then I run :

java -Denv.user=mymosip -Denv.endpoint=https://mymosip.edu.ph -Denv.testLevel=smoke -Dspring.profiles.active=qa -jar authentication-demo-service-1.2.0-SNAPSHOT.jar

I encountered an error:
Error: Could not find or load main class .user=mymosip
Caused by: java.lang.ClassNotFoundException: /user=mymosip
PS C:\Users\UP\Desktop\mosip-functional-tests-develop\authentication-demo-service>

What am I missing?

Hi @rcsampang , Please make a copy of the application.properties and put it next to the jar file and update it as needed. No need to rebuild of jar.

Even you don’t need to edit that file if you pass the required VM arguments when you run. For example below is the sample VM arguments.

-Dmosip.api.internal.url=https://api-internal.dev.mosip.net -Dmosip_resident_client_secret=eDVSziCvapyEhF1u

I think the other VM arguments you specified are not relevant to authentication-demo-service, they are for automation-test I think, you can ignore them.

Hi @LoganathanSekar7627 ! I tried running the command -
java -Dmosip.api.internal.url=https://api-internal.mymosip.edu.ph -Dmosip_resident_client_secret=ai3IXgjwZkukc7lA -jar authentication-demo-service-1.2.0-SNAPSHOT.jar

Error Java class not found

Error: Could not find or load main class .api.internal.url=https:…api-internal.mymosip.edu.ph

I copied the application.properties to the target directory next to the jar file and edited/updated it to use my domain.

No success. Same error.

Hi @rcsampang , I think there is issue with framing the command due to the VM args. Please try putting it in double quotes like below:

java -Dmosip.api.internal.url="https://api-internal.mymosip.edu.ph" -Dmosip_resident_client_secret=ai3IXgjwZkukc7lA -jar authentication-demo-service-1.2.0-SNAPSHOT.jar

Or, instead of having two these are VM arguments put them in the application.properties and remove it from VM arguments and then run the command.

mosip.api.internal.url=https://api-internal.mymosip.edu.ph"
mosip_resident_client_secret=ai3IXgjwZkukc7lA
java -jar authentication-demo-service-1.2.0-SNAPSHOT.jar

@LoganathanSekar7627 Sorry I got sick and wasn’t able to respond sooner.

I installed Lombok (read in the documentation that it is needed) and run mvn clean install again

Then I followed your instructions:

I changed the commands to put in double qoutes - same error

Error: Could not find or load main class .api.internal.url=https:…api-internal.mymosip.edu.ph
Caused by: java.lang.ClassNotFoundException: /api/internal/url=https://api-internal/mymosip/edu/ph

I also put the arguments in the application.properties

Here is the complete logfile

PS C:\Users\UP\Desktop\mosip-functional-tests-develop\authentication-demo-service\target> java -jar authentication-demo-service-1.2.1-SNAPSHOT.jar
15:32:25,483 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
15:32:25,491 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
15:32:25,516 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/C:/Users/UP/Desktop/mosip-functional-tests-develop/authentication-demo-service/target/authentication-demo-service-1.2.1-SNAPSHOT.jar!/BOOT-INF/lib/kernel-templatemanager-velocity-1.2.0.1-B1.jar!/logback.xml]
15:32:25,678 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs multiple times on the classpath.
15:32:25,678 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Users/UP/Desktop/mosip-functional-tests-develop/authentication-demo-service/target/authentication-demo-service-1.2.1-SNAPSHOT.jar!/BOOT-INF/lib/kernel-pdfgenerator-itext-1.2.0.1-B1.jar!/logback.xml]
15:32:25,678 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Users/UP/Desktop/mosip-functional-tests-develop/authentication-demo-service/target/authentication-demo-service-1.2.1-SNAPSHOT.jar!/BOOT-INF/lib/kernel-templatemanager-velocity-1.2.0.1-B1.jar!/logback.xml]
15:32:25,678 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Users/UP/Desktop/mosip-functional-tests-develop/authentication-demo-service/target/authentication-demo-service-1.2.1-SNAPSHOT.jar!/BOOT-INF/lib/kernel-keymanager-service-1.2.0.1-B2-lib.jar!/logback.xml]
15:32:25,705 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@4461c7e3 - URL [jar:file:/C:/Users/UP/Desktop/mosip-functional-tests-develop/authentication-demo-service/target/authentication-demo-service-1.2.1-SNAPSHOT.jar!/BOOT-INF/lib/kernel-templatemanager-velocity-1.2.0.1-B1.jar!/logback.xml] is not of type file
15:32:26,201 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
15:32:26,204 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
15:32:26,224 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
15:32:26,234 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
15:32:26,304 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
15:32:26,304 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
15:32:26,304 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
15:32:26,307 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@351d0846 - Registering current configuration as safe fallback point

2023-05-22 15:32:28,895 [main] INFO [o.s.c.s.AbstractApplicationContext].prepareRefresh.590 : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@37f1104d: startup date [Mon May 22 15:32:28 CST 2023]; root of context hierarchy
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (jar:file:/C:/Users/UP/Desktop/mosip-functional-tests-develop/authentication-demo-service/target/authentication-demo-service-1.2.1-SNAPSHOT.jar!/BOOT-INF/lib/spring-core-5.0.6.RELEASE.jar!/) to method java.lang.ClassLoader.defineClass(java.lang.String,byte,int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2023-05-22 15:32:29,511 [main] INFO [o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker].postProcessAfterInitialization.328 : Bean ‘configurationPropertiesRebinderAutoConfiguration’ of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$74734ee] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

. ____ _ __ _ _
/\ / ’ __ _ () __ __ _ \ \ \
( ( )_
_ | '_ | '| | ’ / ` | \ \ \
\/ )| |)| | | | | || (| | ) ) ) )
’ |
| .__|| ||| |_, | / / / /
=========|
|==============|/=////
:: Spring Boot :: (v2.0.2.RELEASE)

2023-05-22 15:32:30,210 [main] WARN [o.s.c.c.c.ConfigServicePropertySourceLocator].locate.140 : Could not locate PropertySource: Invalid URL: localhost
2023-05-22 15:32:30,222 [main] INFO [o.s.b.SpringApplication].logStartupProfileInfo.663 : The following profiles are active: local
2023-05-22 15:32:30,278 [main] INFO [o.s.c.s.AbstractApplicationContext].prepareRefresh.590 : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@bb9e6dc: startup date [Mon May 22 15:32:30 CST 2023]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@37f1104d
2023-05-22 15:32:33,159 [main] INFO [o.s.b.f.s.DefaultListableBeanFactory].registerBeanDefinition.824 : 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]]
2023-05-22 15:32:33,670 [main] INFO [o.s.c.c.s.GenericScope].setSerializationId.294 : BeanFactory id=3d4934a5-6b26-3a34-97f9-669900cd84cf
2023-05-22 15:32:34,542 [main] INFO [o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker].postProcessAfterInitialization.328 : Bean ‘org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration’ of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$eb2d31f1] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-05-22 15:32:34,697 [main] INFO [o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker].postProcessAfterInitialization.328 : Bean ‘org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration’ of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$74734ee] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-05-22 15:32:35,765 [main] INFO [o.s.b.w.e.t.TomcatWebServer].initialize.91 : Tomcat initialized with port(s): 8082 (http)
2023-05-22 15:32:35,841 [main] INFO [o.a.j.l.DirectJDKLog].log.173 : Initializing ProtocolHandler [“http-nio-8082”]
2023-05-22 15:32:35,894 [main] INFO [o.a.j.l.DirectJDKLog].log.173 : Starting service [Tomcat]
2023-05-22 15:32:35,896 [main] INFO [o.a.j.l.DirectJDKLog].log.173 : Starting Servlet Engine: Apache Tomcat/8.5.55
2023-05-22 15:32:35,927 [localhost-startStop-1] INFO [o.a.j.l.DirectJDKLog].log.173 : The Apache Tomcat Native library which allows using OpenSSL was not found on the java.library.path: [C:\Program Files\Java\jdk-11.0.14\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\PuTTY;C:\Program Files\Git\cmd;C:\Program Files\Java\jdk-11.0.14\bin;C:\Users\dcsito2\opt\maven385\bin;C:\Program Files\Inkscape\bin;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files\dotnet;C:\Program Files\OpenSSL-Win64\bin;C:\Users\UP\AppData\Local\Microsoft\WindowsApps;C:\Program Files\apache-maven-3.8.6\bin;.]
2023-05-22 15:32:36,181 [localhost-startStop-1] INFO [o.a.j.l.DirectJDKLog].log.173 : Initializing Spring embedded WebApplicationContext
2023-05-22 15:32:36,181 [localhost-startStop-1] INFO [o.s.b.w.s.c.ServletWebServerApplicationContext].prepareWebApplicationContext.285 : Root WebApplicationContext: initialization completed in 5903 ms
2023-05-22 15:32:39,928 [localhost-startStop-1] INFO [o.s.b.w.s.AbstractFilterRegistrationBean].configure.244 : Mapping filter: ‘characterEncodingFilter’ to: [/]
2023-05-22 15:32:39,929 [localhost-startStop-1] INFO [o.s.b.w.s.AbstractFilterRegistrationBean].configure.244 : Mapping filter: ‘tracingFilter’ to: [/
]
2023-05-22 15:32:39,931 [localhost-startStop-1] INFO [o.s.b.w.s.AbstractFilterRegistrationBean].configure.244 : Mapping filter: ‘exceptionLoggingFilter’ to: [/]
2023-05-22 15:32:39,935 [localhost-startStop-1] INFO [o.s.b.w.s.AbstractFilterRegistrationBean].configure.244 : Mapping filter: ‘hiddenHttpMethodFilter’ to: [/
]
2023-05-22 15:32:39,937 [localhost-startStop-1] INFO [o.s.b.w.s.AbstractFilterRegistrationBean].configure.244 : Mapping filter: ‘httpPutFormContentFilter’ to: [/]
2023-05-22 15:32:39,938 [localhost-startStop-1] INFO [o.s.b.w.s.AbstractFilterRegistrationBean].configure.244 : Mapping filter: ‘requestContextFilter’ to: [/
]
2023-05-22 15:32:39,940 [localhost-startStop-1] INFO [o.s.b.w.s.AbstractFilterRegistrationBean].configure.244 : Mapping filter: ‘multipleReadRequestBodyFilter’ to: [/]
2023-05-22 15:32:39,942 [localhost-startStop-1] INFO [o.s.b.w.s.AbstractFilterRegistrationBean].configure.244 : Mapping filter: ‘httpTraceFilter’ to: [/
]
2023-05-22 15:32:39,947 [localhost-startStop-1] INFO [o.s.b.w.s.AbstractFilterRegistrationBean].configure.244 : Mapping filter: ‘intentVerificationFilter’ to: [/]
2023-05-22 15:32:39,947 [localhost-startStop-1] INFO [o.s.b.w.s.AbstractFilterRegistrationBean].configure.244 : Mapping filter: ‘webMvcMetricsFilter’ to: [/
]
2023-05-22 15:32:39,948 [localhost-startStop-1] INFO [o.s.b.w.s.ServletRegistrationBean].addRegistration.185 : Servlet dispatcherServlet mapped to [/]
2023-05-22 15:32:40,249 [main] INFO [c.z.h.HikariDataSource].getConnection.110 : HikariPool-1 - Starting…
2023-05-22 15:32:40,798 [main] INFO [c.z.h.HikariDataSource].getConnection.123 : HikariPool-1 - Start completed.
2023-05-22 15:32:40,932 [main] INFO [o.s.o.j.LocalContainerEntityManagerFactoryBean].createNativeEntityManagerFactory.361 : Building JPA container EntityManagerFactory for persistence unit ‘default’
2023-05-22 15:32:41,011 [main] INFO [o.h.j.i.u.LogHelper].logPersistenceUnitInformation.31 : HHH000204: Processing PersistenceUnitInfo [
name: default
…]
2023-05-22 15:32:41,428 [main] INFO [o.h.Version].logVersion.45 : HHH000412: Hibernate Core {5.2.17.Final}
2023-05-22 15:32:41,437 [main] INFO [o.h.c.Environment]..213 : HHH000206: hibernate.properties not found
2023-05-22 15:32:41,658 [main] INFO [o.h.a.c.r.j.JavaReflectionManager]..66 : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
2023-05-22 15:32:43,769 [main] INFO [o.h.d.Dialect]..157 : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
2023-05-22 15:32:44,553 [main] INFO [o.h.t.s.i.SchemaCreatorImpl].applyImportSources.489 : HHH000476: Executing import script ‘org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl@a098d76’
2023-05-22 15:32:44,562 [main] INFO [o.s.o.j.AbstractEntityManagerFactoryBean].buildNativeEntityManagerFactory.415 : Initialized JPA EntityManagerFactory for persistence unit ‘default’
2023-05-22 15:32:45,093 [main] WARN [o.s.c.s.AbstractApplicationContext].refresh.558 : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘authRequestController’: Unsatisfied dependency expressed through field ‘encrypt’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘encrypt’: Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder ‘api-internal.mymosip.edu.ph’ in value “${api-internal.mymosip.edu.ph}”
2023-05-22 15:32:45,096 [main] INFO [o.s.o.j.AbstractEntityManagerFactoryBean].destroy.597 : Closing JPA EntityManagerFactory for persistence unit ‘default’
2023-05-22 15:32:45,100 [main] INFO [o.h.t.s.i.SchemaDropperImpl$DelayedDropActionImpl].perform.524 : HHH000477: Starting delayed drop of schema as part of SessionFactory shut-down’
2023-05-22 15:32:45,106 [main] INFO [c.z.h.HikariDataSource].close.381 : HikariPool-1 - Shutdown initiated…
2023-05-22 15:32:45,112 [main] INFO [c.z.h.HikariDataSource].close.383 : HikariPool-1 - Shutdown completed.
2023-05-22 15:32:45,114 [main] INFO [o.a.j.l.DirectJDKLog].log.173 : Stopping service [Tomcat]
2023-05-22 15:32:45,181 [main] INFO [o.s.b.a.l.ConditionEvaluationReportLoggingListener].logAutoConfigurationReport.101 :

Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2023-05-22 15:32:45,188 [main] ERROR [o.s.b.SpringApplication].reportFailure.842 : Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘authRequestController’: Unsatisfied dependency expressed through field ‘encrypt’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘encrypt’: Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder ‘api-internal.mymosip.edu.ph’ in value “${api-internal.mymosip.edu.ph}”
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:587)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:91)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:373)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1348)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:578)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243)
at io.mosip.authentication.demo.service.PartnerDemoApplication.main(PartnerDemoApplication.java:27)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:593)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘encrypt’: Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder ‘api-internal.mymosip.edu.ph’ in value “${api-internal.mymosip.edu.ph}”
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:379)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1348)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:578)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:251)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1065)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:584)
… 27 common frames omitted
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder ‘api-internal.mymosip.edu.ph’ in value “${api-internal.mymosip.edu.ph}”
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:172)
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:160)
at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:124)
at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:237)
at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:211)
at org.springframework.core.env.AbstractPropertyResolver.resolveNestedPlaceholders(AbstractPropertyResolver.java:228)
at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:88)
at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:62)
at org.springframework.core.env.AbstractEnvironment.getProperty(AbstractEnvironment.java:531)
at org.springframework.context.support.PropertySourcesPlaceholderConfigurer$1.getProperty(PropertySourcesPlaceholderConfigurer.java:137)
at org.springframework.context.support.PropertySourcesPlaceholderConfigurer$1.getProperty(PropertySourcesPlaceholderConfigurer.java:133)
at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:85)
at org.springframework.core.env.PropertySourcesPropertyResolver.getPropertyAsRawString(PropertySourcesPropertyResolver.java:74)
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:145)
at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:124)
at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:237)
at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:211)
at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.lambda$processProperties$0(PropertySourcesPlaceholderConfigurer.java:175)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:839)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1086)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1065)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:584)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:91)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:373)
… 38 common frames omitted

Dear @rcsampang

for First Error, you have executed below command
java -Dmosip.api.internal.url=https://api-internal.mymosip.edu.ph -Dmosip_resident_client_secret=ai3IXgjwZkukc7lA -jar authentication-demo-service-1.2.0-SNAPSHOT.jar

But i observed from your second error log that jar file name is
java -jar authentication-demo-service-1.2.1-SNAPSHOT.jar

So here jar file name is wrong. so request you to use updated command for the same
java -Dmosip.api.internal.url=https://api-internal.mymosip.edu.ph/ -Dmosip_resident_client_secret=ai3IXgjwZkukc7lA -jar authentication-demo-service-1.2.1-SNAPSHOT.jar

For Second Error, in log i am seeing following error line

So here there is wrong configuration in property file. Request you to share the properties which are modified

Thank you

@thamarai_kannan Hello.

Good catch there. Yes in my previous commands I was using authentication-demo-service-1.2.0-SNAPSHOT.jar

But I did eventually edited it so I could use the latest build authentication-demo-service-1.2.1-SNAPSHOT.jar

To be sure I issue the command again with the latest version 1.2.1 -

java -Dmosip.api.internal.url=https://api-internal.mymosip.edu.ph -Dmosip_resident_client_secret=ai3IXgjwZkukc7lA -jar authentication-demo-service-1.2.1-SNAPSHOT.jar

I find the same error

Error: Could not find or load main class .api.internal.url=https:…api-internal.mymosip.edu.ph
Caused by: java.lang.ClassNotFoundException: /api/internal/url=https://api-internal/mymosip/edu/ph

Here is the entry I added at the application.properties

mosip.base.url=${api-internal.mymosip.edu.ph}
mosip.api.internal.url=${“https://api-internal.mymosip.edu.ph”}
mosip_resident_client_secret=ai3IXgjwZkukc7lA

I aslo tried this command after editing application.properties as per instruction

java -jar authentication-demo-service-1.2.1-SNAPSHOT.jar

similar errors

    ... 27 common frames omitted

Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder ‘api-internal.mymosip.edu.ph’ in value “${api-internal.mymosip.edu.ph}”
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:172)
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:160)
at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:124)
at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:237

Dear @rcsampang

above properties is wrong. Please use the below one

mosip.base.url=api-internal.mymosip.edu.ph
mosip.api.internal.url=https://api-internal.mymosip.edu.ph
mosip_resident_client_secret=ai3IXgjwZkukc7lA

1 Like

Dear @rcsampang

Please try the below command

java -jar -Dmosip.api.internal.url=https://api-internal.mymosip.edu.ph -Dmosip_resident_client_secret=ai3IXgjwZkukc7lA authentication-demo-service-1.2.1-SNAPSHOT.jar

1 Like

@thamarai_kannan Thank you. Looks like it is running now

…
2023-06-01 11:45:24,940 [main] INFO [o.a.j.l.DirectJDKLog].log.173 : Starting ProtocolHandler [“http-nio-8082”]
2023-06-01 11:45:25,031 [main] INFO [o.a.j.l.DirectJDKLog].log.173 : Using a shared selector for servlet write/read
2023-06-01 11:45:25,066 [main] INFO [o.s.b.w.e.t.TomcatWebServer].start.206 : Tomcat started on port(s): 8082 (http) with context path ‘/v1/identity’
2023-06-01 11:45:25,073 [main] INFO [o.s.b.StartupInfoLogger].logStarted.59 : Started PartnerDemoApplication in 18.558 seconds (JVM running for 19.755)

1 Like