Project

General

Profile

Administration Client Setup

Running Inside the Browser

Browsers are moving away from applet support, because this use has exposed a large number of security problems while simultaneously being less needed over time as applets migrate to more modern web technologies. Some of the latest Java environments as of March 2017 no longer support applet execution in the browser. See this link for details on how to run the administration client outside of the browser.

If your Java and browser combination supports applets inside the browser, the following sections explain how to enable that usage.

Prerequisites

The administration client is used to manage and control the FWD server and its configuration. The administration client is accessed via a secure (HTTPS) connection in a browser.

The user interface and logic of the administration client is implemented as a Java applet. This means that the system on which the browser runs must meet two requirements:

  1. The Java runtime environment J2SE 1.6.0 update 10 (or later) must be installed.
  2. The appropriate Java plug-in for the browser must be installed and operational.

Test the Java Runtime Environment

The version of the Java runtime environment installed could be verified by typing java -version on a command line.

Also the ControlPanel utility could be used to check if there are multiple versions of Java installed and witch version is enabled. Launch ControlPanel from the bin directory of the JRE installation and select the Java tab. Press the View button in the Java Applet Runtime Settings pane Make sure there is only one checked box in the Enabled column and that the line is for a JRE version greater than 1.6.0_10.

If you don't have an appropriate Java version download the latest JDK from http://java.sun.com/javase/downloads/index.jsp and install it. After the installation check again the version installed and the enabled Java runtime versions.

Test the Java Plugin in the Browser

Open the browser and go to the following address: http://java.com/en/download/testjava.jsp. If the page will contain informations about your Java installed version which matches the screen shot below, the Java plug-in is installed and works properly.

For the Mozilla Firefox browser, you can obtain a report of the installed plug-ins using the about:plugins URL. This is an example of that report:

This report will confirm both the J2SE version as well as the availability of the plug-in. The same URL, about:plugins, works also for the Google Chrome browser.

Java Policy Permissions

Starting with Java 7 and Java 8, when generating a report to file or to printer you might see a message like error while opening file java.security.AccessControlException: access denied ("java.util.PropertyPermission" "user.home" "read") or error initiating report - checkPrintJobAccess. This is caused by security restrictions in the java.policy file; to allow the report to generate to file or to printer, these settings must be added in the grant section:

permission java.security.AllPermission;
permission java.io.FilePermission "<<ALL FILES>>", " 
permission java.io.FilePermission "<<ALL FILES>>", "write";
permission java.util.PropertyPermission "*", "read, write";
permission java.util.PropertyPermission "user.home", "read";
permission java.util.PropertyPermission "user.dir", "read";
permission java.lang.RuntimePermission "modifyThread";
permission java.lang.RuntimePermission "*";      
permission java.lang.RuntimePermission "queuePrintJob" 

Making the Administrative Client Use a Separate JVM

The reason for the J2SE 1.6.0 update 10 (or later) requirement is due to the use of static data in the SecurityManager and Dispatcher classes. This means that each administration client session has to run in a separate JVM. To do otherwise would cause the sessions to improperly share state and the results would be incorrect at best. The problem is that prior to J2SE 1.6.0 update 10, the Java plugin provided runs all applets in the same JVM process. This means that more than one administration client session in the same browser will break. Starting with J2SE 1.6.0 update 10, the “Next Generation” Java plugin is included. This new version of the plugin supports running each applet in a separate JVM.This newer version of the plugin is compatible only with the certain versions of browsers. In the case of mozilla Firefox, Firefox 3 is acceptable, but Firefox 2 cannot be used.

One side-effect of this new plug-in is that using multiple JVMs for applets in the same browser will cause multiple Java Console windows to appear if they are configured to be open automatically. The browser may also provide options to disable support for Java. In such a case, Java usage needs to be enabled, at least for the FWD server's URL.

Enable the Java Browser Plugin

