Mac 10.6.5 Snow Leopard Server LDAP Bug

Media_httpwwwgcsdblog_hgwzg

Many thanks to Roodhouse Tech Blog for pointing me in the right direction regarding an issue with Open Directory on my Mac Server after a certificate update.

Share Comments

Listening to Sense.fm while they fix their domain registry

Sense.fm's domain registration expired Sept. 16th - oops. That makes their website and streams inaccessible through normal means until they are able to resolve the registry issues.

The good news is that they are continuing to broadcast so if you simply bypass the DNS network you can get around the issue and get your Sense.fm fix.

The easiest way to work around the issue is to add an entry to your hosts file. A quick dig of their nameservers (ns1.webpartnersworldwide.com) shows us the IP address we need is 174.121.134.99.

So we want to add the following to our hosts file:

174.121.134.99 sense.fm www.sense.fm

On sane systems like my Mac the hosts file is /etc/hosts but on Windows it's usually 

c:windowssystem32driversetchosts

After you add the sense.fm line to your hosts file just open your browser and visit www.sense.fm like normal.

You're welcome!

 

 

Share Comments

Upgrading a Snow Leopard development machine to Lion

1. Install Lion

If you heard about the small business 20-pack of licences Apple offered when they announced Lion and think you might want to go that route - don't.  Trust me.  They can take your payment but they just can't fulfill your order ... and that's really the most important part. Two months later I have a micro USB drive and am finally starting the upgrades.

2. Use App Store to download & install XCode

Annoying. At least they fixed the download process to support resumes. Mine cutoff at 98% of the 4G download but picked back up where it left off on resume.

3. Run  "/Applications/Install Xcode.app"

So when App Store said it was "Installing Xcode" it meant it was installing the Xcode installer. Sadly, it took me a while to figure this one out ... and I am not alone.

4. Install MacPorts 2.0.3 or greater

MacPorts install for Lion worked the first time with no hassle - Apple could learn a thing or two.

5. Run "port upgrade outdated"

This takes some time but ran without error for me...nice.

6. Update php.ini

Lion upgrades to PHP 2.3.0 and saves but disables your existing php.ini - at a minimum you'll need to update your mysql socket entries to point to the same place as your my.cnf 

7. Install a JDK

I attempted to run a Java driven app (LibreOffice) and Lion magically prompted me to install Java. I let it and the install process flawlessly setup a full JDK instead of just a JRE - nice job Apple.

8. Toggle trackpad scroll direction

If all my devices used Lion I'm certain I'd adapt to the inverted scrolling in just a few hours - but they don't and that causes wheel spinning everytime I begin a Lion based session.  I see no net benefit so it's not worth the pain.  System Preferences -> Trackpad -> Scroll direction -> unchceck

9. Install the updated Server tools

If you run a Mac Server and want to use your Lion workstation to manage its services...you need the updated Mac Server Tools.

10. Disable Dashboard

I don't care for widgets.

defaults write com.apple.dashboard mcx-disabled -boolean YES
killall Dock

11. Install JDK source

Grab the Java for Mac OS X 10.7 Developer Package from http://connect.apple.com/
It'll put the src.jar here

/Library/Java/JavaVirtualMachines/1.6.0_26-b03-383.jdk/Contents/Home/src.jar

Share Comments

SLF4JLocationAwareLog serialization exception

While attempting to make a large object graph serializable I kept encountering NotSerializableExceptions regarding my Log references which were instances of SLF4JLocationAwareLog. The references were declared transient so I beat my head on a wall for a few hours before upgrading my slf4j version from 1.4.2 to 1.5.8

Somewhat frustratingly - that resolved the issue. No idea why.

Share Comments

Winner takes all network effect

Read this - http://edge.org/conversation/the-local-global-flip

Share Comments

Resolving 'Can't connect to window server - not enough permissions' forMaven test runs

