Archive for the ‘Technology’ Category

Hello World with JAX-RS on Tomcat 10, Jersey and JDK 17

Coding, Protocols & Specs, Technology, Web [ | ]

Sometimes the best place to start a new coding experiment is with “Hello World” (HW), the absolute minimum, often borrowed from someone else who has kindly published it for the benefit of others. The fewer assumptions made by the HW project the more useful it will be to the community. Some HW demos tend to make a lot of assumptions (IDE, build mechanism, dependency management etc.) and this presents problems for those who don’t match.

I recently created a starting point for a JAX-RS API running on Tomcat 10.1 and JDK 17, and when I looked around the Web I noticed that similar demos tended to assume Eclipse, or Maven, or Gradle and so on in the development environment. Here [click title to read more…]

One hundred and fifty to one

Technology []

I’m in the rather unfortunate position of having to migrate a client’s accumulated data from an old version of MySQL to the latest, and from old hardware to new, in a hosted environment where my only access is via a SQL client, with minimal down time.

Let’s ignore stored procedures, views, triggers etc. Those can be reproduced easy enough. It’s the tables containing millions of rows that will eat up the most time[1]. If you do a cursory check of the manuals and guides you’ll find that the normal approach is to use mysqldump to create a (massive, compressed) SQL file filled with table creation and row insertion operations. You then pump that dump file through a MySQL connection to [click title to read more…]

Rug pulling

Coding, Operating Systems, Technology

This involves AWS EC2 AMI deployment/setup automation, and if that makes you shudder then look away now.

Last week I was completing some automation that takes a blank EC2 through a carefully scripted sequence of steps to produce a production-ready platform for a specific live service. It’s not Chef, or Puppet or any of a number of config/build automation solutions. It’s just a simple shell script that incrementally adds functionality either to enhance its own configuration/build abilities and/or support the target setup. It’s close enough to the OS to support the granularity of control that I need, while being abstract enough to be reasonably compact. The current script is just shy of a thousand lines.

This script starts with the [click title to read more…]

CRC32C, JDK 17 and Netbeans

Coding

Even though the source level of /some/source/path is set to: 17, java.util.zip.CRC32C cannot be found on the system module path:

This one took me hours.

A while ago I migrated a major project to JDK17 and made many adjustments to ensure further development on it could be done in the latest Netbeans 17. As NB17 is bleeding edge, I regularly check the IDE log to make sure it’s not having a hard time. Unfortunately, doing almost any editing of the project caused warnings such as the message at the top of this post to appear. Hundreds of them. Flooding the log.

This didn’t cause any problems with my ANT build on Jenkins, but I noticed it was making Netbeans pause [click title to read more…]

Legacy

Coding, Technology

I decided today that I would take a look at a long-standing yet still active project, the bulk of which is in Java and running quite well under the latest v17 (LTS). In particular I wanted to know how much of the library of dependencies was compiled with earlier versions of Java. The result makes for some interesting reading.

My strategy was to extract the classes from every Jar and examine the version ID in the preamble bytes. I would then weight the discovered versions by the size of the class files (in uncompressed bytes), because counting files or lines of code is so unreliable.

From a total sample of about 5Gb of Java class bytes, only half of one [click title to read more…]