Skip to content


Cash Advance Loans Cash Advance Loans


Running Multiple Firefox Profiles At The Same Time

With some help from this blog post, I was able to get past a long-standing Firefox annoyance and run multiple profiles at the same time.

firefox -no-remote -P <profile>

Posted in General.


Java vs. C# – Array Declarations

I’ve been practicing the Bowling Game Kata in Eclipse the past few days, and this evening I did the kata in Visual Studio 2010 Beta 2.  I’ve done a bit of C#/.NET 2.0 development in the past, 2006-2008, but I haven’t worked with it daily in over a year.  In that time I’ve been working on projects that involve Java.  (I think most people go the other direction, from Java to C#.  But anyway.)  I had got to the point with Eclipse where I could quickly create and refactor Java code, so switching to C#/Visual Studio was a challenge.  For one thing, the syntax of the languages are similar but not exact.  I can’t go into all of the differences, and others have already done that better than I could, but I’ll try to highlight some differences that I find interesting or that trip me up, mainly for my own benefit.

One difference that I found interesting (in a “why the hell is this different?” sort of way) is array declarations.

In Java, I was declaring an array like this:

private int rolls[] = new int[21];

The same array in C# has to be declared like this:

private int[] rolls = new int[21];

Huge difference, huh?  I have no idea why the C# language designers made this different from Java; maybe if I did some more research I’d find the history behind that design decision.  I found that Java allows arrays to be declared with either format, so maybe I should simply use the latter format all the time.

I know this is far from the biggest difference between the two languages, but this seems like a subtle difference that didn’t need to be a difference.  And again, I haven’t done a lot of research into the issue.

Posted in Programming.


IBM iSeries, WebSphere, Spring, Web Services, and XSDs

Recently I’ve been trying to get a Java web service working on the IBM iSeries platform (previously known as AS/400).  The web service is running on the WebSphere application server with Spring providing the SOAP framework through spring-ws.

The web service is in the prototype stage, and it was originally written to run on Apache Tomcat on Windows.  Once the web service became stable, my coworkers and I began running it on the iSeries.  Not surprisingly, we had to change some of our code to get the web service working on the new platform.

The first problem came up before our code even executed.  We have a validatingInterceptor to verify that the incoming XML message matched our schema.   Our XML schema file, let’s call it a.xsd, referenced another schema file, b.xsd, but b.xsd wasn’t being found.  Errors were showing up in the log file that looked like this:

