NetBeans 6.8 and OpenOffice 3.3 on Snow Leopard

A quick note to setup working OpenOffice.org plugin development on Mac OS X 10.6 (64bit)…

NetBeans v6.8 (as the last OOo SDK supported version now) works with OpenOffice Extension 2.0.6 (org-openoffice-extensions-2.0.6.nbm) and OpenOffice 3.3 SDK, but NetBeans configuration should be modified to access OpenOffice by Java. You can not create new OpenOffice.org Component (UNO) without this modification, because NetBeans unable to read Service and Interface classes from OOo and results and empty list after several loads of soffice command.

Error log message looks like following, and see why here (issue 110543):

... /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin/java[14982]: dlopen(/Volumes/MBP_Addons/Application.Addon/Editors/OpenOffice.org.app/Contents/basis-link/ure-link/lib/libjpipe.jnilib, 1): no suitable image found.  Did find:\n	/Volumes/MBP_Addons/Application.Addon/Editors/OpenOffice.org.app/Contents/basis-link/ure-link/lib/libjpipe.jnilib: mach-o, but wrong architecture

The solution is simple with updating value “netbeans_default_options” in “netbeans.conf” with option “-J-d32”. You can find config file in “NetBeans 6.8.app/Contents/Resources/NetBeans/etc” folder.

Oracle OpenOffice plugin and LibreOffice

So, i would like to release a quick fix for the updated OpenOffice plugin by Oracle (previously Sun Connector for Alfresco CMS)…

First, let see the error in log:

10:51:23,318 User:admin ERROR [freemarker.runtime] Expression path is undefined on line 53, column 61 in org/alfresco/office/navigation.get.xml.ftl.

Expression path is undefined on line 53, column 61 in org/alfresco/office/navigation.get.xml.ftl.
The problematic instruction:
----------
==> ${path?url} [on line 53, column 59 in org/alfresco/office/navigation.get.xml.ftl]
----------

Error occured by an unhandled and missing ‘path’ variable in freemarker template. Put following code before ‘notication’ XML tag (you can replace initial value of ‘path’ variable with something else of course):

<#if path??>
<#else>
<#assign path="/">
</#if>

Another quick tip for Alfresco-side installation, just use repository instead of local filesystem to override (no need to overwrite) ‘office’ webscript templates in deployed Alfresco:

And finally, the plugin works with LibreOffice 3.3 too:

Working OpenOffice Alfresco plugin

Do you miss a working Alfresco repository plugin for your OpenOffice?

OpenOffice_plugin_Alfresco-logoSo, just download Sun Connector for Alfresco CMS, use tibber’s patches – or wait for my complete release :) – and enjoy it on Windows, Linux and Mac OSX (requires OpenOffice 3.1.1) too! Patched backend works with Alfresco 3.1 and 3.2 Community editions.

The Sun Connector integrates OpenOffice.org and StarOffice perfectly with the Alfresco Document management server. The user has full access to all documents stored on the Alfresco server. An easy to use and clear front end makes it easy to create, load, edit and save documents including checking in and checking out. Move over to the fully supported Alfresco Workflow for auditing documents. Not to forget the support of the Alfresco Spaces and the ability to search within the documents hosted on the Alfresco server.

Another plugin for NeoOffice is on the road: Alfresco plugin for Mac OSX

Update: Sun Connector 1.0 works with NeoOffice 3.1.1 now!


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