Zach,
Making singleton implementations available to the component context
seems to be something of a black art. Please allow me some more time to
come back with an answer (I have to look at it myself).
-Stephan
Zongyun Lai wrote:
Hi all,
I have implemented a singleton called "theDtoolsController", it compiles
correctly, but when I run it, I get the following exception.
$ make DtoolsServer.run
"/usr/lib/jvm/java-1.5.0-sun/bin/java"
-Dcom.sun.star.lib.loader.unopath="/home/zlai/OOH680_m8/instsetoo_native/unxlngi6.pro/OpenOffice/installed/install/en-US/program"
-jar
/home/zlai/sdk-output/en-US/LINUXexample.out/class/Dtools/DtoolsServer.jar
DtoolsServer, Fail to connect to
ServiceManagercom.sun.star.uno.DeploymentException: component context
fails to supply singleton org.dtools.spec.theDtoolsController of type
org.dtools.spec.XDtoolsController
make: *** [DtoolsServer.run] Error 1
The definition for the singleton is quite simple, and follows the
developer guide,
module org { module dtools { module spec {
interface XDtoolsController;
singleton theDtoolsController: XDtoolsController;
};
};
};
I use the recommended method to get the singleton in my code,
_dtools_controller = theDtoolsController.get(_remote_ctx);
So, I wonder anyone could point me out what is the essential problem for
the runtime exception? I suspect it may because I didn't register it at
someplace. I added one more entry after UNO_TYPE of
<OfficePath>/program/unorc, which is $ORIGIN/DtoolsController.uno.rdb
(yes, I did copy the rdb file to program/ directory).
Then, I run soffice again with
./soffice
"-accept=socket,host=localhost,port=2083;urp;StarOffice.ServiceManager"
I use 'lsof' to look whether the newly added rdb file is used by
soffice.bin. It turns out yes! See the result,
soffice.b 14416 zlai mem-R REG 8,5 16384 1590456
/home/zlai/OOH680_m8/instsetoo_native/unxlngi6.pro/OpenOffice/installed/install/en-US/program/DtoolsController.uno.rdb
So, I think the theDtoolsCOntroller type should be known now. Thus, I
run the code again, but still get the same "component context fails to
supply singleton org.dtools.spec.theDtoolsController" exception. Could
anyone share me with some insights? I could find very little information
on internet and developer guide. Any help would be highly appreciated!
b.t.w I build the OOo program from source code, and get component
context using
com.sun.star.comp.helper.Bootstrap.createInitialComponentContext method.
Thanks a lot
Zach
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]