Showing posts with label OpenOffice. Show all posts
Showing posts with label OpenOffice. Show all posts

Thursday, 16 August 2012

ColdFusion IceBreaker #6: JBOSS 7.1 and OpenOffice on Mac OSX for ColdFusion cfdocument

In continuation of  ColdFusion IceBreaker #5: JBOSS 7.1 and OpenOffice for ColdFusion cfdocument,
this post lists the detailed steps to follow for running OpenOffice code on JBOSS 7.1 on MAC OSX.

1)Install OpenOffice and add the installation path in the ColdFusion Admin
2)Edit the module.xml located in <JBOSS_HOME>/modules/sun/jdk/main and put the following entry there:
<path name="com/sun/star/lib/loader"/>
3)Copy oosdk folder from <jboss-deployment-dir>/cfusion.ear/cfusion.war/WEB-INF/cfusion/lib/ to /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext. Though this is not recommended by MAC its the quickest way to ensure that the code runs well :P.
4)Edit standalone.conf located in <JBOSS_HOME>/bin
5)To JAVA_OPTS add the following entry:
-Djava.ext.dirs=<jboss-deployment-dir>/cfusion.ear/cfusion.war/WEB-INF/cfusion/lib/oosdk/:<java-home>/lib/ext/
Here we use /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext if our JAVA HOME is default instead of <java-home>/lib/ext/
6)Restart jboss and you're all set 

OpenOffice+OSX Error: "The application...restore windows.." in OSX 10.7

While running OpenOffice  on Mac OSX 10.7.1 ,sometimes we repeatedly get an error "The application 'OpenOffice.org' was forced to quit while trying to restore its windows.Do you want to restore its windows again"

This is a persistant popup which might lead you into thinking that something is catastrophically wrong with your OpenOffice installation.

There are several solutions on the web but the only way that worked for me is as follows:
1) Kill all instances of soffice/OpenOffice.org
2) Goto /Users/<you>/Library/Saved Application State
Library is a hidden folder ,so use Go->Go to folder from the Finder Menu
3)Look for the folder org.openoffice.script.savedState
4)Delete this folder!!!
5)Now try to use Openoffice again.

You can observe that the popup disappears.

Alternatives (in case the previous method did not help)
 1) Kill all instances of soffice/OpenOffice.org

2) Goto /Users/<you>/Library/Application Support/OpenOffice.org/3
Library is a hidden folder ,so use Go->Go to folder from the Finder Menu
3)Look for a folder named user
4)Rename user folder to user.old (just so that you have backup)
5) Now try to use Openoffice again.
(If that still doesn't fix your problem , delete the new user folder and restore user.old to user and try again)

Wednesday, 18 April 2012

ColdFusion IceBreaker #5: JBOSS 7.1 and OpenOffice for ColdFusion cfdocument


In JBOSS7.1 , there have been major changes in the class loading behaviour of applications .Due to this we need to make a few changes to use ColdFusion's cfdocument and other OpenOffice features.Class loading is based on modules,with each module having its module.xml in which one can specify dependencies on the other modules using the <dependencies> element.

To support OpenOffice with JBOSS7.1 for cfdocument, you need to:
1)Install OpenOffice and add the installation path in the ColdFusion Admin
2)Edit the module.xml located in <JBOSS_HOME>/modules/sun/jdk/main and put the following entry there:
<path name="com/sun/star/lib/loader"/>
3)Start JBOSS with the following flag in the standalone.bat/standalone.sh.
-Djava.ext.dirs=<jboss-deployment-dir>/cfusion.ear/cfusion.war/WEB-INF/cfusion/lib/oosdk/:<java-home>/lib/ext/
(':' for unix based machines and ';' in windows)

The <dependecies> element can be used to specify dependencies on the paths and packages  from the class loader which loaded JBoss Modules.These can in turn be specified for re-exported if specified using the <export> element.The <path> element is used here to list the paths.

Adding the oosdk package to the java.ext.dir ensures that the classes of that package can be found and loaded without them being on the actual class path.

One need not add the individual jars to the JBOSS classpath or the java classpath

