No implementation defined for org.apache.commons.logging.LogFactory

While writing a DB2 stored procedure that invoked a SOAP/WSDL web service using Apache Axis as part of WSIF, I ran into this doozie:

Ultimately, it’s caused by a too restrictive lib/security/java.policy file that ships with DB2.

Wrong Solution

The standard way to define an implementation is to create the following commons-logging.properties file and place it anywhere in your CLASSPATH (such as the root of a JAR file):

Alternatively, you can set the org.apache.commons.logging.Log configuration attribute for LogFactory programmatically.

Right Solution

Solution: Running an Axis SOAP client in Domino [or DB2]

My DB2 is installed into C:\Program Files\IBM\SQLLIB

1. Copy all your JARs to C:\Program Files\IBM\SQLLIB\java\jdk\jre\lib\ext
2. Open C:\Program Files\IBM\SQLLIB\java\jdk\jre\lib\security\
3. Open java.policy
4. Add:

5. Restart DB2

Utilities for Windows I

Hard Drive Cleanup

WinDirStat is an excellent utility for visualizing your used disk space and drilling down to files that you can clean up, back up, and delete. It’s similar to SequoiaView and Steffen Gerlach’s Scanner, but even more powerful. You can drill down through a folder tree as well as highlight filetypes in the graphical representation. The next time my hard drive gets too full, this is the utility I’ll use to clean things up.

WinDirStat

It’s only weakness is that you can’t drill down in the visual representation once it’s built, unlike both SequoiaView and Scanner.

Scanner 0Scanner 1Scanner 2

Startup Management

AutoRuns is a very comprehensive utility for dealing with the bane of hidden startup programs. TSRs and daemons date back to prehistory, but starting with Win95 a lot of rude programs began adding themselves to the system tray. This utility exposes all of the different hooks for management.

Autoruns

Task Management

Process Explorer can:

  • Kill processes Task Manager cannot
  • Find which process is preventing you from deleting a file
  • Match up processes to windows
  • Kill the root process of a multi-process app

Process Explorer

I find it invaluable on any Windows install.

Defragmentation

As you delete files from your hard drive, gaps of empty space form. New files get split into parts across these gaps. Over time, performance degrades. Some file systems are less vulnerable to this than others, but both NTFS and FAT are affected.

Windows comes with a defragmenter, but it has stayed uniformly crappy and slow since 95. I vastly prefer Vopt. Unfortunately, it’s shareware. It’s also well done, informative, and very fast.

Is there a good, free alternative?

Vopt

Gods, I need to defragment!

Hidden Settings

Tweak UI is a cliché choice, but I don’t know of a good replacement. My favourite tweak is to disable everything except Text Document from the New submenu in Explorer. I only ever create Folders and Text Documents that way, and Explorer significantly delays the display of the menu until all the useless icons are loaded.

Tweak UI

While you are there, grab Create Command Window Here and Power Calculator. Being able to open a command prompt window by right-clicking on a folder is very convenient. Meanwhile, Power Calc has a usable history, saveable formulas, primitive graphing, and super-handy unit conversions.

Choosing colours

One of the tricky things in web design is picking the right colours. They need to be easy to read, not grim, not flashy, yet somehow distinctive. Often, taking a stab in the dark and then tweaking a screenshot of the result for saturation, contrast, and the like can be very effective. At other times, you need a starting point.

These have all helped me:

Unexpected for following namespace declaration

I ran into a problem running a simple test xquery. I hadn’t directly dealt with XML namespaces in xquery prior to this, but the documentation was clear enough:

XQUERY
declare default element namespace "http://posample.org"
for $x in db2-fn:xmlcolumn("PURCHASEORDER.PORDER")
return $x

Oops, EOF error. It needs a terminator.

XQUERY
declare default element namespace "http://posample.org"
for $x in db2-fn:xmlcolumn("PURCHASEORDER.PORDER")
return $x;

Unexpected “for” following the namespace declaration? Pardon? It turns out xquery prologs need to be terminated by a semicolon:

XQUERY
declare default element namespace "http://posample.org";
for $x in db2-fn:xmlcolumn("PURCHASEORDER.PORDER")
return $x;

Unexpected “http://posample.org”? But that’s the exact syntax given in the examples! Alas, this semicolon is distinct from the usual semicolon separator in SQL. It’s part of a single xquery statement, so what I need to do is change the SQL separator to something more exotic. This will allow xquery to be parsed correctly:

XQUERY
declare default element namespace "http://posample.org";
for $x in db2-fn:xmlcolumn("PURCHASEORDER.PORDER")
return $x@

Eureka.:)

Mapping DB2 databases after a reinstall

Due to the vagaries of software, I had to reinstall DB2 on my laptop. Unfortunately, the existing databases were not automatically added to the Control Center.

Physically, DB2 stores its databases in a directory similar to C:\DB2\NODE0000. Logically, there must a way to remap them. So, how does one remap them?

To list databases stored at a path:
% db2 list db directory on c:

To recatalog them:
% db2 catalog db SAMPLE on c:

Reference:
DB2 at a Glance | The DB2 Environment

Installing Pear and PECL on Zend Core for IBM

Links

Atomized | PHP Performance Best Practices – Informative.

Installing PEAR and PECL on Zend Core for IBM

  1. Save http://go-pear.org/ to go-pear.php (in, say, C:\Program Files\Zend\Core for IBM\pear)
  2. Open Command Prompt
  3. % cd “C:\Program Files\Zend\Core for IBM\pear”
  4. % ../bin/php go-pear.php
  5. Follow the steps and let it modify your php.ini
  6. Restart your Apache

Installing the profiling packages mentioned in Best Practices

  1. % pear install Benchmark
  2. % pecl install apd

WinSCP

Sometimes I develop on Linux, sometimes on Windows. It’s mostly Windows right now. I tend towards editing with UltraEdit (or the free Crimson Editor, uploading with WinSCP, and doing command-line stuff with Cygwin. If you just want ssh (new-fangled telnet), PuTTY is easier to get working.

If I keep doing PHP stuff, I might end up switching to the Eclipse PHP IDE. Stranger things have happenned.

There’s a list of useful Windows software on my wiki.

Greetings!

I work on the free (as in share kegs of beer with your friends) DB2 Express-C at IBM. They have me writing demo applications and tutorials, which means I get to play with lots of neat stuff like Ruby, Python, PHP, Javascript, Dojo, etc. There’s lots of technical stuff, tips, ideas I happen upon in my projects. This seems an excellent forum to disseminate such…

BTW, IBM (or any other company) is not in any way responsible/liable/at-fault for anything I say. What I say is my own opinion.

Q’apla!