R
Railway10mo ago
dx_manh

Deployment issues in Spring Boot project

Hello, I am a newcomer using the Hobby Plan. My project is built on the Spring Boot platform and runs fine on my local machine, but when I deploy it, I encounter an error related to ThymeLeaf. Here is the error log: 2023-09-01T15:34:44.565Z ERROR 1 --- [nio-6498-exec-5] org.thymeleaf.TemplateEngine : [THYMELEAF][http-nio-6498-exec-5] Exception processing template "/client/index": Error resolving template [/client/index], template might not exist or might not be accessible by any of the configured Template Resolvers @project: 85eadb05-1f13-4118-bdf2-067247f8ec87 @environment: c1a03bd1-e816-4b7c-8fa8-b762c8ff2c0f @service: d89d3294-6dea-48e3-8f36-5059abdd7229 @deployment: 13118411-5b51-4992-bc7a-d6cab21e47ff @replica: 9714fd21-a33b-45f7-bb7d-875a768537e7
24 Replies
Percy
Percy10mo ago
Project ID: 85eadb05-1f13-4118-bdf2-067247f8ec87,c1a03bd1-e816-4b7c-8fa8-b762c8ff2c0f,d89d3294-6dea-48e3-8f36-5059abdd7229,13118411-5b51-4992-bc7a-d6cab21e47ff,9714fd21-a33b-45f7-bb7d-875a768537e7
Brody
Brody10mo ago
@interstellartaco hello friendly neighbourhood Java dev
dx_manh
dx_manh10mo ago
I really need help. I hope everyone can assist me.
Brody
Brody10mo ago
don't know if aleks is available right now, he'll come around when he has the time
dx_manh
dx_manh10mo ago
Thank you. But can he trace and identify the issue from that log? I'm concerned that since the error description is limited, it might be challenging for him to trace
Brody
Brody10mo ago
this is true, please provide the full deployment log in a txt file
dx_manh
dx_manh10mo ago
This is my log. I really hope to receive assistance
Brody
Brody10mo ago
are you using a relative path to that template file
dx_manh
dx_manh10mo ago
I have declared the Thymeleaf path to the templates directory in the application.yaml file: spring: thymeleaf: prefix: classpath:/templates/ suffix: .html I have also declared a route so that when accessing the corresponding URL, it will go to the file: client/index.html: @GetMapping(value = {"/", "/home", "/trang-chu"}) public ModelAndView index() { ModelAndView view = new ModelAndView("/client/index"); return view; } And here is the file path of that file in the project: src/main/resources/templates/client/index.html I have also declared the dependent libraries in the pom.xml file: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <dependency> <groupId>nz.net.ultraq.thymeleaf</groupId> <artifactId>thymeleaf-layout-dialect</artifactId> </dependency> <dependency> <groupId>org.thymeleaf.extras</groupId> <artifactId>thymeleaf-extras-springsecurity6</artifactId> </dependency>
Brody
Brody10mo ago
these look like absolute paths, try using relative paths
dx_manh
dx_manh10mo ago
"No, it is a relative path
Brody
Brody10mo ago
alright
dx_manh
dx_manh10mo ago
microservices deadline is pressing on me. I need urgent assistance :(((((((
Brody
Brody10mo ago
this is comunity help, if no one here knows java and how to solve your problem you may not get an answer unfortunatly
dx_manh
dx_manh10mo ago
Thank you. Is there any way to receive support from the Railway technical team? I believe this error is internal to their system
Brody
Brody10mo ago
I assure you it's not a platform issue, something with your code. but to receive support from the team you'd need to be on the pro plan or there would need to be something wrong with the platform, this is just a code issue
dx_manh
dx_manh10mo ago
I have cloned this project to another machine, and it runs fine on that machine. I'm quite stuck on this issue :((
Brody
Brody10mo ago
unfortunatly, it runs on my machine does not rule out a code issue
dx_manh
dx_manh10mo ago
I have redeployed on Railway several times, but the error still occurs. However, on my local machines where I deploy this project, the error doesn't occur. It's really difficult to troubleshoot
Brody
Brody10mo ago
sorry but the "it runs on my machine" does not rule out a code issue
dx_manh
dx_manh10mo ago
Yes, I understand. What I mean is that since I cannot reproduce the error, resolving it has become a deadlock
Brody
Brody10mo ago
you can always log stuff and try different path styles, etc. it would not be wise to wait for someone to come with an answer without trying to work through this problem yourself too
dx_manh
dx_manh10mo ago
Thank you. During the past few hours, alongside troubleshooting the issue, I also posted the question on the community. And I'm still actively seeking ways to resolve the problem.
root
root10mo ago
Try removing the leading / from the view path.
Want results from more Discord servers?
Add your server
More Posts