Sunday, April 14, 2013

Liferay 6.1.1 GA2 on Ubuntu 12.04

My, my how time flies.

Well now playing about with the latest versions of Ubuntu LTS server version and Liferay on Tomcat. On initial install of Ubuntu I didn't install any Java S/JDKs and thats why the Liferay Tomcat bundle didn't work at all. So, I accidentally forgot to install the SUN (Oracle JRE) and installed the Open one which worked fine except that I am now getting all sorts of errors and unexpected things happening including stack traces when uploading logos and going to maintain my personal account details, which requires a repeat sign-on.

So, I decided to try switching to the Glassfish bundle but first realised I may as well fix the JRE first and see if that solves the problem.  First then, how to figure out which version you're running:

..:~:$ java -version

... I got this:


java version "1.7.0_15"
OpenJDK Runtime Environment (IcedTea7 2.3.7) (7u15-2.3.7-0ubuntu1~12.10.1)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

I think I need the Oracle/Sun version to be sure so uninstalled it:


sudo apt-get remove openjdk-7-jre



Now I need to install the correct version, which should be done via these commands (from HERE)


# Step 1: Add the repository for JDK 7.
sudo apt-add-repository ppa:webupd8team/java

# Step 2: Update
sudo apt-get update

# Step 3: Install JDK and associated utilities
sudo apt-get install oracle-java7-installer

# Step 4: Set the default java interpreter used by the system.
sudo update-alternatives --config java

Unfortunately I got this message:

"sudo: apt-add-repository: command not found"

So first I have to fix that!

Best guess so far is from HERE: which indicates that I need to install Python things:


sudo apt-get update && sudo apt-get install python-software-properties

and:

sudo apt-get install software-properties-common


So now I can try the command I was going to try earlier:

sudo apt-add-repository ppa:webupd8team/java

which gave me scary message:

You are about to add the following PPA to your system:
 Oracle Java (JDK) Installer (automatically downloads and installs Oracle JDK6 / JDK7 / JDK8). There are no actual Java files in this PPA. More info: http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html
 More info: https://launchpad.net/~webupd8team/+archive/java
Press [ENTER] to continue or ctrl-c to cancel adding it

so I added it of course, and continued with:

# Step 2: Update
sudo apt-get update

...which updated loads of things and so I thought it would be worth the next step:

# Step 3: Install JDK and associated utilities
sudo apt-get install oracle-java7-installer

And now it's installing, in fact I get a "YOU MUST AGREE TO..." screen from Oracle.  So I hit Ok and now it's connected to oracle and downloaded stuff, then cleaned up a cache then set up fonts or something and triggers....

Now finished and seems to be all done.  So I'll try my Tomcat/Liferay install again.

Now trying out the Proof-of-concept site www.histiocytosis.org.uk again, its taking a very long time to load... Hmmm, is it broke?  I wonder....

Well, typically, the site is up but we have the same damned problems with the saving of changes to My Account and the logos.  This seems to be the same as THIS ISSUE on Liferay forums:

Of course, the sharp-eyed amongst you will have realised by now that I missed out on Step 4:


# Step 4: Set the default java interpreter used by the system.
sudo update-alternatives --config java


Me, being somewhat less sharp-eyed just noticed.  So I'll try it now..

I got this:


  Selection    Path                                            Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-7-oracle/jre/bin/java          1072      auto mode
  1            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      manual mode
  2            /usr/lib/jvm/java-7-oracle/jre/bin/java          1072      manual mode


which sort of suggests I already have the oracle version running.  I selected 2 anyway and rebooted and restarted Tomcat to see if the issues are fixed, with little confidence I have to say.