Alfresco OpenOffice plugin for Mac OSX

I wasted my weekend with a wrong way to use Alfresco OOo-plugin on Mac OSX platform.

This plugin (ooo-plugin at Alfresco Forge) works on Linux and Windows, but not on OSX. I’ve tried with NeoOffice 2.x and 3.x, OpenOffice.org 3.0.1 and 3.1-dev without any success.

Plugin compiled – custom script below -, and able to install into OpenOffice/NeoOffice by script or Tools/Extension Manager menu directly – and no more activity.

alfresco_ooo-plugin_mac

OOo-Plugin build script for OSX:

#!/bin/sh
#
# Build script for Mac OSX
# by LouiSe@louise.hu

export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home
export PATH=$PATH:System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin

export CLASSPATH=/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/javaws.jar

ant

chmod +x dist/bin/inst_mac.sh
chmod +x dist/bin/uninst_mac.sh
echo "Just run dist/bin/inst_mac.sh for OpenOffice, and web/inst_mac.sh for backend installation..."

Three possible reasons for this that does not work:

1. OpenOffice 3.0.x bug (Apple AWT Java VM was loaded on first thread — can’t start AWT): Issue: 92926

2. NeoOffice 2.x Java Extension loading bug:

soffice.bin[23825]: JavaNativeFoundation: GetGlobalVM: JNI_GetCreatedJavaVMs() failed to get any VM.

3. JDIC incompatibility with Mac OSX 10.5 and Safari4 (works with Safari3) WebKit:

louise$ java -Xbootclasspath/p:/Library/Java/Home/lib/plugin.jar:/Library/Java/Home/lib/deploy.jar -cp .:jdic.jar:demo/Browser/ Browser
ERROR : Failed to create WebKitView
Invalid memory access of location 00000000 eip=00000000
Bus error

Coredump:

Java information:
 Version: Java HotSpot(TM) Client VM (1.5.0_16-133 mixed mode, sharing)
 Virtual Machine version: Java HotSpot(TM) Client VM (1.5.0_16-133) for macosx-x86, built on Aug 27 2008 11:00:20 by root with gcc 4.0.1 (Apple Inc. build 5465)
 Exception type: Bus Error (0xa) at pc=0x00000000

Current thread (0x01001370):  JavaThread "main" [_thread_in_native, id=-1333784576]
Stack: [0xb0001000,0xb0801000)
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.jdesktop.jdic.browser.WebKitWebBrowser.createNSView1()I+0
j  org.jdesktop.jdic.browser.WebKitWebBrowser.createNSView()I+2
j  com.apple.eawt.CocoaComponent.createNSViewLong()J+1
j  apple.awt.CToolkit.createCanvas(Ljava/awt/Canvas;)Ljava/awt/peer/CanvasPeer;+33
j  java.awt.Canvas.addNotify()V+20
j  org.jdesktop.jdic.browser.WebKitWebBrowser.addNotify()V+1
j  java.awt.Container.addNotify()V+56
j  javax.swing.JComponent.addNotify()V+1
...
j  Browser.main([Ljava/lang/String;)V+62
v  ~StubRoutines::call_stub
Java Threads: ( => current thread )
  0x0100f7a0 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=9080832]
  0x0100e2c0 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=9070592]
  0x0100ce20 JavaThread "Image Fetcher 0" daemon [_thread_blocked, id=9051648]
  0x0100be50 JavaThread "AWT-Shutdown" [_thread_blocked, id=8866816]
  0x0100b9e0 JavaThread "AWT-AppKit" daemon [_thread_in_native, id=-1606609120]
  0x01008f10 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=8501760]
  0x01008460 JavaThread "CompilerThread0" daemon [_thread_blocked, id=8498176]
  0x01008010 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=8494592]
  0x01007870 JavaThread "Finalizer" daemon [_thread_blocked, id=8476160]
  0x010074b0 JavaThread "Reference Handler" daemon [_thread_blocked, id=8470016]
=>0x01001370 JavaThread "main" [_thread_in_native, id=-1333784576]
...
Thread 1 Crashed:
0   ???                           	0000000000 0 + 0
1   com.apple.Foundation          	0x90418231 _NSRemoveHandler2 + 33
2   libjdic.jnilib                	0x1b0bb622 Java_org_jdesktop_jdic_browser_WebKitWebBrowser_createNSView1 + 588
...
29  libclient.dylib               	0x005cf760 JNI_CreateJavaVM_Impl + 132240
30  java                          	0x000022b3 0x1000 + 4787
...

The right way is NeoOffice 3.x and Safari 3

Main preference panel (with hungarian localization) works with Safari 3.x in NeoOffice 3.0 release:
alfresco-ooo_plugin-setup-hungarian

Browser view (navigation) failed with a white background without content, plugin log is here:

