Configuring Ubuntu to access a wireless HP printer

hplip is an opensource project to support multiple HP printers on Linux. On Ubuntu 12.04 I already had this installed, but running ‘sudo hp-setup’ gave me this error:

kev@ubuntu:~$ sudo hp-setup

HP Linux Imaging and Printing System (ver. 3.12.2)
Printer/Fax Setup Utility ver. 9.0

Copyright (c) 2001-9 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

warning: Qt/PyQt 4 initialization failed.
error: hp-setup requires GUI support (try running with --qt3). Also, try using interactive (-i) mode.

A quick Google turned up this post, and installing hplip-gui installed the missing libraries and got me up and running.

sudo apt-get install hplip-gui

Starting up hp-setup again and following the wizard to point to the IP of my printer was all I needed to get my printer working.

Spring Roo @RooEntity from 1.1.x replaced in 1.2.x

If you have an older Spring Roo project created from Spring Roo 1.1.x and you’re trying to imported it to a more recent STS version and/or trying to upgrade to a later 1.2.x version of Spring Roo, you may be seeing these errors:

RooEntity cannot be resolved to a type

@RooEntity was replaced in Spring Roo 1.2.x with @RooJpaActiveRecord. Replace this in all your Entity classes and you should be good to go.

This is discussed in this thread.

@RooJpaActiveRecord is covered in the docs here.

Adding jars to your OpenShift remote Maven repo

If your OpenShift app has dependencies on other Jars that are not publicly available in the usual maven repos (for example, other Jars from your own projects), you can push them to your remote Maven repo used when your app builds remotely.

Commit the jar in the root of your OpenShift project.

Edit .openshift/action_hooks/pre_build and add the following, updating Jar name etc:

mvn install:install-file --debug -Dfile=../../YourProjectName/runtime/repo/YourJarName.jar
  -DgeneratePom=true -DartifactId=YourArtifactName -Dversion=0.0.1-SNAPSHOT
  -DgroupId=your.group.id -Dpackaging=jar

Commit your changes and push to OpenShift – the jar will get installed to your remote repo, and now you can add a Maven dependency against it in your project’s pom.xml.

Accessing Glassfish server admin when you’ve forgotten your admin password

For my own development I frequently rotate between different app servers and different versions, Tomcat, JBoss AS, Glassfish, trouble is when you work with one for a while and then go back to one of the others, you forget key things, like what your admin password was when you last installed/configured a server.

Whatever the reason, there’s a few different approaches to working around this issue with Glassfish, like creating a new domain and copy files from the old to the new, but this question on superuser.com has the best lifesaver response ever… this file has a backup password that you can use for your admin account, even if you have no idea what your original password was – just copy the value from this file:

glassfish3glassfishdomainsdomain1configlocal_password