Discussion:
ICatAdm.IsCatalogRunning - throws CI_E_NOT_FOUND on Vista
(too old to reply)
David Howell
2007-01-23 15:41:36 UTC
Permalink
There is a failure in our current (.NET/C#) application when it is run
on the Microsoft Vista OS (this is after the feature is installed, which
it is not by default).

The error occurs on the IsCatalog* methods on the ICatAdm interface. It
throws a ComException with ErrorCode 0x80041815 (CI_E_NOT_FOUND). The
sample application I wrote to simplify this works fine on Windows XP.

Has anyone else encountered this error? Any ideas on the source of the
problem?

ICatAdm.StartCatalog() and ICatAdm.StopCatalog() are misbehaving too.


Here is a snippet of the code I am using:


using CIODMLib;

...
AdminIndexServerClass aisc = new AdminIndexServerClass();
aisc.Stop(); // stop to create catalog
ICatAdm catalog = aisc.AddCatalog(catalogName, catalogFolder) as ICatAdm;
IScopeAdm dirScope = catalog.AddScope(catalogFolder, false, null, null)
as IScopeAdm;
aisc.Start(); // start to inspect properties/state
PrintCatalogProperties(catalog); // note that this works fine
TestCatalog(catalog);
...
aisc.Stop();
aisc.RemoveCatalog(catalogName, true/*fDelDirectory*/); // works ok

private void TestCatalog(ICatAdm catalog)
{
try
{
if (catalog.IsCatalogRunning())
Console.WriteLine("{RUNNING}");
else if (catalog.IsCatalogStopped())
Console.WriteLine("{STOPPED}");
else if (catalog.IsCatalogPaused())
Console.WriteLine("{PAUSED}");
}
catch (System.Runtime.InteropServices.COMException e)
{
// catches 0x80041815 here
}
}

private void PrintCatalogProperties(ICatAdm catalog)
{
Console.WriteLine(String.Empty.PadRight(24, '-'));
Console.WriteLine("Catalog properties:");
Console.WriteLine("CatalogName" + catalog.CatalogName);
Console.WriteLine("CatalogLocation" + catalog.CatalogLocation);
Console.WriteLine("DelayedFilterCount" + catalog.DelayedFilterCount);
Console.WriteLine("DocumentsToFilter" + catalog.DocumentsToFilter);
Console.WriteLine("FilteredDocumentCount" +
catalog.FilteredDocumentCount);
Console.WriteLine("FreshTestCount" + catalog.FreshTestCount);
Console.WriteLine("IndexSize" + catalog.IndexSize);
Console.WriteLine("IsUpToDate" + catalog.IsUpToDate);
Console.WriteLine("PctMergeComplete" + catalog.PctMergeComplete);
Console.WriteLine("PendingScanCount" + catalog.PendingScanCount);
Console.WriteLine("PersistentIndexCount" +
catalog.PersistentIndexCount);
Console.WriteLine("QueryCount" + catalog.QueryCount);
Console.WriteLine("StateInfo" + catalog.StateInfo);
Console.WriteLine("TotalDocumentCount" + catalog.TotalDocumentCount);
Console.WriteLine("UniqueKeyCount" + catalog.UniqueKeyCount);
Console.WriteLine("WordListCount" + catalog.WordListCount);
}




Another interesting tidbit: if I attempt to Stop/Start the catalog (and
swallow the ComException) before the TestCatalog(catalog) call, the
IsCatalog* calls work. ?!?

Lastly, not that it should matter (I hope), I built the sample EXE with
Visual Studio 2005 on Windows XP Pro. SP2 with a Reference to ciodm.dll
on that machine. I copied the EXE to an instance of the Vista OS on
VMWare Player.

-dave
David Howell
2007-02-12 19:08:46 UTC
Permalink
Just for the record, the exception was due to the length of the
catalogName string. Limitations on the length of this name is not
documented anywhere. In WinXP, I found that I could use up to 40
characters, but in Vista this limit is now down to 13 characters.
A fix from MS may or may not be forthcoming.
-dh
Post by David Howell
There is a failure in our current (.NET/C#) application when it is run
on the Microsoft Vista OS (this is after the feature is installed, which
it is not by default).
The error occurs on the IsCatalog* methods on the ICatAdm interface. It
throws a ComException with ErrorCode 0x80041815 (CI_E_NOT_FOUND). The
sample application I wrote to simplify this works fine on Windows XP.
Has anyone else encountered this error? Any ideas on the source of the
problem?
ICatAdm.StartCatalog() and ICatAdm.StopCatalog() are misbehaving too.
using CIODMLib;
...
AdminIndexServerClass aisc = new AdminIndexServerClass();
aisc.Stop(); // stop to create catalog
ICatAdm catalog = aisc.AddCatalog(catalogName, catalogFolder) as ICatAdm;
IScopeAdm dirScope = catalog.AddScope(catalogFolder, false, null, null)
as IScopeAdm;
aisc.Start(); // start to inspect properties/state
PrintCatalogProperties(catalog); // note that this works fine
TestCatalog(catalog);
...
aisc.Stop();
aisc.RemoveCatalog(catalogName, true/*fDelDirectory*/); // works ok
private void TestCatalog(ICatAdm catalog)
{
try
{
if (catalog.IsCatalogRunning())
Console.WriteLine("{RUNNING}");
else if (catalog.IsCatalogStopped())
Console.WriteLine("{STOPPED}");
else if (catalog.IsCatalogPaused())
Console.WriteLine("{PAUSED}");
}
catch (System.Runtime.InteropServices.COMException e)
{
// catches 0x80041815 here
}
}
private void PrintCatalogProperties(ICatAdm catalog)
{
Console.WriteLine(String.Empty.PadRight(24, '-'));
Console.WriteLine("Catalog properties:");
Console.WriteLine("CatalogName" + catalog.CatalogName);
Console.WriteLine("CatalogLocation" + catalog.CatalogLocation);
Console.WriteLine("DelayedFilterCount" + catalog.DelayedFilterCount);
Console.WriteLine("DocumentsToFilter" + catalog.DocumentsToFilter);
Console.WriteLine("FilteredDocumentCount" +
catalog.FilteredDocumentCount);
Console.WriteLine("FreshTestCount" + catalog.FreshTestCount);
Console.WriteLine("IndexSize" + catalog.IndexSize);
Console.WriteLine("IsUpToDate" + catalog.IsUpToDate);
Console.WriteLine("PctMergeComplete" + catalog.PctMergeComplete);
Console.WriteLine("PendingScanCount" + catalog.PendingScanCount);
Console.WriteLine("PersistentIndexCount" +
catalog.PersistentIndexCount);
Console.WriteLine("QueryCount" + catalog.QueryCount);
Console.WriteLine("StateInfo" + catalog.StateInfo);
Console.WriteLine("TotalDocumentCount" + catalog.TotalDocumentCount);
Console.WriteLine("UniqueKeyCount" + catalog.UniqueKeyCount);
Console.WriteLine("WordListCount" + catalog.WordListCount);
}
Another interesting tidbit: if I attempt to Stop/Start the catalog (and
swallow the ComException) before the TestCatalog(catalog) call, the
IsCatalog* calls work. ?!?
Lastly, not that it should matter (I hope), I built the sample EXE with
Visual Studio 2005 on Windows XP Pro. SP2 with a Reference to ciodm.dll
on that machine. I copied the EXE to an instance of the Vista OS on
VMWare Player.
-dave
Loading...