[api-dev] Connecting to OOBean under Linux

2009-11-23 Thread Steffen Boersig

Hi guys,

I finished my project under Windows and since it's all written in Java I 
wanted to try it under linux.
Several errors that occured (Sidenote: Why is the folder structure of OO 
installation directory different under linux compared to windows??) 
could be fixed but one is persistent:
I always get a NoConnectionException under Linux, whereas under Windows 
everything goes fine.

For testing purposes I checked OO Connection before loading from Stream:

   aBean = new OOoBean();
   try
   {
   aBean.getOOoConnection();
   }
   catch (NoConnectionException e1)
   {
   e1.printStackTrace();
   }

Error:

com.sun.star.comp.beans.NoConnectionException
  at com.sun.star.comp.beans.OOoBean.setOOoConnection(OOoBean.java:185)
  at com.sun.star.comp.beans.OOoBean.getOOoConnection(OOoBean.java:283)
  at de.abas.macro.AbasEditor.init(AbasEditor.java:112)

I think the rest of the stacktrace is not important.
I did setup all needed external jars in the manifest file 
(ridl.jar,juh.jar.jurt.jar,sandbox.jar,officebean.jar,unoil.jar) and 
they are properly loaded.


Executing soffice is also working if executed from the shell. So the 
com.sun.star.comp.beans.LocalOfficeConnection.OfficeService.startupService() 
doesn't throw an error.


I don't understand, why it is able to execute under Windows with the 
above setup (external jars, environment variables UNO_PATH) and why it 
is not loading under linux.


I'm out of available options (for me) since I read through every 
relevant source code of OOBean several times but I don't see what I'm 
doing wrong here.


Any help/hint would be great.

Regards,

Steffen Börsig

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] Error reconnecting to OOo once OOo has been started by my application, then closed.

2009-11-23 Thread Juergen Schmidt

Hi Matthew,

it seems that you are under Linux and you are probably using a non 
official OpenOffice.org build because the official OOo doesn't include 
the mono support.


If you encounter problems with C# under Linux you should contact the 
provider of your OOo build and ask there for help.


It is difficult to answer questions that is related to code that we 
don't know.


Sorry, but i can't say more than i have already written in the issue.


Juergen



Matthew Pirocchi wrote:

I have a small application that generates three different template documents in
OOo Writer. When one of the three generate buttons is clicked, this
is part of
the code that is executed (in C#):

// Connect to OOo
if (componentContext == null)
componentContext = uno.util.Bootstrap.bootstrap();
XMultiServiceFactory multiServiceFactory =
(XMultiServiceFactory) componentContext.getServiceManager();
XComponentLoader loader = (XComponentLoader)
multiServiceFactory.createInstance
(com.sun.star.frame.Desktop);

// Initialize class members document, text, and cursor
document = (XTextDocument) loader.loadComponentFromURL
(private:factory/swriter, _blank, 0,
 new PropertyValue[0]);
text = document.getText();
cursor = text.createTextCursor();


The following steps cause a crash:

1. The user generates a document.
2. The user closes the document (closing OOo).
3. The user tries to generate another document.

This exception is thrown:
unoidl.com.sun.star.lang.DisposedException: URP-Bridge: disposed(tid=4)
Unexpected connection closure

How do I check to make sure the connection is still open before trying to
generate another chart? And how do I reconnect if it has been closed?

More specifically, this is the complete error message:
Marshaling clicked signal
Exception in Gtk# callback delegate
  Note: Applications can use GLib.ExceptionManager.UnhandledException to handle
the exception.
System.Reflection.TargetInvocationException: Exception has been thrown by the
target of an invocation. --- unoidl.com.sun.star.lang.DisposedException: URP-
Bridge: disposed(tid=4) Unexpected connection closure
  at com.sun.star.bridges.mono_uno.UnoInterfaceProxy.ConstructReturnMessage
(Any
result, System.Object[] args, uno.Typelib.InterfaceMethodTypeDescription*
methodTD, IMethodCallMessage callmsg, Any exception) [0x0]
  at com.sun.star.bridges.mono_uno.UnoInterfaceProxy.Invoke (IMessage request)
[0x0]
  at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke
(System.Runtime.Remoting.Proxies.RealProxy rp, IMessage msg, System.Exception
exc, System.Object[] out_args) [0x0]
  --- End of inner exception stack trace ---
...

The application was terminated by a signal: SIGHUP

If I get rid of the line if (componentContext == null) (i.e., always try to
connect, even when we have already connected), I get a stacktrace
accompanied by
this message:

=
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=


I've tried handling the disposing event, and trying to reconnect
when OOo is closed (via Bootstrap.bootstrap()), but I get the same
Unexpected connection closure.  One interesting thing is that
disposing doesn't seem to get called for the componentContext,
multiServiceFactory, or loader when I close OOo. Only the document
calls disposing (and trying to reconnect still gives me the error).
Perhaps what's happening is that the connection is never fully closed,
and that's what makes bootstrap give the error. Any ideas?

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org




-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] Question about weak reference list inside java bridge code.

