Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why am I okay with the first few steps, but there is an error when executing mvnw spring-boot:run and WON'T START.the environment is MY MAVEN VERSION 3.6.3 JAVA VERSION IS 11 #891

Open
duwei-coder opened this issue Mar 3, 2023 · 3 comments

Comments

@duwei-coder
Copy link

[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

@mgal
Copy link

mgal commented Apr 14, 2023

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

@vsarraju
Copy link

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?

@Mayuri1825
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants