Refreshing a JAX-RS backend with some Node.js and Express?

Over the past few year or so, I’ve been building a web app that visualizes amateur radio spots using a digital mode called JT65. The site is currently up and live here: http://www.spotviz.info/#/home

I started building this as an exercise to learn some AngularJS 1.x (I posted a number of posts along the way too). The backend datastore is MongoDB, and there’s a JAX-RS War deployed to WildFly that provides a REST backend to the AngularJS frontend. The majority of the logic for the webapp is all in the AngularJS app.

Since playing with some Node.JS and Express a couple of weeks ago, I’ve been considering if I should have a go at replacing the JAX-RS code with a Node.js backend too. Since the existing code is mainly building and executing MongoDB queries, this wouldn’t be that hard to do a straight replace. Based on what I’ve seen so far of libraries like Mongoose, the replacement code is likely to be significantly more concise than the existing Java based backend. I’ll queue this up for a project in the coming weeks 🙂

Watch for dependency name typos when creating new Spring Boot projects

If you use the Spring Boot CLI, it’s pretty easy to get a new project created from the templates with all required dependencies in place with something like:

spring init --build=maven --dependencies=web project-name.zip

This generates you a zip that you can unzip and import into your IDE and off you go. The trouble with the CLI currently though is that there’s no validation on the dependency names, so if you call

spring init --build=maven --dependencies=wb project-name.zip

You’ll get the same zip generated, but there will be a subtle typo in your dependencies which unless you’ve seen these messages from maven before, you’ll spend a bunch of time trying to work out what’s wrong.

I created a ticket for this issue here, and hopefully this gets picked up as an enhancement.

The maven error in case you’re interested looks like this:

[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.example:testbaddep:0.0.1-SNAPSHOT (/Users/kev/develop/spring-boot/testbaddep/pom.xml) has 1 error
[ERROR]     'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-wb:jar is missing. @ line 27, column 15
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

Android Studio – useful notes (1)

Having worked for years with Eclipse (and some time with Netbeans), I have to admit that using Android Studio (based on InteliJ) I’m fining harder that what it should be. Where’s all my key shortcut combinations!

Whenever I use Netbeans, I use the Eclipse keymappings option in the settings, so I don’t have to remember any new key shortcuts. I’m not sure if Android Studio/IntelliJ has this option as well, but in the meantime, here’s some notes for useful things to remember.

Organize Imports (Eclipse: shift-Ctrl-O) / Optimize Imports: Ctrl-Opt-O

Jump to definition (Eclipse: F3) : Opt-Cmd-B

Fix error with popup suggestion: Opt-Return

 

Other useful Android development related posts:

http://stackoverflow.com/questions/17252870/how-to-show-compilation-errors-in-android-studio

http://stackoverflow.com/questions/2364811/how-do-i-write-outputs-to-the-log-in-android

 

Game development for Android (attempt #3)

A while back (9 years it seems, see here) I had the urge to try and create a game in Java after having spent many years of Java development for business, but I’d never developed a game. It turned out OK (final version here), and along the way I abstracted a simple 2d game engine (here).

Inspired by one of the game development panels at Silicon Valley Comic Con last weekend, I’ve picked up a copy of  Android Game Development by Example by John Horton, and now off I go 😉 I’ll report back in a couple of weeks…