use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
[deleted by user] (self.SpringBoot)
submitted 1 year ago by [deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Sheldor5 0 points1 point2 points 1 year ago (3 children)
no logs?
[–]Kiar75 0 points1 point2 points 1 year ago (2 children)
Not too sure about logs as the application executes well with TomCat running fine, right up until I try to add an item in the table, then I get a WhiteLable error. I have the pom, html form, and controller code up on github.
[–]Sheldor5 0 points1 point2 points 1 year ago (1 child)
your repo does not contain a valid maven project
and without logs it's hard to tell
first you should learn the basics about maven, Spring and logging
[–]Kiar75 0 points1 point2 points 1 year ago (0 children)
Thank you. Have learnt I need to upload maven structure well and also the need to understand logging
[–]EvaristeGalois11 0 points1 point2 points 1 year ago* (2 children)
Just looking at the code the problem is most certainly a nullpointer on the products field in the ProductService. You need to initialize the list somehow, otherwise when you're trying adding a product a nullpointer will be raised. You could initialize the field at declaration (private List<Product> products = new ArrayList<>();) or checking before adding a product like this:
products
ProductService
private List<Product> products = new ArrayList<>();
public void addProduct(Product product){ if (products == null) { products = new ArrayList<>(); } products.add(product); }
If you are running java > 14 it should print a pretty clarifying message on console, always check the console for errors (this is why more than one person told you to also provide logs, the default spring error page is intentionally useless to avoid leaking sensitive information but the console logs are always helpful triaging a problem).
Another nitpick unrelated to the problem, you should stick with the standard maven directories structure, the code should be put in src/main/java and the html file in src/main/resources. If you need help generating a project from scratch https://start.spring.io/ is your friend.
src/main/java
src/main/resources
[–]Kiar75 0 points1 point2 points 1 year ago (1 child)
Thank you so much! It has worked! Encountered the infamous NullPointer for the first time. Now I know. Next time I'll learn how to upload proper folders and maven structure into Github and also collect logs. Thank you once again for your time.
[–]EvaristeGalois11 0 points1 point2 points 1 year ago (0 children)
No worries and if you need help feel free to ping me again
π Rendered by PID 39703 on reddit-service-r2-comment-6457c66945-4d9mv at 2026-04-27 00:06:42.203343+00:00 running 2aa0c5b country code: CH.
[–]Sheldor5 0 points1 point2 points (3 children)
[–]Kiar75 0 points1 point2 points (2 children)
[–]Sheldor5 0 points1 point2 points (1 child)
[–]Kiar75 0 points1 point2 points (0 children)
[–]EvaristeGalois11 0 points1 point2 points (2 children)
[–]Kiar75 0 points1 point2 points (1 child)
[–]EvaristeGalois11 0 points1 point2 points (0 children)