Testing Catalog examples: not working...
Hello,
I tried to go through the "Using catalogs" section of the manual (Part 3):
I started psyclone with spec:
<psySpec name=" test catalogs" version="1.2">
<whiteboard name="WB1" maxcount="10000">
<description>...</description>
<catalog name="MyFileCatalog" queryhandler="FileCatalog">
<parameter name="location" type="String" value="."/>
<parameter name="readonly" type="String" value="no"/>
</catalog>
</whiteboard>
</psySpec>
Then I tried to use this code for external module in Java (I used the JavaTester example code
keeping the:
String xml = "<module name=\"JavaTester\" ...
data for the module registration)
and added the following:
Message msg = new Message();
msg.type = "Write";
msg.set("Filename", "MyFileName"); // what connection with the MyFileCatalog?
msg.content = "My File Contents, bla bla ";
//msg.set("<param2>", "Param2");
InfoItem answer = plug.queryCatalog("MyFileCatalog", msg);
// Note: method NOT visible: correct it to "public" in Communicator
if (answer == null)
error = "No Catalog by that name";
else if (!answer.getEntry("Status").equalsIgnoreCase("Success"))
error = "Catalog reported an error, look at answer to see why";
else
error = "Success, look at answer for results";
System.out.println("\nJavaTester test for Catalog: error=" + error);
/*
I get the printout:
JavaTester test for Catalog: error=No Catalog by that name
*/
The psyclone terminal trace:
18:51:56
796 Whiteboard AIRCentral started
859 Whiteboard WB1 started
859 Psyclone.System.Report.Spawn.InProgress
859 Psyclone.System.Report.Status.Whiteboards.Spawn.Complete
859 Psyclone.System.Report.Stream.Spawn.InProgress
859 Number of Streams specified: 0
859 Psyclone.System.Report.Catalog.Spawn.InProgress
859 Number of Catalogs specified: 0 ---> my comment:

?
859 Psyclone.System.Report.Modules.Spawn.InProgress
859 Number of Modules specified: 0
859 Psyclone.System.Report.Services.Spawn.InProgress
859 Number of Services specified: 0
859 Psyclone.System.Report.Spawn.Complete
859 Psyclone.System.Report.Status.Ready
859 Psyclone.Context:Psyclone.System.Ready
859 Psyclone running...
...
18:52:19
093 *** ERROR: Could not locate Catalog query 'FileCatalog' in preloaded libraries ***
18:52:25
453 Module 'JavaTester' configured by itself with context(s):Psyclone.System.Ready
18:52:27
234 *** ERROR: Could not locate Catalog query 'FileCatalog' in preloaded libraries ***
234 Temporarily removed Module JavaTester from system database
Psyprobe shows MyFileCatalog in the list of External modules ?!
All tests done on windows, no cygwin.
Other questions:
-- can you give some hints on catalogs: do they appear as files somewhere?
-- any more info about the <catalog> XML element structure?
-- FileCatalog, StorageCatalog: are these class names?
-- what are the records for StorageCatalogs?
This topic seems rather under-documented...
Regards,
Matija