Our CI server (we use Jenkins) recently began bombing on several new tests that referenced java.awt packaged classes. The most common error in the stacktrace was "NoClassDefFoundError: Could not initialize class java.awt.Color" and diving deeper we could see the root cause was "Can't connect to window server - not enough permissions".
The interwebs all claimed setting -Djava.awt.headless=true would resolve the issue but it did nothing for us. We set it as a Jenkins system parameter, in the launchctl job, in the bash_profile of the Jenkins user on the machine, and everywhere we could in the Jenkins job itself....to no avail.
Just before heading down the path of setting it programatically somewhere in our test stack - I noticed that our maven-surefire-plugin was configured to use a threadCount of 10. On a hunch that maven-surefire-plugin was not exporting my system properties to the new threads it spawned for the test run - I configured the plugin to set java.awt.headless with the following snip from our pom.xml
<plugin>  
<groupId>org.apache.maven.plugins</groupId>  
<artifactId>maven-surefire-plugin</artifactId>  
<version>2.5</version>  
<configuration>        
<excludes>         
<exclude>**/TestInstanceBakerTest.java</exclude>         
<exclude>**/ExpectedAnswerGeneratorTest.java</exclude>         
<exclude>**/ClientNukeTest.java</exclude>         
<exclude>**/TestInstanceBank.java</exclude>        
</excludes>    
<parallel>true</parallel>    
<threadCount>10</threadCount>      
<systemPropertyVariables>          
<java.awt.headless>true</java.awt.headless>          
<log4j.configuration>${runtime.log4j.config}</log4j.configuration>                                        
</systemPropertyVariables>                
</configuration></plugin>

Problem solved.
Share Comments

Resolving 'Connection.close() has already been called.' when running long db-migration

I tune my datasource appropriate for runtime but also use the same datasource for db-migration activities on application startup. For some particularly long db-migration runs - I began encountering a "Connection.close() has already been called." error.  The easy workaround was to bump the value of MySQL's wait_timeout parameter.

Don't for get to restart MySQL afterwards.

Also - if you're using a dbcp datasource try setting testOnBorrow to true if you have it explicitly set to false.

You're welcome.

Share Comments

JSP tricks to make templating easier on Stack Overflow

The beauty of JSP Tag files is that it lets you basically tag generic markup and then refactor it to your hearts content.

JSP Tag Files have pretty much usurped things like Tiles etc., at least for me. I find them much easier to use as the only structure is what you give it, nothing preconceived. Plus you can use JSP tag files for other things (like the user detail fragment above).

Will Hartung's overview of JSP 2.0's Tag Files is a great primer

Share Comments

Testing a local web application with multiple operatings systems using VirtualBox

I develop on Mac OS X and frequently need to test my local build using Internet Explorer on a flavor of MS Windows. VirtualBox has supported an easy method of doing so since version 2.2 

Add a new Network Adapter to each of your VirtualBox Guests (I run Windows XP and Windows 7 as Guests) and choose "Host-only Adapter" for the "Attached to:" option. This will result in the creation of a new loopback interface on your Host and a private network interface on each Guest.

On Windows use the command line "ipconfig" to determine the new interface settings. On Mac run "ifconfig" to do the same.  

With my setup the host (my mac) was assigned the vboxnet0 interface with private IP address 192.168.56.1 so I punched a hole in my host's firewall to allow each Guest to access ports 80,443,8080,8443 on that subnet. Now I can simply open a browser on any guest and access the webserver running my local build on my host like - https://192.168.56.1:8443/

 

Share Comments

MacPorts: MySQL upgrade from 5.0.x to 5.1.x error Column count of mysql.proc is wrong

sudo  /opt/local/lib/mysql5/bin/mysql_upgrade -uroot -p –basedir=/opt/local/lib/mysql5/bin/mysql

Command above resolved my "Column count of mysql.proc is wrong" error after a macports upgrade to 5.1.x

Share Comments