unable to run the application while build is successful.Trying to run in eclipse.

210 views
Skip to first unread message

ujjwal ranjan

unread,
Jan 26, 2023, 2:36:13 PM1/26/23
to Shopizer
Hello everyone.
I am using eclipse ice and used maven build to compile the application. The build was successful while I try to run the application I am getting the following error.




2023-01-27 00:47:21.887  INFO 5691 --- [           main] c.s.shop.application.ShopApplication     : Starting ShopApplication using Java 17.0.5 on ujjwals-MacBook-Air.local with PID 5691 (/Users/ujjwal/Desktop/shopizer/sm-shop/target/classes started by ujjwal in /Users/ujjwal/Desktop/shopizer/sm-shop)

2023-01-27 00:47:21.890  INFO 5691 --- [           main] c.s.shop.application.ShopApplication     : No active profile set, falling back to 1 default profile: "default"

2023-01-27 00:47:26.602 ERROR 5691 --- [           main] o.s.boot.SpringApplication               : Application run failed


org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: class path resource [database.properties] cannot be opened because it does not exist

   at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:89) ~[spring-beans-5.3.18.jar:5.3.18]

   at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:325) ~[spring-context-5.3.18.jar:5.3.18]

   at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:183) ~[spring-context-5.3.18.jar:5.3.18]

   at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746) ~[spring-context-5.3.18.jar:5.3.18]

   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564) ~[spring-context-5.3.18.jar:5.3.18]

   at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.12.jar:2.5.12]

   at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) ~[spring-boot-2.5.12.jar:2.5.12]

   at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:448) ~[spring-boot-2.5.12.jar:2.5.12]

   at org.springframework.boot.SpringApplication.run(SpringApplication.java:339) ~[spring-boot-2.5.12.jar:2.5.12]

   at org.springframework.boot.SpringApplication.run(SpringApplication.java:1365) ~[spring-boot-2.5.12.jar:2.5.12]

   at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[spring-boot-2.5.12.jar:2.5.12]

   at com.salesmanager.shop.application.ShopApplication.main(ShopApplication.java:12) ~[classes/:na]

Caused by: java.io.FileNotFoundException: class path resource [database.properties] cannot be opened because it does not exist

   at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:199) ~[spring-core-5.3.18.jar:5.3.18]

   at org.springframework.core.io.support.EncodedResource.getInputStream(EncodedResource.java:159) ~[spring-core-5.3.18.jar:5.3.18]

   at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:110) ~[spring-core-5.3.18.jar:5.3.18]

   at org.springframework.core.io.support.PropertiesLoaderSupport.loadProperties(PropertiesLoaderSupport.java:181) ~[spring-core-5.3.18.jar:5.3.18]

   at org.springframework.core.io.support.PropertiesLoaderSupport.mergeProperties(PropertiesLoaderSupport.java:162) ~[spring-core-5.3.18.jar:5.3.18]

   at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:80) ~[spring-beans-5.3.18.jar:5.3.18]

   ... 11 common frames omitted


.Please help.

ujjwal ranjan

unread,
Jan 26, 2023, 2:49:50 PM1/26/23
to Shopizer

same error running outside of eclipse .

ujjwal ranjan

unread,
Jan 26, 2023, 2:56:34 PM1/26/23
to Shopizer
Downloaded earlier version and its running fine

Vivek Takate

unread,
Jan 29, 2024, 7:37:17 AM1/29/24
to Shopizer
hi
    same error pls help how to resolve

On Friday, January 27, 2023 at 1:06:13 AM UTC+5:30 ujjwal ranjan wrote:

Didier GUILLEMOT

unread,
Jan 31, 2024, 12:26:23 PM1/31/24
to Shopizer
Hi,
I was facing the same problem, and solved it from this link : https://github.com/shopizer-ecommerce/shopizer/issues/962
Create a database.properties file with the content you will find in issue, and server starts after that

Luv Patel

unread,
Feb 28, 2024, 1:39:06 AM2/28/24
to Shopizer
I am still not able to rectify the error. I have tried the solution from the link.Please help

Narayana Vakkalagadda

unread,
Jun 5, 2024, 1:33:45 PM6/5/24
to Shopizer
I am getting the same error. I am using main branch. 

Can someone please suggest ?
I havent created any db.


2024-06-05 12:31:31.540  INFO 6156 --- [           main] c.s.shop.application.ShopApplication     : Starting ShopApplication using Java 11.0.22 on SATWLHCJDNDGK3 with PID 6156 (C:\NV\WSO2\Repos\shopizer2\sm-shop\target\classes started by A049469 in C:\NV\WSO2\Repos\shopizer2\sm-shop)
2024-06-05 12:31:31.544  INFO 6156 --- [           main] c.s.shop.application.ShopApplication     : No active profile set, falling back to 1 default profile: "default"
2024-06-05 12:31:34.173 ERROR 6156 --- [           main] o.s.boot.SpringApplication               : Application run failed


org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: class path resource [database.properties] cannot be opened because it does not exist
        at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:89) ~[spring-beans-5.3.18.jar:5.3.18]
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:325) ~[spring-context-5.3.18.jar:5.3.18]
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:183) ~[spring-context-5.3.18.jar:5.3.18]
        at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746) ~[spring-context-5.3.18.jar:5.3.18]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564) ~[spring-context-5.3.18.jar:5.3.18]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.12.jar:2.5.12]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) ~[spring-boot-2.5.12.jar:2.5.12]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:448) ~[spring-boot-2.5.12.jar:2.5.12]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:339) ~[spring-boot-2.5.12.jar:2.5.12]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1365) ~[spring-boot-2.5.12.jar:2.5.12]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[spring-boot-2.5.12.jar:2.5.12]
        at com.salesmanager.shop.application.ShopApplication.main(ShopApplication.java:12) ~[classes/:na]
Caused by: java.io.FileNotFoundException: class path resource [database.properties] cannot be opened because it does not exist
        at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:199) ~[spring-core-5.3.18.jar:5.3.18]
        at org.springframework.core.io.support.EncodedResource.getInputStream(EncodedResource.java:159) ~[spring-core-5.3.18.jar:5.3.18]
        at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:110) ~[spring-core-5.3.18.jar:5.3.18]
        at org.springframework.core.io.support.PropertiesLoaderSupport.loadProperties(PropertiesLoaderSupport.java:181) ~[spring-core-5.3.18.jar:5.3.18]
        at org.springframework.core.io.support.PropertiesLoaderSupport.mergeProperties(PropertiesLoaderSupport.java:162) ~[spring-core-5.3.18.jar:5.3.18]
        at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:80) ~[spring-beans-5.3.18.jar:5.3.18]
        ... 11 common frames omitted

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.421 s
[INFO] Finished at: 2024-06-05T12:31:34-05:00
[INFO] Final Memory: 51M/188M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.12:run (default-cli) on project sm-shop: Application finished with exit code: 1 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Narayana Vakkalagadda

unread,
Jun 5, 2024, 6:35:14 PM6/5/24
to Shopizer
@ ujjwal - what version is stable and running without this error ?
Reply all
Reply to author
Forward
0 new messages