Hi Stephan, On 16.07.2010 08:48, Stephan Bergmann wrote: > On 07/15/10 22:10, Rony G. Flatscher wrote: >> today I stumbled over the following interesting (read: time-consuming) >> problem: while caching Java objects representing individual UNO_ENUM >> values, all of a sudden om.sun.star.lang.DisposedException started to be >> thrown. Here is one such received exception message: >> >> ... getCause(): [com.sun.star.lang.DisposedException: >> java_remote_bridge >> com.sun.star.lib.uno.bridges.java_remote.java_remote_bri...@105b99f >> is disposed] > > That DisposedException had more than likely a different reason. Java > objects representing UNO enumeration type values are completely > "local" -- none of their methods initiate any URP communication. This is the use case using the Java bridge, where invocations of UNO APIs via Java are carried out using Java reflection (this allows me to basically address UNO typelessly from the perspective of Rexx users):
* get all the enum values of "com.sun.star.style.ParagraphAdjust" and cache them for later use, e.g. the value for "RIGHT" is assigned to a local variable named "right", * then, later, an XParagraphCursor is queried for its XPropertySet and then this is used to setPropertyValue("ParaAdjust", right). It is in this invocation where unexpectedly the above exception is thrown. Now, querying for the enum value "RIGHT" before using it in the setPropertyValue() works reliably. As I found a stable solution, this is more a report than a request for help, yet, it would be interesting to learn where and under what conditions such an exeption would be throwable. ---rony