2009-04-06 08:22:44,445 [DEBUG] [com.westernacher.openoffice.alfresco.server.ServerConfig : loadFromRegistry] loadFromRegistry() end, state=com.westernacher.openoffice.alfresco.server.ServerConfig@258c74[defaultWebClientURL=http://127.0.0.1:8080/alfresco/,defaultWebDAVClientURL=http://127.0.0.1:8080/alfresco/webdav/,defaultCifsServer=,serverName=127.0.0.1,webClientURL=http://127.0.0.1:8080/alfresco/,webDAVURL=http://127.0.0.1:8080/alfresco/webdav/,cifsServer=,username=admin,password=admin,authenticationTicket=,documentPhysicalPath=,documentAlfrescoPath=,defaultToCIFS=true]
...
2009-04-06 08:22:44,472 [DEBUG] [com.westernacher.openoffice.alfresco.ui.AlfrescoPane : initializePanel] web browser panel initialized
...
2009-04-06 08:22:44,568 [DEBUG] [com.westernacher.openoffice.alfresco.configuration.WindowPositionPersisterImpl : getWindowPosition] getWindowPosition() begin
2009-04-06 08:22:44,568 [DEBUG] [com.westernacher.openoffice.alfresco.configuration.ConfigurationServiceImpl : getPropertyInteger] getPropertyInteger(name=WindowTop, defaultValue=-1)
...
2009-04-06 08:22:44,574 [DEBUG] [com.westernacher.openoffice.alfresco.ui.PopupControllerImpl : loadWindowPosition] loadWindowPosition(frame=javax.swing.JFrame[frame5,486,89,292x706,hidden,layout=java.awt.BorderLayout,title=Alfresco,normal,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,22,292x684,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=449,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]) end, result=true
...
2009-04-06 08:22:44,667 [DEBUG] [com.westernacher.openoffice.alfresco.ui.PopupControllerImpl : loadWindowPosition] loadWindowPosition(frame=javax.swing.JFrame[frame6,66,87,292x708,hidden,layout=java.awt.BorderLayout,title=Alfresco,normal,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,22,292x686,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=449,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]) begin
...
2009-04-06 08:22:44,722 [DEBUG] [com.westernacher.openoffice.alfresco.ui.PopupControllerImpl.webBrowser : windowActivated] windowActivated: event=java.awt.event.WindowEvent[WINDOW_ACTIVATED,opposite=com.sun.star.vcl.VCLFrame$NoPaintFrame[frame3,335,246,128x57,invalid,layout=java.awt.BorderLayout,title=Add-On - Alfresco Fenster Offnen / schlieen,resizable,normal],oldState=0,newState=0] on frame5
...
2009-04-06 08:22:44,732 [DEBUG] [com.westernacher.openoffice.alfresco.ui.PopupControllerImpl.webBrowser : windowOpened] windowOpened: event=java.awt.event.WindowEvent[WINDOW_OPENED,opposite=null,oldState=0,newState=0] on frame5
...
2009-04-06 08:22:44,754 [DEBUG] [com.westernacher.openoffice.alfresco.server.ServerConfig : getAuthenticationTicket] ticket=
...
2009-04-06 08:22:44,754 [DEBUG] [com.westernacher.openoffice.alfresco.ui.AlfrescoPane : setNavigation] setNavigation(url=http://127.0.0.1:8080/alfresco/wcservice/openoffice/myAlfresco?p=&e=odt)
...
2009-04-06 08:22:45,831 [DEBUG] [com.westernacher.openoffice.alfresco.ui.PopupControllerImpl.webBrowser : windowDeactivated] windowDeactivated: event=java.awt.event.WindowEvent[WINDOW_DEACTIVATED,opposite=null,oldState=0,newState=0] on frame5

Java console log:

*** Jtrace: Msg Client new once!
Exception in thread "EventThread" java.lang.IllegalArgumentException: Null charset name
	at java.nio.charset.Charset.lookup(Charset.java:430)
	at java.nio.charset.Charset.forName(Charset.java:497)
	at org.jdesktop.jdic.browser.internal.MsgClient.(Unknown Source)
	at org.jdesktop.jdic.browser.internal.NativeEventThread.run(Unknown Source)
*** Jtrace: 
MyFocusListener: focusGained

After a small hack (replacing WebBroser declaration and browser init code with IWebBrowser) in AlfrescoPane.java file, browser view works, but the layout is wrong:
alfresco-ooo_plugin-browser

Follow forum thread for release: OpenOffice.org plugin @ Alfreso Forge

4 thoughts on “Alfresco OpenOffice plugin for Mac OSX”

  1. Please provide me the compiled packages with this solution, since we use openoffice a lot.
    Is this ready to install and use?

    Regards
    Nuno

  2. Dear Nuno,

    I’ve uploaded modified sources to ooo-plugin repository, just wait for upcoming release (it isn’t depend on me)! OpenOffice plugin with Alfresco 3.x requires new webscripts too…

Leave a Reply

Your email address will not be published. Required fields are marked *