Click here  for MAC OSX specific instructions. These just make life easier :D.

Sunday, 22 January 2012

ColdFusion IceBreaker #3: Configuring Websphere Application Server (WAS) with OpenOffice to support ColdFusion (CF) tagcfdocument

Configuring Websphere Application Server (WAS) with OpenOffice to support ColdFusion (CF) tag cfdocument.

Websphere Application Server (WAS)  is considered a fairly typical application sever considering its complex topology and various flavours.
This post is in continuation to the previous one which spoke of OpenOffice Configuration on JBOSS on Lion
Here I shall detail how to configure the same in Websphere Application Server 7.0 ND  (WAS) using IBM HTTP Server as the web sever.

The process is rather simple if you consider the amount of time and effort taken on other servers

1)Goto WAS Integrated Console
2)Goto Servers->Websphere Application Servers->server1
server1 is the default websphere application server created for a profile.Please use the the server on which you have deployed your ColdFusion Zeus application.For my purpose,I have used server1 and have deployed my ColdFusion ear on this server.
3)Click server1
4)On the Configuration tab of server1 , look for Java and Process Management.This can be found under Server Infrastructre section.Click "Java and Process Management"
5)Click "Process definition " from the Java and Process Management sub section
6)On the Configuration tab , look for Additional Properties.Under Additional Properties , you will  find a Java Virtual Machine link.Click it.
7)Place your links in Classpath text box using semi colon as the delimiter.For Example :


C:\<was -deployement-directory>\AppServer\profiles\<profile-name>\installedApps\<cell-name>\Adobe_ColdFusion_Zeus.ear\cfusion.war\WEB-INF\cfusion\lib\oosdk\lib\juh.jar; C:\<was -deployement-directory>\AppServer\profiles\<profile-name>\installedApps\<cell-name> \Adobe_ColdFusion_Zeus.ear\cfusion.war\WEB-INF\cfusion\lib\oosdk\lib\jurt.jar C:\<was -deployement-directory>\AppServer\profiles\<profile-name>\installedApps\<cell-name> \Adobe_ColdFusion_Zeus.ear\cfusion.war\WEB-INF\cfusion\lib\oosdk\lib\ridl.jar; C:\<was -deployement-directory>\AppServer\profiles\<profile-name>\installedApps\<cell-name> \Adobe_ColdFusion_Zeus.ear\cfusion.war\WEB-INF\cfusion\lib\oosdk\lib\unoil.jar; C:\<was -deployement-directory>\AppServer\profiles\<profile-name>\installedApps\<cell-name> \Adobe_ColdFusion_Zeus.ear\cfusion.war\WEB-INF\cfusion\lib\oosdk\classes

8)Restart your WAS server and you are good to go

Wednesday, 23 November 2011

ColdFusion IceBreaker #2: Configuring JBoss in OSX Lion with OpenOffice to support cfdocument



ColdFusion empowers users to deploy it as a EAR/WAR file in their existing Application Server (J2EE config) and all the CF features can be used along with the benefits offered by the Application Server.
The <cfdocument> tag in ColdFusion lets you convert your word document to PDF and powerpoint presentations to PDF/HTML format and in some of its use cases , uses OpenOffice (About OpenOffice)

If OpenOffice is installed before ColdFusion is installed on your machine then ColdFusion detects the presence of OpenOffice and adds the location of OpenOffice to ColdFusion Administrator->Server Settings->Document

However,when deployed as a EAR/WAR, and despite detecting the OpenOffice location ,the OpenOffice library jars need to be added to the server configuration files  manually before Openoffice can be used through <cfdocument>.

A quick link for the know-it-all :ColdFusion : Configuring OpenOffice for J2EE servers

Below are mentioned a few steps for installing JBOSS on Mac OSX Lion and configuring OpenOffice on it.

1)Download OpenOffice for OSX .The zip file would download to the /Downloads folder on your mounted device

2)Unzip the file using Archive Utility and install OpenOffice

3)In some cases,it is shown as a device under the mounted device.Drag and drop the OpenOffice.org app to /Applications folder.Info will say /Applications/OpenOffice.org.app.This will have the folder Contents.