Caused by: org.springframework.xml.validation.XmlValidationException: Could not create Schema: schema_reference.4: Failed to read schema document ‘b.xsd’, because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not .; nested exception is org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document ‘b.xsd’, because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not.
at org.springframework.xml.validation.Jaxp13ValidatorFactory.createValidator (Jaxp13ValidatorFactory.java:44)
at org.springframework.xml.validation.XmlValidatorFactory.createValidator (XmlValidatorFactory.java:91)
at org.springframework.ws.server.endpoint.interceptor.AbstractValidatingInterceptor.afterPropertiesSet (AbstractValidatingInterceptor.java:153)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods (AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean (AbstractAutowireCapableBeanFactory.java:1335)

I spent hours trying to figure out what was wrong.  Everything worked fine on Windows/Tomcat.  The XSDs were in the WEB-INF directory of the web service.  At first I thought it was a Java classpath problem, so I moved the XSDs under the WEB-INF/classes directory – didn’t work.  I tried changing WebSphere settings – didn’t work.

The exception seemed to be originating in the Xerces XML parser.  So I put some debugging messages in the code to try to track down what was going wrong.  (There are almost certainly better ways to debug such problems, but I’m new to both the Java and iSeries platforms.)

Eventually, I tracked the problem back to the SaxUtils class of spring-ws.  One of its methods was trying to find a OS specific URI for the base xsd file but was returning null.  It was at this point that I realized that the web service name defined in web.xml had spaces in it, “Test Web Service”.

The name of the service became part of the filesystem path where the web service was installed:

\qibm\userdata\websphere\appserver\v7\express\profiles\was70svr\installedApps\D1_WAS70SVR\Test Web Service.ear\WebApp.war\WEB-INF\a.xsd

I had noticed the spaces before, of course, but it hadn’t occurred to me that they could be a problem – the OS was happy to create a path with spaces, and I would have expected the OS to complain if spaces were a problem.  But I think the URI or URL of a.xsd had the spaces converted to “%20”s, which did cause a problem on the iSeries.

I replaced the spaces with underscores, and the problem went away.

All that time troubleshooting, and the problem was fixed by by a one-line configuration change.

Posted in iSeries, Spring, WebSphere.


On Building a VMware ESXi Server

I run several of my home servers on a white box VMware ESXi server that I assembled myself, but lately it’s been has been having stability problems.  I have had a couple of VMware “purple-screens-of-death,” several “blue-screens-of-death” on my Windows 2008 Server and Windows 7 VMs, and several kernel panics on my Linux servers.  Not good.  I don’t think heat is a problem, especially as the temperatures have been cooler recently, and the physical machine is in my basement, usually the coolest part of the house.  I’m considering the possibility that I have a hardware problem.

If I need to get a new CPU, motherboard, and memory, I won’t get a cheap mini-ATX motherboard this time.  I’ll try to find a server-class board that won’t break the bank.  And I want a board that will handle more than 8GB of RAM without having to buy super-expensive 4GB DIMMs.

I did some reading of the Tech Report’s System Guide and Newegg.  It looks like I will have to go with an Intel CPU and motherboard, along with DDR3 memory, in order to get a board that supports for then 8GB.  Such a motherboard will cost about $250.  Ouch.  But if I get a good one, I won’t need another for several years – I should be able to upgrade processors and memory as time goes by.  At least, that’s the theory.  Pairing such a motherboard with 8-12GB of DDR3 and a quad-core CPU will give me plenty of power.

All that won’t come cheap, though.  It will probably cost around $750.  But if I can get a powerful and stable system that will last for years, it will be worth it to me.

Posted in Hardware, VMware.


dd for Windows

My new favorite utility is dd for Windows , at least it was yesterday.  Here’s the short story:

Yesterday I was trying to upgrade my VMware ESXi 3.5 server to ESXi 4.0.  The remote installation failed, and the server wouldn’t boot.  I tried using the ESXi’s “Repair” option, but that didn’t work, telling me that the partition table was corrupt or unrecognized (I don’t remember the exact wording).  Reading an error message like that doesn’t leave one with a warm and fuzzy feeling.  I had a lot of stuff on those virtual machines (VMs) that I cared about, and most of it was backed up, but not all of it.  (Not backing up first was just dumb on my part.)

I didn’t want to re-install ESXi because that option said any preexisting VMs would not be available “right away” – I had a feeling “right away” could end up being “ever.”  So I searched for other options.

As I was searching the web, I ran across mention of installing ESXi on USB thumb drives and booting off them.  I had a 1GB thumb drive that I haven’t used in a couple of years.  So I grabbed it and tried to find some instructions.  Fortunately, the process doesn’t have too many steps, but the last one took me awhile to get right.  That last step involved writing a raw disk image to the thumb drive.  The instructions I had found said to use a utility called WinImage to write the disk image, but I wasn’t able to get the WinImage software.  So I looked for alternatives.

What I needed was a version of the dd command that worked on Windows.  The Unix dd command is a powerful tool for low-level filesystem copying and data translation.  I was working from my WinXP laptop, but I have Linux machines available – I could have used dd from one of those machines.  But I was lazy and wanted to stay on the laptop.

Before long I found dd for Windows , and it ended up working, but it took a little while to find the right options.

dd is very powerful; it can also be dangerous.  It’s a good idea to double-check any dd commands to verify that you are telling dd to do what you want instead of, for example, overwriting your OS drive.  So I took this step slowly.

dd for Windows has a “–list” option that showed a low-level view of the mounted filesystems.  My thumb drive had two partitions listed and at first I tried using Partition1, but even though the command seemed to work without errors, WinXP said the thumb drive was unformatted, and the drive wouldn’t boot my VMware server.  Eventually, I looked more closely at the “–list” output and saw that two partitions were listed for the thumb drive and I tried writing to Partition0.  That worked.  Windows saw files on the thumb drive, and I was able to use it to boot the VMware server.

Here is the command I used:

dd if=VMware-VMvisor-big-3.5.0_Update_4-153875.i386.dd of=\\?\Device\Harddisk1\Partition0  bs=1M  –progress

I had to reconfigure ESXi once I got it to boot, but all of the VMs worked fine after I re-added them to the configuration.  I am going to leave the thumb drive as the boot drive for the time being.  Eventually, I’ll upgrade to ESXi 4.0, but I’m in no hurry – I came too close to loosing all my VMs this time.  Next time, I’ll make sure everything is backed up, and I’ll install 4.0 to a clean hard disk.  I don’t think I’ll be trusting VMware’s update utility any time soon.

Posted in Aim At Foot - Fire, VMware.


The Beginning

stormshrike-blog-header

I love computers.  I love writing software.  I love finding new tools and learning to use them.  I love discovering new ways of doing things.  I hope to share some of my experiences in these areas on this website and blog.

Setting up this website has been a learning experience.  I’m not a web programmer – I’ve spent most of my career developing rich client interfaces – so I’m learning the basics of web coding and design.

Until recently, web development just didn’t appeal to me – web browsers didn’t offer very interesting user interfaces.  But the interwebs has come a long ways in the last few years, and sophisticated user interfaces technologies (AJAX and Silverlight for example) and web service standards make the web a more attractive platform to me than in the past.

Web development is just one topic that I hope to explore here.  Software development is a fast moving field – there should be plenty to talk about.

Posted in General.

Tagged with .