Hi,

I'm trying to set up a Java UNO bridge between Octave 3.2.4 & 
OpenOffice.org (& LibreOffice 3.3.2).
It works fairly OK, I can transfer data both ways, but I get stuck while 
trying to invoke a specific (OOo) method that is known to expect only 
short arguments. (That method is fairly vital for efficient processing.)
This happens both with Octave-3.2.4_MinGW (Windows) & Octave-3.4.0 
(Linux), w OpenOffice.org & LibreOffice, both with the (experimental) 
java-1.2.8 package from svn. (AFAICS that differs from 1.2.7 mainly in 
some extra Matlab-compatible methods + more documentation).

Consider the following Octave instructions (after the UNO bridge is 
already operative) operating on Java object xRQ:

---------------------------------------------------------
octave-3.2.4.exe:43> xRQ
xRQ =

<Java object: $Proxy8>

## Explore which methods can be applied to variable xRQ:
octave-3.2.4.exe:44> javamethods(xRQ)
{
   [1,1] = java.lang.Object queryInterface(com.sun.star.uno.Type)
   [1,2] = java.lang.String getOid()
   [1,3] = boolean isSame(java.lang.Object)
   [1,4] = com.sun.star.sheet.XSheetCellRanges queryVisibleCells()
   [1,5] = com.sun.star.sheet.XSheetCellRanges queryEmptyCells()
   [1,6] = com.sun.star.sheet.XSheetCellRanges queryContentCells(short)
   [1,7] = com.sun.star.sheet.XSheetCellRanges queryFormulaCells(int)
:
<snip 20+ other methods>
:
}

## Create "Short" java object.
## NB the value should be input as string (as per Javadocs)
octave-3.2.4.exe:45> Cellflgs = java_new ("java.lang.Short", "23")
Cellflgs =

<Java object: java.lang.Short>

## Check octave-java object xRQ by invoking a method listed above:
octave-3.2.4.exe:46> ecells = xRQ.queryEmptyCells
ecells =

<Java object: $Proxy9>

## ...Seems OK.

## Now try offending method which wants a "short" input argument:
octave-3.2.4.exe:47> ccells = xRQ.queryContentCells (Cellflgs)
error: [java] java.lang.NoSuchMethodException: queryContentCells

## Again, w/o argument at all:
octave-3.2.4.exe:47> ccells = xRQ.queryContentCells
error: [java] java.lang.NoSuchFieldException: queryContentCells
## (Actually, expected...)

## Try another method which expects an int:
octave-3.2.4.exe:48> xRQ.queryFormulaCells (1)
ans =

<Java object: $Proxy9>
---------------------------------------------------------

I conclude that Java object xRQ is properly formed (other methods 
operate fine with it), but somehow queryContentCells() chokes on its 
input argument. I tried other short values too (allowed are any logical 
combination of 1, 2, 4 & 16; 23 = sum of them all).

Q1:
Do java.lang.Short objects get transformed or wrangled somehow on their 
way between Octave and the actual Java method?

Q2:
If so, is there another way to get the short object to arrive properly 
at the method in question (i.e., queryContentCells()) ?

Q3:
 From a more general perspective, is there a way to recover the actual 
Java errors hidden behind "NoSuchMethodException" messages? The latter 
often functions as a general container message for many other Java errors.

Philip

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to