If the available plug-ins report do not list the Java plugin you should follow these steps to install it:

  • Copy the following lines in a file:
JAVA_HOME=/usr/java/jdk1.6.0_33
cd
cd .mozilla
mkdir plugins
cd plugins
ln -s $JAVA_HOME/jre/lib/i386/libnpjp2.so ./mozilla
  • In the above script change the JAVA_HOME to the real location of java installation on your computer.
  • If you have a 64-bit installation change on the last line $JAVA_HOME/jre/lib/i386/libnpjp2.so with $JAVA_HOME/jre/lib/amd64/libnpjp2.so.
  • Save the file in your home directory with the name enablejava.sh.
  • Make the file executable using the chmod command:
chmod +x enablejava.sh.
  • Run the enablejava.sh file.
  • Restart the browser.
Mozilla Firefox Prior to Version 3.6

The following is an example from Mozilla Firefox, that shows the dialog in which Enable Java has been selected.

h5(#mozilla-firefox-version-3.6-or-newer).
Mozilla Firefox Version 3.6 or Newer

On Mozilla Firefox version 3.6 or newer Java could be enabled or disabled using the Tools → Add-ons menu.

Google Chrome

For Google Chrome browser Java plug-in chould be enabled or disabled from the plugins page. This page could be accessed by typing about:plugins or chrome:plugins in the adress bar.

Microsoft Internet Explorer 8

To enable or disable the Java plug-in for the Microsoft Internet Explorer 8 browser select the Tools → Manage Add-ons menu.

Also check the Advanced tab of the Internet Options if Java is enabled for applets.

Running the Administration Console Outside the Browser

Recent versions of Chrome and Mozilla Firefox (as from March 2017) do not allow Java code to be run in a browser, via an applet. The alternative to do this is using the Java's built-in AppletViewer.

To do this, create the following files in a folder:
  1. adminapplet.html - this is a HTML page with the details for the applet. The content of this file will be:
    <html>
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
       <body>
          <applet code=com.goldencode.p2j.admin.client.AdminClient.class width="1024" height="768" >
             <param name="p2jserverport" value="[p2jport]">
             <param name="p2jservername" value="[p2jhost]">
          </applet>
       </body>
    </html>
    

    where [p2port] and [p2jhost] need to be replaced with the target P2J server's host and secure port.
    In the Administration Console, these settings correspond with the message you can see in the lower-left corner:
    Target <server-name>@<host-name>:<port>
    

    where <host-name> and <port> are the host and secure port for the target P2J server and <server-name> is the P2J server name.
    You can also adjust the size of the applet window to fit your display.
  2. java.policy.applet - file which grants all permissions to the applet, with this content:
    grant {
      permission java.security.AllPermission;
    };
    
  3. create the script to start the applet (adminapplet.sh or adminapplet.cmd, depending on your OS). If you have custom admin extensions, add both the client and server jars for these extensions to the -classpath option, making sure to use the correct separator for the target OS. The contents will be like:
Linux Windows
java -Djava.security.policy=java.policy.applet -Dfile.encoding=UTF-8 -classpath p2jadmin.jar:. sun.applet.AppletViewer adminapplet.html
java -Djava.security.policy=java.policy.applet -Dfile.encoding=UTF-8 -classpath p2jadmin.jar;. sun.applet.AppletViewer adminapplet.html

Once you have these files created, copy also (to the same folder) the p2jadmin.jar and all the client and server jars for the custom admin extensions (if available). After this, use the adminapplet startup script to start the administration console.

Note that the p2jadmin.jar and the custom admin extenstion jars need to be the same versions of the files as the ones used by the target P2J server; otherwise, you may get incompatibilities errors between the compiled classes.

If you have multiple P2J servers to which you want to connect, create a folder with the contents as described above, for each of these P2J servers, make sure there is a adminapplet.html page which specifically targets that server.


© 2004-2017 Golden Code Development Corporation. ALL RIGHTS RESERVED.