Monday Aug 06, 2012

Got Java (configured correctly)?

Have you ever had firefox crash with the following error when trying to access a Java-based application?

Didn't find JVM under /<path to>/firefox/plugins
Assertion failed: foundJVM, file ../../../../src/plugin/solaris/plugin2/common/JavaVM.c, line 104
Abort (core dumped )

I'm not talking about a sophisticated Java app here.  Just hitting the "Do I have Java?" test page on will crash Firefox and pretty much any Mozilla-based browser left with the default Java configuration.

Here's what the default (and incorrect) Java configuration looks like on pretty much every version of Firefox since 3.5.  You can see it by typing about:config in the URL bar, acknowledge the warning, and filter on "java" (click for larger view):

Stating that the default Java configuration is incorrect, really means that it's set to use the old Java plugin and (in most cases) a rather old version of Java.  This plugin that is configured by default is incompatible with Firefox 3.5 and beyond.   The first generation Java plugin is called javaplugin_oji and cannot be used with any modern version of Firefox. 

Unfortunately, even the latest Firefox (14 at the time of this post) comes configured to use the old Java plugin by default. 

This means that if you're trying to run a Java-based app on anything greater than Firefox 3.5, you'll wind up with a crashed app and a core file a few seconds after the browser tries to start Java. 

If you've been frustrated by not being able to run Oracle Forms-based apps, WebEx, or any other Java-based browser app on Solaris or Oracle Linux, follow the instructions below.  If you're an Oracle Forms user, get ready for smoking fast response time sans MS Windows and IE. 

Disclaimer: I know neither Solaris or Oracle Linux are supported clients for Oracle Forms-based apps.  Doesn't mean it doesn't work.  It, in fact, works great!  :)

First things first, learn the name and location of the "second generation" Java plugin.  The second generation Java plugin is called and is located in:

<path to java>/jre/lib/i386/ for x86 based machines

<path to java>/jre/lib/sparc/  for SPARC based machines.

NOTE:  The second generation Java plugin was introduced in Java 1.6 update 10.  Ensure that you aren't running an older version of Java, if you are upgrade.  Solaris 10 U9 ships with 1.4.2_26, so that will need to be updated in order to access Java-based apps with Firefox 3.5 or greater.

TIP:  Sun Ray Software and Oracle VDI always ships with a relatively recent Java release.  An administrator can symlink these installations to /usr/java.  This will ensure that the browser's Java configuration will always be as current as the JRE used with Sun Ray Software or Oracle VDI, even across upgrades of those products.

For a Sun Ray Server:

rm -rf /usr/java
ln -s /etc/opt/SUNWut/jre /usr/java

For a Oracle VDI server:

rm -rf /usr/java
ln -s /opt/SUNWvda/java /usr/java

Note: The remainder of these instructions assume the following three things:

1) Java, greater that 1.6 U10, is installed (or linked to) /usr/java
2) Firefox, greater than 3.5 is installed in /opt/firefox.
3) The platform is x86

If any of those assumptions do not match your environment, just substitute the correct paths to Java, Firefox, and the correct platform (i386 or SPARC) for your environment

Step 1) Configure Firefox plugins directory

1.1) Create plugins sub-directory under /opt/firefox.  

The plugins directory doesn't exist by default since about Firefox 6, so you'll have create it.  Just create /opt/firefox/plugins and change the permissions so everyone can read/execute the contents:

mkdir /opt/firefox/plugins
chmod -R 755 /opt/firefox/plugins

1.2) Create symlink the new plugin in /opt/firefox/plugins/

Given the location and platform assumptions above, create a symbolic link in /opt/firefox/plugins that points to /usr/java/lib/i386/libnpjp2:

ln -s /usr/java/lib/i386/ /<path to>/firefox/plugins/

Note:  Do not "copy" the library to the plugins directory, this will not work.  The plugin is dependent on the relative path of where it resides.  This is different than other plugins that you may be used to installing such as Acrobat Reader or Flash.

1.3) Remove any symlinks that point to the old java plugin.

