DEV Community

spring boot file not found error

Aryan Dwivedi on September 24, 2023

I was trying to upload image to my database through my spring boot app //This was my code to handle the image and data public ResponseEntity addPr...
Collapse
 
schwiftycold profile image
Shubham Kumar

Can you share your application.properties file located inside the resources directory?

Collapse
 
rnd2002 profile image
Aryan Dwivedi

spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/odopdb
spring.datasource.username=root
spring.datasource.password=aryan007@mysql
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

spring.jpa.properties.hibernate.show_sql=true
spring.jpa.properties.hibernate.use_sql_comments=true
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.defer-datasource-initialization=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql: true

spring.servlet.multipart.enabled=true

spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.location=C:/Windows/Temp

Collapse
 
schwiftycold profile image
Shubham Kumar

The application.properties file seems fine to me.
Can you check the implementation of setImage method of the Product class?
I think there is some mismatch b/w the file type conversion.
Would it be possible for you to share the project codebase, maybe using version control repository?

Thread Thread
 
rnd2002 profile image
Aryan Dwivedi

Yes how can I reach you?

Thread Thread
 
rnd2002 profile image
Aryan Dwivedi
Thread Thread
 
rnd2002 profile image
Aryan Dwivedi

Hope it helps
I wanted a dashboard for the sellers and a product database so that I can display products to the customers and also implement dashboard facility to each sellers with basic auth for sellers..
Now hope it helps you to understand the problem