Am 10.02.2010 13:55, schrieb Stephan Bergmann:
On 02/10/10 13:16, Johannes Hoechstaedter wrote:
Now my major concern:
We developed a webservice, which transfers data from MS-Excel (xls)
type files into a custom template of openoffice calc. This webservice
is written in Java and is using the UNO-Api Interface. For its task
the service creates an calc file from our template (ots) for every
incoming xls file, and simply copies the content from the incoming
xls into the newly created file cell by cell. Nothing strange up
here. Everything is working in theory and reality.
Relevant code:
XCell newCell = xSpreadsheetOut.getCellByPosition(x, y);
newCell.setFormula("...");
The problem now is that the service throws runtime excptions for
which I have not found any useful documentation files till now. The
stack trace is the following:
com.sun.star.uno.RuntimeException: getInstance expected XInterface
but got com.sun.star.table.XCell
at
com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedException(Job.java:182)
at
com.sun.star.lib.uno.environments.remote.Job.execute(Job.java:148)
at
com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:344)
at
com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:313)
at
com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:101)
at
com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:652)
at
com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:154)
at
com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:136)
at $Proxy8.setFormula(Unknown Source)
at
de.xxx.ReportImporter.copyRangesIntoTemplateAndStoreDocument(Unknown
Source)
[...]
java.lang.NullPointerException
at de.memocomp.oo.OOManager.closeDocument(Unknown Source)
at
de.xxx.ReportImporter.copyRangesIntoTemplateAndStoreDocument(Unknown
Source)
[...]
What I am able to say is, that the service was designed to run
asynchronous. If we do so, the exception appears more often. If the
service runs queued or in a pipline it works quite well. The
exception above then appeard only once in ~30 runs, but it appeared.
This appears to be an error in the OOo code. What apparently happens
is that the OOo server hands out via the URP remote protocol some
XCell object (newCell) with a certain object ID (OID). When the
client side calls the setFormula method on that object, it passes back
the OID. However, obviously that OID has meanwhile disappeared from
the server side table of OIDs, so the OOo bridge code erroneously goes
down a wrong code branch that ultimately leads to the "getInstance
expected XInterface but got ..." exception (see
OInstanceProviderWrapper::thisGetInstance in
remotebridges/source/bridge/bridge_provider.cxx).
However, why the OID erroneously disappears from the server side OID
table is unclear. Obviously, there is some race somewhere, so that it
works at least sometimes. It would be great if you could break your
problem down to a small test case, and file an issue with that.
-Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org
Thanks for your quick reply. I am already on my way to implement a small
test case. You will here from me later.
cheers
--
Johannes Höchstädter
www.memocomp.de
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org