Open duwei-coder opened 1 year ago
Read the README file for how to build. You did't build other modules. In the main directory of the project run: mvnw clean install
downloaded latest shopizer and did the following cd shopizer mvnw clean install cd sm-shop mvnw spring-boot:run
found install succeeded, run is fine, http://localhost:8080/ listening but when i hit http://localhost:8080/shop or http://localhost:8080/admin urls it is throwing error. am i missing anything here?
The error I was facing was related to the database.properties file not found.
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors (PostProcessorRegistrationDelegate.java:183) ~[spring-contex t-5.3.18.jar:5.3.18] .3.18] .12] at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors (AbstractApplicationContext.java:746) ~[spring-context-5.3.18.jar:5 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 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 (Properties LoaderSupport.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] [INFO] ... 11 common frames omitted [INFO] BUILD FAILURE [INFO] [INFO] Total time: 47.351 s [INFO] Finished at: 2024-01-31T10:08:13+05:30 [INFO] Final Memory: 52M/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 -> [Hel 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
So I resolved it by adding database.properties file in sm-shop . Follow https://shopizer-ecommerce.github.io/documentation/configuration/database.html website and add following in database.properties
db.jdbcUrl=jdbc:mysql://localhost:3306/SALESMANAGER?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8 db.user=YOUR USERNAME db.password=YOUR PASSWORD db.driverClass=com.mysql.jdbc.Driver hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect db.preferredTestQuery=SELECT 1
db.schema=SALESMANAGER hibernate.hbm2ddl.auto=update
Make sure to replace it with your database and also you will need to create a database named SALESMANAGER.
After that follow steps from readme file:
cd shopizer mvnw clean install cd sm-shop mvnw spring-boot:run
[ERROR] Failed to execute goal on project sm-shop: Could not resolve dependencies for project com.shopizer:sm-shop:jar:3.2.5: Failed to collect dependencies at com.shopizer:sm-core:jar:3.2.5: Failed to read artifact descriptor for com.shopizer:sm-core:jar:3.2.5: Could not transfer artifact com.shopizer:sm-core:pom:3.2.5 from/to spring-releases (https://repo.spring.io/libs-release): Not authorized , ReasonPhrase:. -> [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/DependencyResolutionException
Have you solve?? Same Issue facing
[ERROR] Failed to execute goal on project sm-shop: Could not resolve dependencies for project com.shopizer:sm-shop:jar:3.2.5: Failed to collect dependencies at com.shopizer:sm-core:jar:3.2.5: Failed to read artifact descriptor for com.shopizer:sm-core:jar:3.2.5: Could not transfer artifact com.shopizer:sm-core:pom:3.2.5 from/to spring-releases (https://repo.spring.io/libs-release): Not authorized , ReasonPhrase:. -> [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/DependencyResolutionException