Tuesday, 3 April 2012

Thuderbird SMTP error '5.5.4 Invalid Address' connecting to Exchange server

Using Thunderbird to connect to the Exchange server, I was getting the error:  5.5.4 Invalid Address. Turns out it's something to do with Exchange not liking the EHLO parameter generated by Thunderbird. You can override this value with the following entry in your prefs.js file (change 'smtp1' to whichever is the smtp server you need to fix):

user_pref("mail.smtpserver.smtp1.hello_argument", "your_hostname")

Monday, 27 February 2012

Cygwin cron no password

When you set Cygwin's cron up to run per-user with no password (using cyglsa), then whenever you change your Windows password, you need to:
  1. run Cygwin as the Windows Administrator (right click -> Run as administrator)
  2. run: password -R

Bitlocker in bootcamp Windows 7 on a MacBook Air (late 2010)

The MacBook Air (well at least the 11", late 2010 model) does not have a "TPM" chip, and you'll get an error if you try an enable Bitlocker on the drive. There is a work-around to disable the TPM requirement, though you will need to have a USB key handy every time you boot.


To disable the TPM requirement:
  1. Start the Group Policy Editor
  2. Go to Computer Configuration, Administrative Templates, Windows Components, BitLocker Drive Encryption, and Operating System Drives
  3. Edit the Require additional authentification at startup option
  4. Select the Enable option
  5. Run gpupdate.exe /force
Now you can enable Bitlocker.

UNFORTUNATELY, you then hit a snag with rEFIt not allowing you to boot off the USB key after Windows is installed, and the Bitlocker process requiring you to boot from the USB key to decrypt the drive. So, this process is pointless until rEFIt fixes that bug.

Sunday, 13 November 2011

Boot Camp Windows 7 (64-bit) on a Macbook Air (late 2010)

Installing Windows 7 (64-bit) on a Macbook Air (late 2010 model) via Boot Camp running Snow Leopard (10.6), I ran into porblems with the trackpad driver blue screening. Taking care with the installation process, I was able to avoid the problems.

Updating Boot Camp before Windows after the initial installation is complete is the key:
  1. Setup the partition using Boot Camp. I also use rEFIt to (a) allow installation from a USB drive, and (b) allow me to run Windows 8 in the last partition. You are only allowed 4 primary partitions, but there is a method to install Windows 7 without the extra 100MB partition it wants to create.
  2. Boot from the USB drive without any network connectivity and install Windows 7 as you normally would. If you have a network cable attached, after the installation is complete, you'll be in a race with the Windows 7 updater to install the Boot Camp update first. If you're using wifi, it's easy, just don't put your password in until Boot Camp is all up-to-date.
  3. Install the original Boot Camp WindowsSupport program, and reboot as requested.
  4. Check Windows 7 automatic updating is set to "manual", and enable your network connection.
  5. Run the Apple Software Update program and install the Boot Camp 3.2 update, and reboot as requested.
  6. Run the Apple Software Update program and install the Boot Camp 3.3 update, and reboot as requested.
  7. Install the Windows 7 SP1.
  8. Install the Windows 7 updates from Microsoft.
The same process worked for me in the Windows 8 Developer Preview installation.

Friday, 9 September 2011

Maven and Oracle's JDBC driver

Due to licensing restrictions, the Oracle JDBC driver jar will not be in the repository. The 
pom is there, and it's useful to add that to the conguration:

<dependency>
	<groupId>com.oracle</groupId>
	<artifactId>ojdbc14</artifactId>
	<version>10.2.0.4.0</version>
</dependency>

After that is done, you will then see an error message from mvn about "Could not find artifact com.oracle:ojdbc14:jar:10.2.0.4.0 ...". To resolve that, you need to manually add the JDBC driver jar file to your local .m2 repostiory:

mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 \
-Dversion=10.2.0.4.0 -Dpackaging=jar -Dfile=/path/to/ojdbc14.jar


PS: The ojdbc14.jar file will be on your database server in the ${ORACLE_HOME}/jdbc/lib/ directory.

Maven and Hibernate and Unit Tests (example using the JDK logger)

While attempting to run some unit tests that rely on the H2 in-memory database, I saw this failure:
...
Caused by: java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
	at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:223)
	at org.slf4j.LoggerFactory.bind(LoggerFactory.java:120)
	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:269)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:255)
	at org.hibernate.cfg.Configuration.(Configuration.java:165)
	[snip]
	... 74 more
Caused by: java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	... 82 more

The maven dependency:tree target shows:
[INFO] +- org.hibernate:hibernate-core:jar:3.5.0-Final:compile
[INFO] |  +- antlr:antlr:jar:2.7.6:compile
[INFO] |  +- dom4j:dom4j:jar:1.6.1:compile
[INFO] |  |  \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] |  +- javax.transaction:jta:jar:1.1:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.5.8:compile

The org.slf4j:slf4j-api.jar provides the interface, but not a logging implementation. To add the JDK logger implementation, and additional dependency is required:
<dependency>
	<groupid>org.slf4j</groupid>
	<artifactid>slf4j-jdk14</artifactid>
	<version>1.5.8</version>
	<scope>test</scope>
</dependency>

(version 1.5.8 is required to match the api dependency in the hibernate 3.5.0-Final libraries.

Friday, 29 July 2011

Installing the Sun JDK on Ubuntu 11.04 (Natty)


sudo apt-add-repository "deb http://archive.canonical.com/ natty partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk


Shamelessly ripped off from http://www.ivan-site.com/2011/07/installing-sun-java-jre-on-ubuntu-11-04/