I encountered the following issue while running the Pre-Registration Application Service. The application fails to start, and the error log shows the following:
"Error creating bean with name ‘updateRegistrationController’: Unsatisfied dependency expressed through field ‘applicationService’;
nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘applicationService’:
Unsatisfied dependency expressed through field ‘auditUtil’;
nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘auditLogUtil’:
Unsatisfied dependency expressed through field ‘restTemplate’;
nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
No qualifying bean of type ‘org.springframework.web.client.RestTemplate’ available:
expected at least 1 bean which qualifies as autowire candidate. Dependency annotations:
{@org.springframework.beans.factory.annotation.Qualifier(value=“selfTokenRestTemplate”), @org.springframework.beans.factory.annotation.Autowired(required=true)}
"
Additionally, I’ve attached the full error log for your reference. Please check and let me know how I can resolve this issue.
From my understanding, the issue seems to be related to the RestTemplate bean. Is there a specific configuration or dependency I need to add? Or should I define a RestTemplate bean in my application context explicitly?
Thank you in advance for your assistance!
Attached Log:pre-register_error - Pastebin.com
Let me know if you need further refinements to the message!
Thank you for sharing the details of the issue. Based on our analysis and the Pre-Registration Developer Setup Guide, here’s how you can address the problem in your local environment setup :
Local Environment Setup :
The error is caused by the missing definition of the selfTokenRestTemplate bean, which is due to the absence of the kernel-auth-adapter dependency. Additionally, other dependencies are also required to execute the application successfully.
You need to provide the following dependencies in your pom.xml :
Build the Project:
After providing these dependencies, build the project using Maven : mvn clean install -Dgpg.skip=true
Run the Application:
Execute the application with the following command: java -jar target/pre-registration-application-service-<version>.jar
For Other Contexts :
If you are running the application in a different context (e.g., using Docker or another runtime setup), please refer to the Pre-Registration Developer Setup Guide for detailed instructions.
Please let us know if you encounter any further issues or need additional assistance. We’re happy to help
Hi @ymahtat@Vibha_Gondkar
Thank you for the detailed steps and guidance provided. I attempted the suggested solution but encountered the following issue:
The selfTokenRestTemplate bean still seems to be undefined despite including the mentioned dependencies in the pom.xml.
I have included all necessary dependencies in my pom.xml as per the Pre-Registration Developer Setup Guide.
The error log indicates issues that I suspect are related to dependency versions or missing configuration in the environment setup.
Steps Followed:
Updated pom.xml with the specified dependencies:
kernel-auth-adapter
kernel-ref-idobjectvalidator
kernel-transliteration-icu4j
kernel-virusscanner-clamav
Ran mvn clean install -Dgpg.skip=true successfully.
Attempted to run the application using java -jar pre-registration-application-service-1.2.0.1.jar.
Kindly review the attached files and help identify what might be causing the issue. If there are additional configurations or dependencies required, please share them.
Additionally, if possible, I request you to arrange a meeting via Google Meet or a similar platform to discuss this further and provide additional clarity.
Please try using this pom.xml.
With the necessary dependencies included (lines 149-168), the application should start correctly, and the error about selfTokenRestTemplate not being defined should ideally not persist.
Let me know if this resolves the issue or if you encounter any further problems.
Hi @ymahtat
Thank you for sharing the updated pom.xml file. I have made the suggested changes and attached the updated logs(pre_register_log - Pastebin.com) for your reference.
Could you please guide me on the best way to verify whether the application service is functioning correctly? Specifically:
Are there any endpoint URLs or specific functionality that I can test to ensure the
service is operational?
Thank you for your continued efforts in resolving the issue
Regarding the current error: PRG_PAM_APP_018 → Failed to read the identity json from the server
This occurs because the application is pointing to: http://localhost:8080/pre-registration/default/develop-v2/identity-mapping.json,
and the connection fails, likely because this endpoint (resource) doesn’t exist in your local environment.
To resolve this issue, you can comment out the code block in the method DemographicServiceUtil.getJson(...) at line 547, and return a sentinel value (a skip value, like an empty string). This will allow the application to bypass the error, which is a standard approach for local development.
Let me know if you need any further help or clarification. Happy to assist
Thank you for your guidance regarding the error PRG_PAM_APP_018. I followed your instructions, commented out the code block in the DemographicServiceUtil.getJson(...) method at line 547, and returned a sentinel value. This resolved the initial issue, and the application is now bypassing the error.
However, I am now encountering another error. I have attached the relevant log file for your reference. Could you please assist me in diagnosing and resolving this new issue?
Thank you for sharing the details of your issue. Here’s what I noticed based on your logs :
The Pre-Registration Application Service is trying to connect to external modules such as Masterdata, Authentication, IAM, and Configuration, but these attempts result in failed connections or timeouts. This is because the URLs currently used in your setup (e.g., pointing to dev.mosip.net or localhost) are either inaccessible or incorrect for your setup.
Why This Happens:
The issue occurs because the Pre-Registration Application Service depends on external modules (e.g., Masterdata, Authentication, IAM, Configuration) to function properly. Running the application locally without access to these services leads to startup failures—this is expected behavior.
These necessary services are part of the MOSIP ecosystem and must be accessible for the Pre-Registration application to function as intended.
What You Can Do :
If You’re Running the Application Locally :
Ensure you have access to the required services (Masterdata, Authentication, etc.), which are typically part of the full MOSIP setup.
Refer to the Deployment Getting Started Documentation for guidance on setting up the MOSIP ecosystem.
For Exploring the Application (Demo Mode) :
If your goal is to test how the application works, we recommend using the pre-deployed Demo Environment at collab.mosip.net.
This environment is fully configured with all necessary services, allowing you to explore the application as intended without needing to set up your MOSIP ecosystem.
Refer to the Collab Pre-Registration Guide for instructions on accessing and using this environment.
For Exploring the Code :
If your objective is to understand the service or review the code structure :
Clone the Pre-Registration application’s codebase.
Build it locally to explore the logic and structure.
However, running the application locally requires access to an environment where these dependent services are hosted and accessible.
If you have access to such an environment, update the application.properties file with the relevant service URLs (e.g., spring.cloud.config.uri and mosip.base.url).
Without access to these services, the application will fail to start successfully.
Let me know if this helps or if you need further clarification.
Thank you for the detailed insights into the issue. I’ve reviewed your suggestions, and I would like to proceed with the “Running the Application Locally” option. Could you kindly provide the following details to help me set up the environment successfully?
1. Detailed Documentation
Step-by-step guide for setting up the MOSIP ecosystem locally.
Configuration details for the required services (Masterdata, Authentication, IAM, and Configuration).
Instructions on updating application.properties with the correct URLs for local setup.
Any additional setup or troubleshooting guides for running the Pre-Registration Application locally.
2. System Requirements
Minimum hardware specifications (CPU, RAM, Disk Space).
Software prerequisites (Java version, Database requirements, and any other necessary tools).
Supported operating systems for the local setup.
3. Dependency Management
Details on how to set up dependent services (e.g., Docker images, installation steps).
Guidance on configuring dependencies to ensure seamless communication between modules.
4. Access Permissions
Any permissions or access credentials needed to run the services locally.
Information on connecting to existing MOSIP-hosted environments for testing if required.
Please share the relevant links or resources for these aspects. This will help me get started with the local setup smoothly.
Looking forward to your guidance. Thank you for your support!
Thank you for sharing the links to the documentation. I have already reviewed the provided URLs, but I need more detailed information regarding:
System Requirements: Could you please provide a comprehensive list of prerequisites for setting up MOSIP (e.g., hardware specifications, software dependencies, etc.)?
Local Deployment Process: A step-by-step guide or additional resources on deploying MOSIP locally would be very helpful.
I have gone through the thread. Based on that my comments are:
We expect local Pre Reg testing to be done by pointing to some env where all dependent services are running. We do not expect all dependent services to be running locally. Hence we do not have any ready guide for the same.
Our team can try this approach and come up with a guide in next 10-15 working days. We will share it once the approach is tried.