Craig Box's journeys, stories and notes...


Archive for the ‘Work’ Category

ACT presents "Object reference: Not set to an instance of an object." when connecting via Citrix

Wednesday, May 23rd, 2007

The ACT! contact management application is a pig. There, I've said it. It's one of those programs that keeps changing owners - that's how much of a pig it is. Seems no-one really wants it.

They re-wrote it in .NET a couple of versions ago, and it ought to be better, but it isn't. ACT! throws "Object reference: Not set to an instance of an object." (a reasonably common .NET error) whenever it feels like it.

In my particular case, I could open it fine when using a Citrix desktop session, but as a published application, it would die all the time.

I tracked the problem to the seamless window. When you run seamlessly, you get Citrix's WFSHELL.EXE running, and not EXPLORER.EXE. You can force a published application to run at a certain screen size, which runs as if you were in a desktop. Hopefully the ACT! forums will give me a better answer.

Pimp my junk!

Tuesday, May 22nd, 2007

Note: this is all now sold. 

Compaq Proliant ML350 G3

Just because we don't need it any more, doesn't mean you don't!

The bottom three are servers we've used internally, and I'd be sad to see go if I was that kind of nerd. Especially the quirky one. Ever seen a 6GHz processor? That server has one, if you believe the BIOS. Or a 1.4GHz processor, if you believe the summary screen. Or a 3GHz processor, if you believe what it had when we bought it.

"The specified directory service attribute or value does not exist" connecting to Microsoft Exchange IMAP

Monday, May 21st, 2007

Are you getting "The specified directory service attribute or value does not exist." when connecting to Exchange IMAP? Wait a while. This error will go away - if you've just mail-enabled your account, Exchange will accept the username and password now, but it will take a few minutes for the mailbox to actually catch up.

Ruby "gem cleanup" returns "Unknown command cleanup"

Friday, May 18th, 2007
root@redhut:/usr/lib/ruby/gems/1.8# gem cleanup
ERROR:  While executing gem ... (RuntimeError)
    Unknown command cleanup

It's a bug in 0.9.3, and it will be fixed in an upcoming release.

Debugging .NET - "Common Language Runtime Debugging Services Application has generated an exception that could not be handled"

Friday, May 11th, 2007

ProfileTool doesn't work on half the machines I try it on. I get an error like:

Profiletool.exe Common Language Runtime Debugging Services
Application has generated an exception that could not be handled.
Process ID=0x14 (1300), Thread Id=0xe8(232)

Click OK to terminate the application.
Click CANCEL to debug the application.

There's no point searching Google for the process ID and thread number; they're unique to your instance.

What can you do here? You get an error suggesting that 'debugging failed' if you hit Cancel - this is correct, because you don't have a debugger installed!

First step, if you're running your .NET application off the network, stop, move it to your local disk, and try again. The default security policy doesn't let you do this - you can edit it in the Administrative Tools if you need to.

Now, if you still get the error, drop to a command line, and run the following:

ProfileTool 2>error.log

This redirects the standard error output to error.log, which you can then read. Linux/UNIX outputs this to the terminal by default; Windows hides it.

Thanks to Frank Racis, by way of Mohamed Yehia.

The actual error, in this case, was "No mapping between user accounts and security IDs was done", which really means "don't catch System.SystemException when you are throwing System.Exception". And when you're testing new builds, don't sit behind an ISA server which aggressively caches the old build.

Access 2003 fires up Windows Installer every time you run it

Monday, April 30th, 2007

Found an interesting problem this morning - Access 2003 fires up Windows Installer (msiexec.exe) every time you start it, and for users without administrator rights, it just doesn't go.

After looking at dozens of newsgroup posts and trying a few solutions, I finally had enough debugging information to find the solution that worked: registry keys are missing from HKLM\Software\Microsoft\Jet\4.0\Engines. Copy them from another machine (changing paths where required) and it works again!  Would of course love to know what caused a bunch of registry keys to just disappear...

For those interested, I found that msiexec was writing to a log file using Filemon, and the log file contained the error "Cannot Open Jet XL ISAM registry key" - descriptive enough to find the solution.

Gray boxes when viewing Java applets

Wednesday, April 25th, 2007

Do you find you get gray boxes when you're looking at a web page with a Java applet (such as the Companies Office or JavaTester)?

You know you have the Sun JVM installed correctly, there are no traces of the Microsoft JVM, the plugin exists, but you can't see it in either Firefox or IE?

I had this problem for some time, and have finally found the cause - I have a custom transform for deploying Java, which turned off automatic updates, set the default JVM, etc, and also accepted the EULA.  As of about 1.5.0 Update 6,  setting EULA to 0 means that the JVM looks for EULA.DLL, doesn't find it, and silently dies.

Don't set the EULA property to 0 anymore. Ignore it.

You also used to be able to turn off the Automatic Updates in the properties table, but you can't any more.  You have to edit the MSI to run a registry script as the last action, and even then there are reports that Java will create the links on first-run.  I don't want my workstations getting a pop-up message saying Java will update when I carefully select the version to deploy, thanks Sun!

ProfileTool beta released

Wednesday, April 25th, 2007

ProfileTool screenshotI don't often write code, but I do find it's a good complement to cricket watching. So, in honour of New Zealand playing Sri Lanka in the World Cup semi-final, I'm proud to announce the release of the first public beta of the IT Partners ProfileTool.

ProfileTool lets you take a Windows 2000 or XP user's profile and assign it to a different user, without having to copy any files or perform any manual procedures.

This is a common task for people who are taking a network of PCs that have not been on a domain, and joining them to one; or if you replace a domain controller without keeping security information, which is sometimes done on sites upgrading from a badly installed SBS 2000 installation to a nicely installed SBS 2003 installation.

It also has useful features for deleting a profile off the disk/from the registry, and changing profiles from roaming to local, replicating the features of the User Profiles capplet.

The source is available under the Mozilla Public License, with the implication of "Do what you like with this code, but if you improve it, I'd like your source to come back to me please".

I like bargains

Wednesday, April 18th, 2007

 Note: this is all now sold.

ServerAnd I have many to offer today.

How about an IBM X226 server, kitted out with 3GB of RAM, for $1? Or perhaps you'd be more interested in a Mac Mini, for $1?

Targeting .NET 1.1 harder than it seems

Wednesday, March 21st, 2007

I'd like my application to be able to run on .NET 1.1, so I've avoided using all the new niceties of .NET 2.0.

Or so I thought.

First, I experimented with MSBee, which lets you build for the .NET 1.1 environment using the VS 2005 tools. After seeing how many errors my code generated in 1.1, while it compiled cleanly in 2.0, I thought "maybe reimplementing this in VS 2003 might be easier".
And while I've specifically avoided some of the .NET 2.0 things that would have been really handy, like the SecurityIdentifier class, which makes handling SID-account mapping easy, there's things I didn't know would be a problem. You can't set a registry key to be a certain type in 1.1. And you can't use half the features that the designer implements for you automatically. And even if you could, you'd have to hack at it, because they separate code and design with partial classes in 2.0.

So, to summarize, looks like .NET was pretty crap prior to 2005. And that means you need to have XP SP2, because it's not supported on SP1.

(/rant)