Ask Your Question
0

Does anyone know how to bootstrap from tomcat?

asked 2015-10-15 12:34:40 +0200

Brooke gravatar image

updated 2015-10-15 22:44:55 +0200

Alex Kemp gravatar image

I use latest tomcat7 and LO 5 in Ubuntu 14.04. I use PHP/JavaBridge for my PHP script to open/edit a LO document.

$Bootstrap = new Java("com.sun.star.comp.helper.Bootstrap"); $UnoRuntime = new Java("com.sun.star.uno.UnoRuntime"); $Context=$Bootstrap->bootstrap(); $Service=$Context->getServiceManager(); $Desktop=$Service->createInstanceWithContext("com.sun.star.frame.Desktop",$Context); $Loader=$UnoRuntime->queryInterface(Java("com.sun.star.frame.XDesktop")->class,$Desktop);

The problem is that when calling to queryInterface(), it always generates the following error (i.e. DisposedException):-

PHP Warning: Unchecked exception detected: [[o:Response$UndeclaredThrowableErrorMarker]:"FATAL: Undeclared java.lang.RuntimeException detected. java.lang.Exception: Invoke failed: [[o:UnoRuntime]]->queryInterface((c:Class)[c:Class], (o:Object)[o:$Proxy2]). Cause: com.sun.star.lang.DisposedException

I took "ps -aux | grep office" and it showed LO was running (invoked by bootstrap()).

tomcat7 4698 0.0 0.1 33944 4092 ? Sl 17:53 0:00 /usr/lib/libreoffice/program/oosplash --nologo --nodefault --norestore --nolockcheck --accept=pipe,name=uno6899141817323784468;urp; tomcat7 4713 0.0 1.3 208040 42084 ? Sl 17:53 0:00 /usr/lib/libreoffice/program/soffice.bin --nologo --nodefault --norestore --nolockcheck --accept=pipe,name=uno6899141817323784468;urp;

Does anyone know how to solve the DisposedException error?

Brooke

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2019-04-10 21:29:35 +0200

juliosmax gravatar image

did you tell the bootstrap the path of your libreoffice installation?

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-10-15 12:34:40 +0200

Seen: 207 times

Last updated: Apr 10