Search this site:
Enterprise Search Blog
« NIE Newsletter

Why did my Ultraseek XPA Code Stop Working? - Ask Dr. Search

Last Updated Mar 2009

By: Mark Bennett, Volume 2 - Number 8 - Fall 2005

This month's question comes from Dr. Search himself. Why the heck did the code that worked earlier (Enterprise Search - January 2005) stop working?

Excellent question.

Dr. Search looked long and hard when he recently was using the earlier example of using the Ultraseek XPA in Java. First it worked; then it didn't work. What was the difference? As you well know, when you are sure everything is right and it still doesn't work, something you are sure of is wrong.

Sure enough. Since the last time he used that code, Dr. Search had downloaded a new version of the Ultraseek XPA. Version 2.2.0. Using that code, freshly downloaded from the Verity web site, caused this odd error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at com.ultraseek.xpa.server.UltraseekServer. <clinit> (UltraseekServer.java:54)
at Search1.main(Search1.java:27)

There are a few possibilities here.

First, the XPA may have changed between Version 2.1.2.

Second, the new XPA download may have introduced an odd error.

Or finally, there may be a problem with the 2.2.0 release XPA.

With the help of an anonymous source inside of Verity known only as "Deep Code" who knows all about Ultraseek (and who reads the release notes), Dr. Search has discovered that the newest XPA release also requires the commons-logging.jar file available from the Apache Jakarta Project. These new libraries enable client logging in Ultraseek, and it's good to see that Verity chose to go with the standard solution rather than implement a proprietary solution. So the solution to get the code working again is to either use the existing xpasearch_2.1.2 jar file; or upgrade to xpasearch-2.2.0 and also download the logging jar file from the Apache Jakarta Project Commons Download page.

Finally, to fix the classpath in the compile and run batch files we published back in January, make the following changes.

COMPILE_SEARCH.BAT

@echo off
echo Compiling Search1.java
set TARGET=Search1.java
set MYCP=C:\testxpa\xpasearch.jar;c:\commons\common_logging.jar;
set JAVAC=javac

"%JAVAC%" -classpath ".;%MYCP%" %TARGET%

RUN_SEARCH.BAT

@echo off
echo Running Search1
set TARGET=Search1
set MYCP=C:\testxpa\xpasearch.jar;;c:\commons\common_logging.jar;
set JAVA=java

"%JAVA%" -cp ".;%MYCP%" %TARGET%

Feel free to send your enterprise search questions to Dr. Search. Every entry (with name and address) gets a free cup and a pen, and the eternal thanks of Dr. Search and his readers.