rm /opt/firefox/plugins/

Note: Some sites may use a personal plugins directory.  If so, be sure to remove any symlinks for from $HOME/.mozilla/firefox/*.default/plugins

1.4)  Test.  At this point, accessing the "Do I have Java" test page from will now succeed and tell you are using the second generation plugin, but certain apps, such as Oracle Forms and WebEx, will still fail. 

Now that the correct second generation plugin correctly linked to the Firefox plugins directory, it's time to tell Firefox the name of the plugin and the location of Java.

Step 2) Configure Firefox with the location of Java and the name of plugin

Note: This step needs to be done by each user who has ever ran Firefox with the old Java configuration. 

2.1) Open Firefox
2.2) Type "about:config" in the URL bar and acknowledge the "I'll be careful" warning
2.3 ) In the Filter Box, type java and hit return
2.4) Set both java.default_java_location_others and java.default_java_location_solaris to: /usr/java
2.5) Remove/blank out the existing entry under java.global_java_version_file (as the file referenced there does not exist)
2.6) Set the java.java_plugin_library_name to libnpjp2 (or, either will work)
2.7) Remove/blank out the existing entry under java.private_java_version_file (as the file referenced there does not exist)
2.8) Close and re-open firefox.  Enter about:config in the url and ensure the settings took place.

The about config screen should now resemble this picture (click for larger image):

2.9) Test out a Java based app, such as WebEx or Oracle E*Business Suite (EBS uses Oracle Forms).  The applications should work correctly, and more importantly, firefox should not crash anymore. At least not due to an incorrect Java plugin configuration!

Step 3) Create default Firefox preferences file for new users

This will prevent first time users of Firefox (or those who wanted to create a new profile) from having to perform the actions in Step 2.  To do this, the administrator creates (or appends to the contents of) a file called prefs.js under the firefox default profiles directory and fills out these values for all new users.

3.1) Create the default profile directory, if one does not exist under /opt/firefox/defaults/

mkdir /opt/firefox/defaults/profile
chmod -R 755 /opt/firefox/defaults/profile

3.2) Edit /opt/firefox/defaults/profile/prefs.js

The contents of prefs.js for a proper Java plugin configuration would be:

# Mozilla User Preferences
user_pref("java.default_java_location_others", "/usr/java");
user_pref("java.default_java_location_solaris", "/usr/java");
user_pref("java.global_java_version_file", "");
user_pref("java.private_java_version_file", "");
user_pref("java.java_plugin_library_name", "libnpjp2");

That's it.  All users should be good to go for running Java-based apps on a modern release of Firefox.

Tuesday Jan 11, 2011

VDI In The Sky: Encore

A while back my colleague ThinGuy posted a blog entry called "VDI In The Sky" showing photos of the Oracle Virtual Desktop Client on a Netbook accessing a Oracle VDI hosted desktop from 30,000 feet.   On a trip I took to San Francisco I could not help wanting to try it myself.  I often talk of the benefits of the Sun Ray Appliance Link Protocol to customers.  With wifi service available on many airlines and at reasonable prices for business travel I was in luck.   

As a side note, when I am discussing with customers the concept of Virtual Desktop Infrastructure I always get the "What about when I am not connected like on a airplane?" question.  I ask you to look at the evolution of being connected (or "Online") and the pace of the adoption of network technologies making network access ubiquitous.   It is amazing how quickly network access and network speeds have evolved.   So I ask in return, "When are you not connected?  if you are not, do you really have much to do?"

So there I was on a plane in premium economy with a bit more leg room, wifi internet access, a Cisco VPN connection to my lab,  and the Oracle Virtual Desktop Client installed.  It was too hard to resist trying what Thinguy showed, so I fired up my mobile phone video recorder and gave it a try (Sorry for the shaky hand but typing and recording at the same time was a challenge)

I couple of things I want to point out as you watch this:

  1. The internet access was from 30,000 feet traveling at several hundred miles per hour (A incredible networking feat on it's own)
  2. The greatest challenge to using internet access on a airplane is "Latency" that impacts the user experience by having to wait for those emails messages to load,  files to download / upload,  or in this case for the screen to draw a VDI hosted desktop.   Latency is measured in milliseconds (ms) and on your home broadband network will likely be in area of 100ms to 150ms depending upon what you use.  Over airplane wifi connections you will see in this video it is 300ms to 400ms latency and it is not consistent, it changes up and down frequently thanks to the plane's airspeed.
  3. In order to access my VDI hosted desktop securely I needed to create a VPN tunnel so now I have added IPsec encryption to the 300-400ms latency. 

My goal was to answer the question "Would accessing a Virtual Deskop from 30,000ft at high latency be usable or just a gimmick?" I will certainly say that playing youtube videos over this connection is entirely unreasonable so I did not even try.   I set out to access a variety of desktops - Windows 7,  Windows XP, Windows Server 2003, Windows Server 2008, and Ubuntu Linux all accessed by Oracle VDI software.  My focus was on the following tests:

  • Responsiveness of the Oracle VDI login and desktop selection screens
  • Initial desktop screen draw time and pix-elation  from network delay.  Initial screen draws are typically the largest.
  • Mouse click response time such as selecting windows manager functions and having them respond reasonably.  Click delays will drive even the most patient user crazy.
  • Determine the impact of accessing different desktop back-ends such as Windows Server, Windows 7, and Ubuntu Linux

I could have spent hours on different tasks but I chose these basic ones for the sake of time and so I have a reason to test other things on another trip ;-)

Some conclusions for me:

  • The usability for displaying a desktop is very good for a variety of desktops with Oracle VDI using the Sun Ray Appliance Link Protocol
  • I could certainly do more over this connection with remotely displaying a VDI desktop and applications.  Data intensive tasks are better left in the data center such as:
    • Trying to load a large inbox to a mail client and open attachments. When opening mail using a VDI hosted desktop that one big attachment can be opened in a few seconds rather than loading it into a mail client over the airplane wifi at high latency
    • Many applications are accessed by a browser and are very "chatty",  meaning they frequent transactions back and forth and will suffer by high latency on a WAN. These applications will perform well in a VDI model since the browser and the applications are on a data-center backbone and not on a WAN.
    • Trying to access large files from a home directory.  Users can load any size file needed into OpenOffice that resides a VDI hosted desktop and not worry about the data transfer time to a laptop
    • I prepared a presentation during travel time and never had to close then re-open the file.  Same thing goes for email messages I was editing.
So what is the big deal?  Why VDI in the sky anyway?
  1. Corporate and customer data are completely secure in the data-center. (As long as it is kept there)
  2. Desktops OS and personal data are backed up transparently - Less time spent as a desktop administrator and more time for what users are paid to do.  (Example: My corp laptop is old and makes unnerving noises at times so I am worried)
  3. With Oracle VDI users can have a variety of desktops and not be limited by the hardware they carry - Windows XP, Windows 7, Ubuntu Desktop, Oracle Enterprise Linux, Solaris, and more.
  4. Tasks can be started then disconnect and reconnect from them as needed without having to restart from the beginning
  • Think editing a OpenOffice presentation, document, spreadsheet and not having to worry if your laptop battery dies losing critical changes
  • The ability to access any size file a user needs whether it is in email, on a home directory, or on a company shared folder and not be impacted by limitations of the network being using at the time
  • A developer can load source files into development tools and run tests or compiles then disconnecting while traveling and  knowing they keep on running as needed

There are many more examples that I will save for a forth coming blog series called "Why VDI"

 Thanks for reading

Wednesday Nov 17, 2010

Webinar: Access to Oracle Applications with Oracle Secure Global Desktop

Please join us today at 9 AM PST as we discuss how to increase security and simplify user access to your Oracle Applications by using Oracle Secure Global Desktop.  Brad will be one of the presenters, and I'll be helping with the Q&A chat.

Get more info and register here.


Think Thin is a collection of bloggers that work with Oracle's Virtual Desktop portfolio of products.


« April 2014