Bug 46102 - script dispatch java extensions are broken
Summary: script dispatch java extensions are broken
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Extensions (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: Other All
: high critical
Assignee: Stephan Bergmann
URL:
Whiteboard: target:3.6.0 target:3.5.2
Keywords: regression
Depends on: 35132
Blocks: mab3.5
  Show dependency treegraph
 
Reported: 2012-02-15 06:27 UTC by Oliver Brinzing
Modified: 2013-01-09 13:41 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Scriptdispatch.oxt (9.57 KB, application/vnd.openofficeorg.extension)
2012-02-15 06:27 UTC, Oliver Brinzing
Details
StartScriptDispatch.odt (10.21 KB, application/vnd.oasis.opendocument.text)
2012-02-15 06:29 UTC, Oliver Brinzing
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Brinzing 2012-02-15 06:27:34 UTC
Created attachment 57095 [details]
Scriptdispatch.oxt

with lo3.5 it is not possible to install script dispatch java extension.

steps to reproduce:

- try to install attached *.oxt from command line:

  unopkg add ScriptDispatch.oxt --shared --verbose

  [...]
  ERROR: Fehler beim Aktivieren von: ScriptDispatch
   Cause: (com.sun.star.lang.IllegalArgumentException) { { 
   Message = "Failed to register package
   for vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/
   uno_packages/lu145p4x.tmp_/ScriptDispatch.oxt/
   ScriptDispatch/", Context = (com.sun.star.uno.XInterface) @0 }, 
   ArgumentPosition = (short) 2 }
unopkg failed.
?????????????????????

with lo 3.4.5 same *.oxt can be installed without any problems.
to verify, open attached "StartScriptDispatch.odt" and press button.
Comment 1 Oliver Brinzing 2012-02-15 06:29:05 UTC
Created attachment 57096 [details]
StartScriptDispatch.odt
Comment 2 clio 2012-02-17 02:35:09 UTC
Confirm. Also, preinstalled Java macroses (/opt/libreoffice3.5/share/Scripts/java) do not appear in the "Run Macro..." dialog (menu Tools/Macros/Run Macro...)
Comment 3 Oliver Brinzing 2012-03-15 23:25:38 UTC
why is this bug not fixed in lo3.5.1?
Comment 4 Petr Mladek 2012-03-20 08:17:30 UTC
I wonder if it is related to removing of the 3-layer structure.

It affects an extensions that is not installed by default => It most likely affects only limited group of users => It can't block the release => lowering the severity a bit.
Comment 5 Stephan Bergmann 2012-03-20 10:18:32 UTC
Rather a regression introduced with gbuild'ification; ScriptProviderForJava.jar no longer contains a RegistrationClassName in its META-INF/MANIFEST.MF.
Comment 6 Petr Mladek 2012-03-21 04:00:25 UTC
Also I do not see /opt/libreoffice3.5/share/extensions/script-provider-for-javascript. I am not sure if it is not longer needed.
Comment 7 Oliver Brinzing 2012-03-21 04:57:55 UTC
> ScriptProviderForJava.jar no longer contains a 
> RegistrationClassName in its META-INF/MANIFEST.MF.

using "ScriptProviderForJava.jar" from lo3.4.5 works for me
Comment 8 Stephan Bergmann 2012-03-23 02:33:31 UTC
(In reply to comment #6)
> Also I do not see
> /opt/libreoffice3.5/share/extensions/script-provider-for-javascript. I am not
> sure if it is not longer needed.

The script providers for Java (BeanShell) and JavaScript are not implemented as .oxt extensions (unlike the script provider for Python), so do not end up in share/extensions/.
Comment 9 Alex Thurgood 2012-03-23 02:56:35 UTC
So will it be fixed for 3.5.2 ? Added to most annoying 3.5 bugs ?


Alex
Comment 10 Oliver Brinzing 2012-03-23 04:11:53 UTC
bugfix should be quite simple:

take "MANIFEST.MF" from lo3.4.6 and copy 
into META-INF/MANIFEST.MF from lo 3.5.1's
"ScriptProviderForJava.jar"
Comment 11 Stephan Bergmann 2012-03-23 07:41:46 UTC
<http://cgit.freedesktop.org/libreoffice/core/commit/?id=91d60be7eeafa1f7872bda452bfb38936003f517> "fdo#46102: Fix scripting jar manifests after gbuild'ification" fixes the META-INF/MANIFEST.MF files of the various Script*.jar.  However, this is not enough to make Java scripts actually work.  (However, it apparently suffices to make this issue's original problem of a failing unopkg add go away -- even if subsequent testing of StartScriptDispatch.odt fails.)
Comment 12 Not Assigned 2012-03-23 08:25:23 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=dd6c4f4db1d62268d73e09ae52d23f760a967dcc

fdo#46102: Load Java scripts with class loaders that actually find them
Comment 13 Not Assigned 2012-03-23 08:25:51 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0b9fda25f321ce2697179064e330843237177668

fdo#46102: Fix Java script examples after gbuild'ification
Comment 14 Stephan Bergmann 2012-03-23 08:59:43 UTC
@brinzing:  With the above three commits, Java scripts in general work again (and esp. the preinstalled examples mentioned in comment 2).

However, your attached ScriptDispatch.oxt/StartScriptDispatch.odt still do not work for, but do not work for me in LO 3.4.5, either.  In both versions I get an
error message "Cannot resolve script location for script = org.test.java.ScriptDispatch.execute."

I'm intending these fixes for inclusion in LO 3.5.x, potentially even still LO 3.5.2, see <http://lists.freedesktop.org/archives/libreoffice/2012-March/028759.html> "[REVIEW-3-5][REVIEW-3-5-2?] fdo#46102 script dispatch java extensions are broken."
Comment 15 Oliver Brinzing 2012-03-23 09:42:58 UTC
you have to install the "ScriptDispatch.oxt" with "--shared" option, for example:
   
 unopkg add ScriptDispatch.oxt --shared --verbose

cause the command button url contains the location "share":

vnd.sun.star.script:ScriptDispatch.org.test.java.ScriptDispatch.execute?language=Java&location=share:uno_packages/ScriptDispatch.oxt"
Comment 16 Stephan Bergmann 2012-03-23 09:50:16 UTC
OK, then it indeed works on my LO master.
Comment 17 Not Assigned 2012-03-23 12:49:05 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c1b9cd2471162f9bf365be4ab7c1d236c4e8e32d&g=libreoffice-3-5

fdo#46102: Fix scripting jar manifests after gbuild'ification


It will be available in LibreOffice 3.5.3.
Comment 18 Not Assigned 2012-03-23 12:49:32 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=de5e886382f829176a55eefeda98d31e27672cc8&g=libreoffice-3-5

fdo#46102: Load Java scripts with class loaders that actually find them


It will be available in LibreOffice 3.5.3.
Comment 19 Not Assigned 2012-03-23 12:50:00 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a6604b06a1d5ff997c38b27c7860f20f48e302d3&g=libreoffice-3-5

fdo#46102: Fix Java script examples after gbuild'ification


It will be available in LibreOffice 3.5.3.
Comment 20 Not Assigned 2012-03-27 02:23:29 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-3-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=addffddbc4acf9745e6bfeba322d6488b3c12605&g=libreoffice-3-5-2

fdo#46102: Fix scripting jar manifests after gbuild'ification


It will be available already in LibreOffice 3.5.2.
Comment 21 Not Assigned 2012-03-27 02:23:57 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-3-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a9caee65b7c76e54b2362ded366075249d0f858d&g=libreoffice-3-5-2

fdo#46102: Fix Java script examples after gbuild'ification


It will be available already in LibreOffice 3.5.2.
Comment 22 Not Assigned 2012-03-27 02:24:26 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-3-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a574a38a73b252498ac061dcf08d96a84b48b6af&g=libreoffice-3-5-2

fdo#46102: Load Java scripts with class loaders that actually find them


It will be available already in LibreOffice 3.5.2.
Comment 23 Rainer Bielefeld Retired 2012-04-05 08:04:36 UTC
I added Fix submitter as assignee because this will ease queries and bug tracking.
Comment 24 Stephan Bergmann 2012-10-26 16:39:52 UTC
Looks like <http://cgit.freedesktop.org/libreoffice/core/commit/?id=dd6c4f4db1d62268d73e09ae52d23f760a967dcc> "fdo#46102: Load Java scripts with class loaders that actually find them" was not necessary after all and rather caused new regressions, see bug 49517.