Error while setup of pre-registration module

Hello, We are following the guidelines given in Pre-registration Developers Guide - MOSIP Docs 1.2.0 to setup preregistration module for developers. We are getting following error
.git directory is not found! Please specify a valid [dotGitDirectory] in your pom.xml

We have tried setting failOnNoGitDirectory to false in pom file and creating .git folder manually, still we are getting this error in pre-registration-core

Please suggest a solution to resolve this issue. Thanks in advance!

Did you clone the repo? I think git commit id plugin is trying to get the build version and it’s unable to detect the details.

Can you please clone the repo and follow the steps. This will ensure that you are working on the correct version of the code, auto versioning from git commit id plugin can work

when I run as maven install then lambok fatal error appear. error msg is
class lombok.javac.apt.LombokProcessor (in unnamed module @0x24292cf) cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.processing to unnamed module @0x24292cf . please help me . i was share with screenshot of error.

Looks like you are using Java 18 ? Our recommended version is java 11

ok, currently i follow the steps according to guideline. when i run this command mvn clean install -Dgpg.skip=true in CMD then got pre-registration failed or skipped. i share screenshot with you.

Hi

Can you please use JDK 11? This error may come if you are using JDK 17/18.
Hope that helps.

~Mayura

I am using JDK 11. when i delete the test data then mvn clean install -Dgpg.skip=true command execute successfully. I got new error when build and run the Project. i share screenshot with you.

ERROR in ch.qos.logback.core.joran.spi.Interpreter@2:86 - no applicable action for [springProperty], current ElementPath is [[configuration][springProperty]]

“message”:“Application run failed”,“logger_name”:“org.springframework.boot.SpringApplication”,“thread_name”:“restartedMain”,“level”:“ERROR”,“level_value”:40000,“stack_trace”:“java.lang.IllegalStateException: Cannot load configuration class: org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration\r\n\tat org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:414)\r\n\tat org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:254)\r\n\tat org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:284)\r\n\tat org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:128)\r\n\tat org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:694)\r\n\tat org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532)\r\n\tat org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)\r\n\tat org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395)\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:327)\r\n\tat org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:137)\r\n\tat org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:197)\r\n\tat org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:104)\r\n\tat org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:70)\r\n\tat org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)\r\n\tat org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)\r\n\tat org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)\r\n\tat org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)\r\n\tat org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74)\r\n\tat org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)\r\n\tat org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:358)\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:317)\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1255)\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1243)\r\n\tat io.mosip.preregistration.application.PreRegistrationApplication.main(PreRegistrationApplication.java:23)\r\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)\r\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:568)\r\n\tat org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)\r\nCaused by: java.lang.ExceptionInInitializerError: null\r\n\tat org.springframework.context.annotation.ConfigurationClassEnhancer.newEnhancer(ConfigurationClassEnhancer.java:122)\r\n\tat org.springframework.context.annotation.ConfigurationClassEnhancer.enhance(ConfigurationClassEnhancer.java:110)\r\n\tat org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:403)\r\n\t… 28 common frames omitted\r\nCaused by: org.springframework.cglib.core.CodeGenerationException: java.lang.reflect.InaccessibleObjectException–>Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte,int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @12ed9db6\r\n\tat org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:464)\r\n\tat org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:336)\r\n\tat org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:93)\r\n\tat org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:91)\r\n\tat org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54)\r\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\r\n\tat org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61)\r\n\tat org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34)\r\n\tat org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:116)\r\n\tat org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:291)\r\n\tat org.springframework.cglib.core.KeyFactory$Generator.create(KeyFactory.java:221)\r\n\tat org.springframework.cglib.core.KeyFactory.create(KeyFactory.java:174)\r\n\tat org.springframework.cglib.core.KeyFactory.create(KeyFactory.java:153)\r\n\tat org.springframework.cglib.proxy.Enhancer.(Enhancer.java:73)\r\n\t… 31 common frames omitted\r\nCaused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte,int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @12ed9db6\r\n\tat java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)\r\n\tat java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)\r\n\tat java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)\r\n\tat java.base/java.lang.reflect.Method.setAccessible(Method.java:193)\r\n\tat org.springframework.cglib.core.ReflectUtils$1.run(ReflectUtils.java:61)\r\n\tat java.base/java.security.AccessController.doPrivileged(AccessController.java:569)\r\n\tat org.springframework.cglib.core.ReflectUtils.(ReflectUtils.java:52)\r\n\tat org.springframework.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:243)\r\n\tat org.springframework.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)\r\n\tat org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:329)\r\n\t… 43 common frames omitted\r\n”,“appName”:“pre-registration-application-service”

