Monday, November 24, 2025

Two Things I Ran Across Trying to Learn about Spring Boot

For some of the projects I've been working on I've wanted to set up an easy web interface based in Java. After looking at a bunch of options to learn, I chose Spring Boot which seemed like the most straight forward and possibly useful choice.

I ran into some issues getting started, so I thought I'd write them down in case it helps anyone else. I'm sure that mostly I'm confused and not reading the documentation carefully, but writing is a good way to learn.

For context, I'm working from what looked like a good tutorial on Spring Boot (https://spring.io/guides/gs/spring-boot) and started working through it. The tutorial points you at the helpful Spring Initalizr (https://start.spring.io/) which helpfully (helpfully?) generates everything you need to get started on a Spring Boot project.

Gradlew Version (Which looks like Unsupported class file major version)

The first big thing I ran across was an error from Gradle saying:

BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 69 Unsupported class file major version 69

This was surprising but not super unexpected, for most of the projects I regularly worked in Java in I locked to a version and tended to build most things from scratch (Also updates to the Java version were way less frequent). So I almost never ended up with classes compiled in different versions of Java in the same place. I poked this for a while, but it seemed wrong to get this in a clean install of a Spring Boot application, where I hadn't even edited anything yet.

I don't use Gradle for anything (that's why I'm learning right now) and certainly haven't updated my tech stack for a while, so I figured a good updating of everything would probably help. I fired up Homebrew and let it upgrade everything. This took a few hours — did I mention that I hadn't updated everything in while, but it was fun in the way installing software off of diskettes in the 90s was fun.

This certainly fixed a lot of things and ensured that I had the newest version of Gradle (9.2.0) and Java (25) in the path. Problem solved, I ran

./gradlew bootRun

aaand got the same error.

