Thursday Jun 09, 2011

Running Java Web Start From a Zone

As indicated in my previous entry, I run my VPN software within a zone to connect to the Oracle intranet. Another component I need to access is the Solaris bug tracking system, which is launched via Java Web Start. To my disappointment, this also required a bit of troubleshooting. As my example here, I'll use one of my favorite Java Web Start applications, JDiskReport.

Assuming you left off with getting Firefox running from a zone, if you attempted to Web Start JDiskReport, the first problem is that Java Web Start isn't even installed on the system:


This is easy enough to fix:

root@myzone:~# pkg install java
               Packages to install:     5
           Create boot environment:    No
               Services to restart:     1
DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                                  5/5     779/779    34.4/34.4

PHASE                                        ACTIONS
Install Phase                              1179/1179 

PHASE                                          ITEMS
Package State Update Phase                       5/5 
Image State Update Phase                         2/2 

With Java installed, Firefox properly detects Java Web Start:

However, when you try to launch JDiskReport now, nothing happens at all. This is the most frustrating kind of error.

If you select the option to save the jdiskreport.jnlp file to your home directory and try to launch it from there, you'll see we're dumping core again:

bleonard@myzone:~$ javaws jdiskreport.jnlp 
Segmentation Fault (core dumped)

Unlike with Firefox however, we're not given anything else to work with. Using truss and digging into the stack trace, I was able to determine we also need the packages utf-8 and libxtst:

root@myzone:~# pkg install utf-8 libxtst
               Packages to install:     1
           Create boot environment:    No
DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                                  1/1   2674/2674    10.4/10.4

PHASE                                        ACTIONS
Install Phase                              2722/2722 

PHASE                                          ITEMS
Package State Update Phase                       1/1 
Image State Update Phase                         2/2 

Once these 2 packages are installed, you're in business with Java Web Start:


It's worth noting what a small footprint my zone has - less than 1 GB. Pretty cool, huh? Even more impressive is that it's actually only consuming 400 MB of space in my global zone because it's on a zfs dataset with compression turned on:

bleonard@solaris:~/Desktop$ zfs get all rpool/zones/myzone
NAME                PROPERTY                        VALUE                           SOURCE
rpool/zones/myzone  type                            filesystem                      -
rpool/zones/myzone  creation                        Wed Jun  8 11:31 2011           -
rpool/zones/myzone  used                            388M                           -
rpool/zones/myzone  available                       14.7G                           -
rpool/zones/myzone  referenced                      33K                             -
rpool/zones/myzone  compressratio                   1.89x  
...                         -

And while we're on the subject of resource consumption, look at zonestat:

bleonard@solaris:~$ zonestat 5 1
Collecting data for first interval...
Interval: 1, Duration: 0:00:05
SUMMARY                    Cpus/Online: 1/1   Physical: 1535M    Virtual: 2512M
                    ----------CPU---------- ----PHYSICAL----- -----VIRTUAL-----
               ZONE  USED %PART  %CAP %SHRU  USED   PCT  %CAP  USED   PCT  %CAP
            [total]  0.31 31.8%     -     - 1141M 74.3%     - 1369M 54.5%     -
           [system]  0.12 12.7%     -     -  302M 19.6%     -  643M 25.6%     -
             global  0.15 15.5%     -     -  604M 39.3%     -  529M 21.0%     -
             myzone  0.03 3.57%     -     -  234M 15.2%     -  196M 7.81%     -

Only 234M of RAM. Like I said in the previous post, you can't achieve numbers like that with a VirtualBox VM.

Monday Jul 21, 2008

Java Web Start

I went to start a Java Web Start application today and was disappointed that it didn't work. The default operation is to open the jnlp file in Firefox, which only causes the dialog to appear again.

I recalled seeing a comment on Gregg's Getting Java blog from Simon Phipps who was having the same problem. The solution is to select "Other..." from the Open with drop down and then browse to /usr/bin/javaws. Also select "Do this automatically for files like this from now on.":


This is already tracked as a defect: Firefox needs a default MIME association for Java Web Start (JNLP).

About

The Observatory is a blog for users of Oracle Solaris. Tune in here for tips, tricks and more as we explore the Solaris operating system from Oracle.

Connect with Oracle Solaris:


Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
20
21
22
23
24
25
26
27
28
29
30
   
       
Today