Hi Stephan,
the bootstrap mechanism need a soffice process in listen mode (I 'm
avoiding this) and my application will connect the soffice process
through urp-socket.
Is there another mechanism to avoid interprocess connection?
Stephan Bergmann wrote:
Adriano Colaianni wrote:
I'm registering manually succesfully a new UNO component (implemented
in Java) with regcomp. This is a simple component impementing XMain
interface.
After I launch it with UNO Executables:
Unfortunately, many UNO services implemented by OOo only work reliably
within the soffice process. Without having actually checked it, I
assume that com.sun.star.awt.Toolkit is such a problematic service
(its internal use of VCL is a pretty sure sign of that). As a rule of
thumb, those UNO services with UNOIDL specifications in CVS module
udkapi should work independent of OOo and the soffice process, while
no such gurantee is given for CVS module offapi.
A workaround, wich might or might not be useful for you, is to not use
the uno executable to execute your application, but rather make your
application a JAR that uses the simple bootstrap mechanism (which
behind the scenes starts an soffice process and gives your application
access to soffice's component context).
-Stephan
/[EMAIL PROTECTED] program]$ uno -s MyMain -ro services.rdb -ro
types.rdb -ro test.rdb
Arriva 1 !!!
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 11 occurred at PC=0xA814C4D5
Function=_ZN11Application8IsInMainEv+0x17
Library=/opt/openoffice.org1.9.125/program/libvcl680li.so
Current Java thread:
at com.sun.star.bridges.jni_uno.JNI_proxy.dispatch_call(Native
Method)
at
com.sun.star.bridges.jni_uno.JNI_proxy.invoke(JNI_proxy.java:204)
at $Proxy3.createInstanceWithContext(Unknown Source)
at MyExe.MyAppl.createMainWindow(MyAppl.java:36)
at MyExe.UnoExeMain.run(UnoExeMain.java:26)
...
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_08-b03 mixed mode)
#
# An error report file has been saved as hs_err_pid6736.log.
# Please refer to the file for further information.
#
Aborted/
The exception is raised in:
/package MyExe;
import com.sun.star.uno.Exception;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.uno.XComponentContext;
import com.sun.star.awt.XToolkit;
import com.sun.star.awt.XWindow;
import com.sun.star.awt.XWindowPeer;
import com.sun.star.awt.WindowDescriptor;
import com.sun.star.awt.WindowClass;
import com.sun.star.awt.Rectangle;
import com.sun.star.awt.WindowAttribute;
import com.sun.star.frame.XFrame;
public class MyAppl {
/**
* @param args
*/
public MyAppl(XComponentContext c) {
xMCF = c.getServiceManager();
xCCtx = c;
}
public void createMainWindow() {
try {
System.out.println("Arriva 1 !!!");
XFrame xFrame=(com.sun.star.frame.XFrame)
UnoRuntime.queryInterface(
com.sun.star.frame.XFrame.class,
xMCF.createInstanceWithContext(
"com.sun.star.frame.Task",xCCtx));
// create Toolkit-Service
--> Object oToolkit = xMCF.createInstanceWithContext(
"com.sun.star.awt.Toolkit", xCCtx);
System.out.println("Arriva 2 !!!");
XToolkit xToolkit = (XToolkit)
UnoRuntime.queryInterface(
XToolkit.class, oToolkit);/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]