This was particularly frustrating because a lot of the Stackoverflow and forum posts, tend to — slightly snarkilly — point to the Gradle compatibility matrix (https://docs.gradle.org/current/userguide/compatibility.html) which is slightly frustrating when you are clearly using not only a correct paring of Gradle and Java, but the latest paring of Gradle and Java.

After quite a bit of poking and reading things online, I eventually landed on something being weird with the Gradle Wrapper. I remain a little confused by the Gradle Wrapper, especially when you get the wrapper with a project you're starting on. The idea that it allows you to lock your Gradle version and settings makes sense, but a lot of the details feel fuzzy in the documentation I've read so far and I'm not sure what the difference is between the wrapper and just running Gradle with a specific version. Possibly it's more convenient.

Anyway, it took me a while, but I eventually realized that while I was running Gradle 9.2.0 the Gradle Wrapper in my project from Spring Initalizr was running 8.14.3.

After some more reading I eventually figured out that I had to upgrade the wrapper, with the command:

gradle wrapper --gradle-version 9.2.0

My Googling was sub-par, but I think the document I should have been looking at is this one: https://docs.gradle.org/current/userguide/upgrading_major_version_9.html. Although since I hadn't upgraded my version of Gradle (I just started the project), I felt a bit unsatisfied.

(On further reading (https://docs.gradle.org/current/userguide/command_line_interface.html#sec:environment_options) it seems that what that does create a new wrapper using the specified version, which I guess makes sense.)

Anyway that was the key to getting Spring Boot up and running.

Spring Boot Does Something Weird With Packages

With Spring Boot running, it started Tomcat correctly, but when I poked it using curl all I got was a 404. This was again a little frustrating because I was using the fresh zip file from Spring Initializr and the code from the tutorial.

The application was clearly running, as the code the tutorial includes to show all the beans was working and when I started the app, it gave me a long list of Beans, but when I sent a web request, I got nothing back.

The annotation Spring (Boot?Web?... still learning I guess) uses for establishing endpoints seems to be pretty clear @GetMapping("/") where whatever you put in for a path should be where your Controller gets served, but changing out the path didn't work.

Again my Googleing was a bit weak and I couldn't find anything that directly related to what I was seeing — which is why I thought it would be worth while to write it up here, even if my problems are mostly due to my lack of knowledge.

It seemed to me that the @GetMapping("/") assignment wasn't taking and especially since I'd had some issues with getting things from the Spring Initalizr I wondered if there was something funky in the naming of some of our files or paths.

As I was looking around, I noticed a note in the Spring HELP.md file:

The original package name 'com.example.spring-boot' is invalid and this project uses 'com.example.spring_boot' instead.

Which given my guess about why I was getting the 404 error, gave me a good place to look.

So I went and looked at the two files I'd added from the tutorial src/main/java/com/example/spring_boot/Application.java and src/main/java/com/example/spring_boot/HelloController.java. And as it turns out I did have the package names wrong, just ... not in the way Java would usually find them wrong...

In HelloController I discovered had the package name right, package com.example.spring_boot;, however I had the package name wrong in Application.java, where it was package com.example.springboot;. For the record I think this came from copying files out of the tutorial slightly incorrectly (it uses springboot without a space, which doesn't align with the Spring Initalizr settings they point to, but I didn't catch that).

Now the issue here, at least to my old-timey java mind is that. Application.java was working, the code added in the tutorial ran — it printed the list of beans, and later the message I replaced that list with — but that should have failed based on the package name.

Or I guess that being said, given that spring is very good about finding and plumbing things together, maybe the error shouldn't have happened at all? Or it could possibly have put a warning somewhere I noticed it. Once I got everybody on the same package name (spring_boot) then

Summing Up

As I noticed, I really only wrote this up because some of the things I found online didn't really answer the questions I had. Since I had to do a little learning to solve them, I figured I'd write it up for myself, and maybe it will help someone else at some point.

So,

  • Make sure you have Gradle and Java updated to the right — and compatible — versions.
    • Run gradle wrapper --gradle-version 9.2.0 to fix the gradle wrapper.
  • Make sure that you have the correct — and matching — package in your .java files
    • The tutorial as written and hooked up to Spring Initalizr don't quite align if you're not paying attention.

Friday, August 01, 2025

A Rest - The Blog 2025

So I've managed to post at least once a month since July of 2016, right up until April this year. Now I've been quiet for quite a few months.

I'll be honest I'm struggling with what's worth sharing. I think in the current world, the purpose and use of the internet has become a lot messier than it was in by-gone days and given the amounts of hate and misinformation, I don't know what to put into the world.

As I'm sure I've posted in these time after time, I hate it when projects go away without word, so I've keep these Blog-End-and-Start Days around as a way to give myself a natural point if the blog were to end...

Damn it, is this a quitting YouTube Video in text form?

It might be. Ah, well. Alas.

So, here's where I'm at. I don't know that I want to share a lot about my life. The easier and safer-feeling days of the Internet have faded and putting time and the energy into online spaces doesn't feel compelling. I'm still thinking projecty things, but, for my own mental health, I've manage to adjust my perception about how what I do relates to who I am, and so I'm  feeling less like the things I'm working on need to be shared and also feeling like I'm in a period where there's a lot of learning and work I want to do without an audience.

I've also discovered that journaling has been really beneficial for capturing my thoughts in a way I used to feel I needed an audience for. That has honestly been the best thing to support my mind through the end of Twitter and for my mental health over all. I started journaling after reading from somewhere (possibly in Twitter) that it was a good idea to have a record of your life that couldn't get destroyed or lost by a tech company, and a good hard-bound paper book has turned out to be a wonder in a lot of ways. 

Also it lets me buy stationary and that's always fun.

What's next? Well, a few things. 

I will still post here, but I think we can count all of the projects as "on hiatus" at least for now. That includes the blog-as-blog, although I may have bloggy things I want to post here too. I'm on Mastodon, at @tjkendon@mstdn.ca and @tjkendon@scholar.socal, I'm pretty quiet there too, but I may expand depending on what makes sense to do. I guess I'm also on BlueSky, but kind of quietly. Finally I've been thinking a lot about learning technologies and have some things I do want to share in my work context so I expect I'll be more present on "Teaching & Learning". 


It's also (really, seriously this time) time to move this blog off of Blogspot. I'm honestly baffled at this point that of all the Google products this is still here, but 1) It's been janky as hell since ... I started posting and 2) I think in this current world being intentional about ownership of your digital footprint is more critical than ever. So you can expect to see what ever I do in a new space, but we can hope that Feedburner will keep things moving along smoothly. I will leave lots of signage, blinkenlights and breadcrumbs.

So it's not good bye, but it is see you around.

Go make something, but mostly be good to each other.

TJ

White text block in the bottom right of a black square. Reminiscent of Cowboy Bebop



Sunday, April 06, 2025

The Books I Read - March 2025

I read quite a bit less in March. Not really and intentional thing or not, just how the month turned out. I did find that "Woken Furies" took forever to read, and I never did get that into it. Partly that was having a reader who sounded a lot like the reader for the first two, but who missed all the nuance of pronunciation that was key to the first book.

Victoria Goddard continues to be awesome and everything I've read from her has been a delight. Realizing that I've taken a strange reading order through her books has also been interesting because they still work. It's been funny getting to the authors note of a book and she mentions that one of the books I read first will be published in a year or so. She's done a remarkably good job of building a coherent world where everyones stories slot neatly together.


Stats for February (Year To Date)

Reading Stats

Books Read - 5 (28)Pages Read - 2100 (8750)

Collage of the covers of the 5 books listed above.March 2025 Covers

Authors

Unique Authors: 3 (11)

Author - books read - pages read

Anna Lee Huber (4 - 1571) Becky Chambers (4 - 1492)
Carola Dunn (1 - 273) Iona Whishaw (1 - 409)
Katharine Schellman - 1 - 352 (2 - 679) Louise Penny (2 - 497)
Martha Wells (1 - 234) Richard K. Morgan - 2 - 960 (3 - 1504)
Susan Cooper (1 - 363) Tomohito Oda (2 - 402)
Victoria Goddard - 2 - 788 (7 - 1326)

Word cloud of the authors I read in March. Richard K. Morgan is the largest at the bottom, Victoria Goddard is slightly smaller above and to the right and Katherine Schellman is beside to the left and quite a bit smaller.March 2025 Author Cloud

Publication Decade

1970s - (1) 2000s - 2 (6)
2010s - (10) 2020s - 3 (11)

Source

Audible - 2 (6) Kobo - 2 (10)
Libby - 1 (10) Libro.fm - (2)

Formats

Audiobook - 2 (10) eBook - 3 (16)
eBook Comic - (2)

Sunday, March 02, 2025

The Books I Read - February 2025

February was the month I was really focused on recovering from my health stuff in January. I didn't sit down a read as consistently as I'd have liked, but I always had an eBook and an audiobook on the go.

If you look at this month's author cloud, it's very funny how tiny Victoria Goddard is because "The Tower at the Edge of the World" and "Aurelius (to be called) Magnus" were probably the two most memorable books, for all they were only a few pages long. Victoria Goddard has definitely grown to be one of my favourite authors over the last few months.

The mysteries were alright. I continue to struggle with Louise Penny, just from the mix of Canadiana, warm comfort, and gritty murder. The Daisy mysteries by Carola Dunn are definitely giving me the "I ate too much of that" feeling you get if you eat too much popcorn and I didn't really find much to love in "The Case of the Murdered Muckraker" (although the audiobook narrator really didn't make the American accents fun listening).

I revisited "Altered Carbon" for the first time since 2019. The world is very interesting and provides a natural environment for a Noir mystery to unfold. On this read through I found that the plot didn't really engage me and the use of Noir tropes didn't flow well into the plot and the world building. Having started on its sequel "Broken Angels" I also feel like there's just some first-time author in "Altered Carbon" which grated for me.


Stats for February (Year To Date)

Reading Stats

Books Read - 12 (23)Pages Read - 3117 (6650)

Collage of the covers of the 12 books listed above.February 2025 Covers

Authors

Unique Authors: 9 (11)

Author - books read - pages read

Anna Lee Huber - 1 - 431 (4 - 1571) Becky Chambers - 1 - 336 (4 - 1492)
Carola Dunn - 1 - 273 (1 - 273) Iona Whishaw (1 - 409)
Katharine Schellman - 1 - 327 (1 - 327) Louise Penny - 2 - 497 (2 - 497)
Martha Wells - 1 - 234 (1 - 234) Richard K. Morgan - 1 - 544 (1 - 544)
Susan Cooper (1 - 363) Tomohito Oda - 2 - 402 (2 - 402)
Victoria Goddard - 2 - 73 (5 - 538)

Word cloud of the authors I read in February. Richard K. Morgan is the largest at the bottom, Anna Lee Huber, Loiuse Penny and Tomohito Oda are about the same size above then Becky Chambers, Katherine Schellman, Martha Wells and Carola Dunn are smaller and fitted in. Victoria Goddard is tiny and tucked in the middle.February 2025 Author Cloud

Publication Decade

1970s - (1) 2000s - 4 (4)
2010s - 4 (10) 2020s - 4 (8)

Source

Audible - 1 (4) Kobo - 5 (8)
Libby - 5 (9) Libro.fm - 1 (2)

Formats

Audiobook - 3 (8) eBook - 7 (13)
eBook Comic - 2 (2)

Two Things I Ran Across Trying to Learn about Spring Boot

For some of the projects I've been working on I've wanted to set up an easy web interface based in Java. After looking ...