“message”:“Application run failed”,“logger_name”:“org.springframework.boot.SpringApplication”,“thread_name”:“restartedMain”,“level”:“ERROR”,“level_value”:40000,“stack_trace”:“java.lang.IllegalStateException: Cannot load configuration class: org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration\r\n\tat org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:414)\r\n\tat org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:254)\r\n\tat org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:284)\r\n\tat org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:128)\r\n\tat org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:694)\r\n\tat org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532)\r\n\tat org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)\r\n\tat org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395)\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:327)\r\n\tat org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:137)\r\n\tat org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:197)\r\n\tat org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:104)\r\n\tat org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:70)\r\n\tat org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)\r\n\tat org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)\r\n\tat org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)\r\n\tat org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)\r\n\tat org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74)\r\n\tat org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)\r\n\tat org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:358)\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:317)\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1255)\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1243)\r\n\tat io.mosip.preregistration.application.PreRegistrationApplication.main(PreRegistrationApplication.java:23)\r\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)\r\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:568)\r\n\tat org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)\r\nCaused by: java.lang.ExceptionInInitializerError: null\r\n\tat org.springframework.context.annotation.ConfigurationClassEnhancer.newEnhancer(ConfigurationClassEnhancer.java:122)\r\n\tat org.springframework.context.annotation.ConfigurationClassEnhancer.enhance(ConfigurationClassEnhancer.java:110)\r\n\tat org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:403)\r\n\t… 28 common frames omitted\r\nCaused by: org.springframework.cglib.core.CodeGenerationException: java.lang.reflect.InaccessibleObjectException–>Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte,int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @12ed9db6\r\n\tat org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:464)\r\n\tat org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:336)\r\n\tat org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:93)\r\n\tat org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:91)\r\n\tat org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54)\r\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\r\n\tat org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61)\r\n\tat org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34)\r\n\tat org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:116)\r\n\tat org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:291)\r\n\tat org.springframework.cglib.core.KeyFactory$Generator.create(KeyFactory.java:221)\r\n\tat org.springframework.cglib.core.KeyFactory.create(KeyFactory.java:174)\r\n\tat org.springframework.cglib.core.KeyFactory.create(KeyFactory.java:153)\r\n\tat org.springframework.cglib.proxy.Enhancer.(Enhancer.java:73)\r\n\t… 31 common frames omitted\r\nCaused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte,int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @12ed9db6\r\n\tat java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)\r\n\tat java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)\r\n\tat java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)\r\n\tat java.base/java.lang.reflect.Method.setAccessible(Method.java:193)\r\n\tat org.springframework.cglib.core.ReflectUtils$1.run(ReflectUtils.java:61)\r\n\tat java.base/java.security.AccessController.doPrivileged(AccessController.java:569)\r\n\tat org.springframework.cglib.core.ReflectUtils.(ReflectUtils.java:52)\r\n\tat org.springframework.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:243)\r\n\tat org.springframework.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)\r\n\tat org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:329)\r\n\t… 43 common frames omitted\r\n”,“appName”:“pre-registration-application-service”

I am using jdk 11. when i run and build the project then got error. i shared a error screenshot with you.

Hi,
I have noted down few more steps/points that you can refer to:

  1. In case u are getting build err with JDK 11, you can downgrade <maven.surefire.plugin.version>2.22.0</maven.surefire.plugin.version>
    to <maven.surefire.plugin.version>2.20</maven.surefire.plugin.version> in /pre-registration/pom.xml and try “mvn clean install -Dgpg.skip”.

  2. After Maven build success, import the parent “pre-registration” maven project in IDE. This will import all the nested projects too.

  3. Download lombok.jar and install it as a plugin for IDE. Add the lombok.jar in classpath for all nested projects under “pre-registration”.

  4. Download runtime dependencies of “kernel-auth-adapter-x.x.x.jar”, “kernel-ref-idobjectvalidator-x.x.x.jar”, “kernel-transliteration-icu4j-x.x.x.jar”, “kernel-virusscanner-clamav-x.x.x.jar” from Index of /repositories/snapshots/io/mosip
    Add all above as runtime dependencies to pre-registration-application-service.
    All other pre reg services will need “kernel-auth-adapter-x.x.x.jar”.

  5. Change in application.properties, config server, url’s, db passwords, keycloak client secrets as per your env.

  6. Comment out line number 525,526 and add return null; in DemographicServiceUtil.java class - in case u cannot access config server from local

  7. Start “PreRegistrationApplication.java” from your IDE.

Hope these help.

Thank you for reply… I follow the all process guided by you. i got same error when build and run the code.

Is it possible for you to remove your .m2 folder and recompile it? Somewhere this is a conflicting library.

Hi Suryawanshi,

do you able to clear this error?