Apache OpenOffice (AOO) Bugzilla – Issue 11240
[Solaris] need to manually mount unoil.jar to successfully compile java script in NetBeans
Last modified: 2003-03-13 11:12:14 UTC
ScriptingFramework date 02.04.2003, on StarOffice 644 build u Solaris 9. (OpenOffice.org 644 is not yet available for test) 1. Create an examples directory e.g. HelloNetBeans. 2. Mount Office API and Scripting API jar files Start NetBeans Select the File->Mount Filesystem menu item In the Choose Filesystem Type window that pops up select Archive Files and click Next Browse to the <Office installation>/program/classes directory Select all the jar files in the file selection window and click Finish 3. Mount the examples directories Select the File->Mount Filesystem menu item In the Choose Filesystem Type window select Local Directory and click Next Mount the examples directory you created. 4. Create a new script parcel Right click on your mounted examples directory. Select New->Office Scripting->Parcel Recipe In the New Wizard window that appears, enter the name you wish to call your new parcel e.g HelloNetBeans. Select the Initial Script Language - Java. Clcik Finish 5. Click on the Contents-Empty file -Change the name of 'public class Empty' to 'public class HelloNetBeans' -Remove the package declaration 'package HelloNetBeans.Contents;' at the top of the file -Add the following lines to the top of the script immediately after the first import statement import com.sun.star.uno.UnoRuntime; import com.sun.star.frame.XModel; import com.sun.star.text.*; 6. Add the following lines within the public class HelloNetBeans class. XModel model = xSc.getDocument(); XTextDocument textdoc = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, model); XText oText = textdoc.getText(); XTextCursor oCursor = oText.createTextCursor(); oText.insertString(oCursor, "Hello NetBeans", false); 7. Right click on the HelloNetBeans in the right frame and select save. 8. Right click on the HelloNetBeans directory and select compile. You should note that the compile completes successfully from the lower right hand frame (output window) of NetBeans. --> Bug, the compile does not compile successfully. In order to get the compile to complete the user needs to mount the unoil.jar file in <OfficeInstallation>/user/uno_packages/cache/uno_packages/ooscriptframe.zip.*/skip_registration This bug is not present on Windows or Linux.
Assign to Tom to fix - should not have to manually mount the unoil.jar
Assign to Tom to fix
Should be fixed as part of 10661
Should be fixed by the fix for 10661.
verified as fixed on Solaris SFrameworkInstall.jar.24.02.2003, closing issue as verified
reopening issue. SFrameworkINstall.jar.26.02.2003, staroffice 644 build m5, on win2000. Needed to manually mount <OfficeInstallation>/user/uno_packages/cache/ uno_packages/ooscriptframe.zip.*/skip_registration/unoil.jar is order to compile a java script.
Should be fixed again now, the path to the office installation wasn't getting initialized properly.
verified fixed on Solaris. Windows and Linux
have witnessed this issue on Solaris again, same SFrameworkInstall.jar with same NetBeans and Staroffice. Problem appears to be intermittent, reopening issue.
Aaargghh! The unoil.jar file is mounted properly at startup but it is being unmounted again on Solaris by the AutomountSupport class in the core NetBeans implementation. I've taken a look at this class but can't see a straightforward way to stop it from unmounting unoil.jar, so I think the best thing to do is to also check that the jar file is mounted before executing the Compile, Build and Configure commands and mount it if necessary.
verified fixed in ed-0.2
As mentioned on the qa dev list on March 5th I will close all resolved <wontfix/duplicate/worksforme/invalid> issues. Please see this posting for details.