Issue: HTTP Status 500 - BeanFactory Not Initialized After Uploading new Platform Module

I generated a new OpenMRS platform module using the SDK with the command: mvn openmrs-sdk:create-project

The module was built successfully, and I uploaded the .omod file through the OpenMRS admin panel. However, after uploading, I encountered this error:

HTTP Status 500 – Internal Server Error
Type Exception Report

Message Request processing failed; nested exception is java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)

I didn’t modify any generated code, so this error is occurring with the default setup. Can anyone help me to setup platform module successfully

Share the server side log via pastebin.com

Sure WARN - OpenmrsUtil.getRuntimePropertiesFilePathName(2034) |2025-03-06T12:24:38,2 - Pastebin.com

basicexample-1.0.0-SNAPSHOT.omod is already associated with a loaded module. you are trying to upload a module which already exists.

but I created different module name mynewmodule-1.0.0-SNAPSHOT.omod and deployed but i still coming same error. plz help me

That is because you did not change the module id for the different module.

ok so how do I reset the OPEN MRS SDK server . or what steps I should take to resolve this error

Can we look at your module?

sure here is the module I → module repo link https://github.com/kaushikaW/mynewmodule

I have executed the following steps to create above module .

mvn openmrs-sdk:create-project
Specify module ID : mynewmodule.
What kind of project would you like to create?: 
1) Platform module 

Then after creating the project i build it using the command mvn clean install and got build successful message then tried to deploy it using the Admin interface