4)Install JBOSS.Simply download the zip file,place it in a temporary location and unzip it
Eg: /Applications/JBOSS_MAC/jboss-6.1.0.Final/
JBOSS is now installed
This would now have the following folder structure:
copyright.txt
README.txt
LICENSE.txt
jar-versions.xml
common
client
lib
docs
server
logs
bin

5)Install ColdFusion as an EAR.Use the installer to create an ear file and expand it (java -xvf) to generate cfusion.war,META-INF and rds.war.Expand cfusion.war and rds.war.
This should now have the following folder structure:
/Applications/JBOSS_MAC/jboss-6.1.0.Final/server/default/deploy/cfusion.ear/cfusion.war/WEB-INF etc
/Applications/JBOSS_MAC/jboss-6.1.0.Final/server/default/deploy/cfusion.ear/rds.war/
/Applications/JBOSS_MAC/jboss-6.1.0.Final/server/default/deploy/cfusion.ear/META-INF/

6)Check the presence of the OpenOffice library jars in
/Applications/JBOSS_MAC/jboss-6.1.0.Final/server/default/deploy/cfusion.ear/cfusion.war/WEBINF/cfusion/lib/oosdk/
This should now have the following folder structure:
classes
lib
lib folder should contain the following jars
-juh.jar
-jurt.jar
-ridl.jar
-unoil.jar

7)Now,add these to the java paths of JBOSS as follows:

7.1) Goto /Applications/JBOSS_MAC/jboss-6.1.0.Final/bin
7.2) Edit run.conf
7.3) Add the locations to java.class.path
Eg:
JAVA_OPTS="-Xms128m -Xmx512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.class.path=/Applications/JBOSS_MAC/jboss-6.1.0.Final/server/default/deploy/cfusion.ear/cfusion.war/WEB-INF/cfusion/lib/oosdk/classes:/Applications/JBOSS_MAC/jboss-6.1.0.Final/server/default/deploy/cfusion.ear/cfusion.war/WEB-INF/cfusion/lib/oosdk/lib:/Applications/JBOSS_MAC/jboss-6.1.0.Final/server/default/deploy/cfusion.ear/cfusion.war/WEB-INF/cfusion/lib"
7.4) Edit run.sh
7.5) Add the locations to JBOSS_CLASSPATH
Eg:
export JBOSS_CLASSPATH="$JBOSS_CLASSPATH:/Applications/JBOSS_MAC/jboss-6.1.0.Final/server/default/deploy/cfusion.ear/cfusion.war/WEB-INF/cfusion/lib/oosdk/classes:/Applications/JBOSS_MAC/jboss-6.1.0.Final/server/default/deploy/cfusion.ear/cfusion.war/WEB-INF/cfusion/lib/oosdk/lib/juh.jar:/Applications/JBOSS_MAC/jboss-6.1.0.Final/server/default/deploy/cfusion.ear/cfusion.war/WEB-INF/cfusion/lib/oosdk/lib/jurt.jar:/Applications/JBOSS_MAC/jboss-6.1.0.Final/server/default/deploy/cfusion.ear/cfusion.war/WEB-INF/cfusion/lib/oosdk/lib/ridljar:/Applications/JBOSS_MAC/jboss-6.1.0.Final/server/default/deploy/cfusion.ear/cfusion.war/WEB-INF/cfusion/lib/oosdk/lib/unoil.jar:/Applications/JBOSS_MAC/jboss-6.1.0.Final/server/default/deploy/cfusion.ear/cfusion.war/WEB-INF/cfusion/lib"

8)Use sudo ./run.sh -b 0.0.0.0 to start your server
This will enable other IPs to access your ColdFusion Application

9)Login to ColdFusion Administrator->Server Settings->Document.Check the OpenOffice installation directory.

10)Try to run a simple <cfdocument> example
<cfdocument format="pdf" srcfile="<path_to_word_doc>" filename="<path_to_destination_with_file_name>" overwrite="true">
</cfdocument>

View your pdf file.