2009-11-23 Thread Stephan Bergmann
See my answer to the same question at d...@udk.openoffice.org.  Lets keep 
discussion to that single mailing list.


-Stephan

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] Connecting to OOBean under Linux

2009-11-23 Thread Stephan Bergmann

On 11/20/09 14:47, Steffen Boersig wrote:
I finished my project under Windows and since it's all written in Java I 
wanted to try it under linux.
Several errors that occured (Sidenote: Why is the folder structure of OO 
installation directory different under linux compared to windows??) 


To follow established expectations on the various platforms, and, in 
some cases, due to technical necessities of the various platforms.  In 
principle, on all platforms there are three layers (URE, Basis, Brand) 
at potentially arbitrary positions (even relative to each other). 
Within the URE layer, one difference among platforms is that Windows has 
both executables and libraries in bin, while Unix has libraries in lib. 
 Another difference is that, since recently, Windows shifted virtually 
all libraries from the Basis program to the Brand program directory.



could be fixed but one is persistent:
I always get a NoConnectionException under Linux, whereas under Windows 
everything goes fine.

For testing purposes I checked OO Connection before loading from Stream:

   aBean = new OOoBean();
   try
   {
   aBean.getOOoConnection();
   }
   catch (NoConnectionException e1)
   {
   e1.printStackTrace();
   }

Error:

com.sun.star.comp.beans.NoConnectionException
  at com.sun.star.comp.beans.OOoBean.setOOoConnection(OOoBean.java:185)
  at com.sun.star.comp.beans.OOoBean.getOOoConnection(OOoBean.java:283)
  at de.abas.macro.AbasEditor.init(AbasEditor.java:112)


OOoBean tries to connect to soffice via a named pipe, which requires 
native code in libjpipe.so being called from jurt.jar.  I assume that 
some Java error occurs failing to load that native lib which would be 
swallowed by the catch ( java.lang.Throwable aExc ) at OOoBean.java l. 
 184.  I suggest you patch OOoBean.java to include 
aExc.printStackTrace(); before throw new NoConnectionException(); to 
give more information.



I think the rest of the stacktrace is not important.
I did setup all needed external jars in the manifest file 
(ridl.jar,juh.jar.jurt.jar,sandbox.jar,officebean.jar,unoil.jar) and 
they are properly loaded.


What does the manifest look like exactly?  At what location do you 
reference those jars, within the OOo installation?


-Stephan

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] Where can I find the SDK for OO 2.4.x?

2009-11-23 Thread Ariel Constenla-Haile
Hello Marco,

On Monday 23 November 2009, 18:26, Marco Castillo wrote:
 Dear List:
 I'm looking for the SDK for version 2.4.x of OpenOffice. Can someone show
  me a link where I can download it? it seems to be disappeared. I can only
  found the 3.1.1 SDK.

search in ftp://ftp.tu-chemnitz.de/pub/openoffice-archive/stable/

Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] Where can I find the SDK for OO 2.4.x?

2009-11-23 Thread Cor Nouws

Ariel Constenla-Haile wrote (24-11-2009 0:58)

On Monday 23 November 2009, 18:26, Marco Castillo wrote:

I'm looking for the SDK for version 2.4.x of OpenOffice. Can someone show
 me a link where I can download it? it seems to be disappeared. I can only
 found the 3.1.1 SDK.


search in ftp://ftp.tu-chemnitz.de/pub/openoffice-archive/stable/


or here http://download.openoffice.org/2.4.0/sdk.html
(linked via via from download page nowadays)

Ciao - Cor

--
Cor Nouws
  - nl.OpenOffice.org marketing contact
  - Community Contributor Representative in the Community Council
Gevoel niet vrij te zijn? Zie www.nieuwsteversie.nl

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org