|
ION Java User's Guide |
|
Using ION applets over the World Wide Web requires interaction between your Web server, the ION Server, and IDL. This section discusses some possible ION Server and IDL problems you may encounter:
Unexpected errors occur when attempting to use previous ION classes with the ION 6.4 server or vice versa. To avoid conflicts, remove the previous ION installations's service, and all previous ION class, .zip, and .jar files from your system before installing ION 6.4.
To remove the previous ION Service, complete the following steps:
After removing the previous ION service, uninstall your previous ION version.
After removing the previous ION service, uninstall your previous ION version by deleting the directory tree.
If you have configured a system variable for CLASSPATH, make sure it is not referencing your previous ION version. See Setting the Class Path for more information.
From within an application, you can see which version of ION your application is using by adding a call to the getClientVersion() method of the IONCallableClient Class. Make sure the resulting string value indicating the current version of ION is ION 6.4.
Make sure you are able to communicate with the Web Server. For example, using the Apache Web server, you can enter a URL such as http://localhost or http://hostname, where hostname is the hostname or Windows machine name of your computer. If your Web server is properly configured, you should receive a page stating that the Apache Web server has been successfully installed on your site. Consult your Web server documentation to find out how to test your Web server.
On Windows, select Start
Programs
ION 6.4
ION Java Status. In the "ION Status" dialog, enter the hostname of your computer and click Query. If you receive a message, "Unable to connect to the ION Java Daemon," you should make sure the service is started and that the port number is correct. Use the "Control" tab of the ION Java Properties utility to start the ION service and to check the port number. See The ION Java Properties Dialog.
On UNIX, change to the ITT_DIR/ion64/ion_java/bin directory and enter ionstat to query the ION Service. If you receive the message, "Error: Unable to locate ION Java Server," see Starting the ION Daemon on UNIX for instructions on how to start the ION Service.
On Windows NT systems, only users with the administrator privileges are allowed to start and stop the ION service using the Services Control Panel. If you have Administrator privileges but continue to experience problems when trying to start or stop the ION service using the utility described in the section, The ION Java Properties Dialog, you may need to use the Windows task manager to end the process or reboot the server to resolve the problem.
If the ION Service is not running on the default port number (7085), then the applet code must specify the port number. See Connecting to the ION Server information about including a port number connection parameter within an applet.
If the client machine is located behind a firewall and the socket connection between the ION server and the client machine cannot be established, the user on the client machine should verify that the SOCKS proxy is enabled in their browser.
On each browser, you will see a list of the proxies supported by the browser as well as other information your site uses to implement the proxy. If the SOCKS proxy field is blank, check with your System Administrator to see if your site supports the SOCKS proxy. If the SOCKS proxy is available, input the correct information.
When an applet fails to display, first make sure the ION Service is started. See Checking Web Server Communication. If you are on a slow connection (modem), you may need to wait for all of ION Java's class files to be downloaded to your browser. These Java class files are required by ION Java for proper operation. If neither of these issues seem to be the problem, check the following sections for additional possibilities.
Most web browsers include a setting that enables the use of Java applets in HTML pages. Make sure your browser is configured to allow Java to load by completing the following steps for your browser.
Enable Java in Netscape Navigator
If an ION applet fails to load as expected, even though you are using the correct CODEBASE, you might need to shut down and restart the browser. It's a good idea to shut down and restart the browser any time you make changes to your HTML or class files.
If your applet fails to function properly, always check the Java console. To open the java console, complete the following steps for your browser.
Java Console. If Java Console is not an active option, complete the following steps:
Internet Options and click the Advanced tab.
Java Console.
| Note If you are running the client and the server on the same machine, setting the system CLASSPATH environment variable can result in errors similar to the following, appearing in your browser's Java console: Netscape Java Console — #Applet exception: error.java.lang.ClassFormatError:class already loaded IE Java Console — Error getting package information: com/itt/ion To avoid such errors, specify the class path when compiling as described in the section, Compiling .java Files. |
It is also helpful to set the ION applet Debug Mode, which allows you to check for IDL command log output or java program output for errors. See Debug Mode for more information.
| Note Applets may also fail display because of security errors. See Troubleshooting Security Errors for more information. |
If you encounter an error that looks like:
Applet xxx can't start: class xxx not found
in the message area of your browser or in the Java Console, check to make sure that the ION package (the directory hierarchy com/itt/ion/*) or the appropriate ION archive file is located either in the same directory as the HTML page that contains the applet or in the directory specified by the CODEBASE attribute of the APPLET tag. See Locating the Class Files for use by ION Applets and Supporting Java Archive Files for details.
| Note Class names are case sensitive. Within your Java code, calling customaction.class when the file has been saved as CustomAction.class and can produce a "class not found" error. |
The ION Daemon runs with the user and group ID of the user who started it. This means that the daemon will have the same file access permissions as that user. While it is not necessary to start the ION Daemon as a particularly privileged user, make sure that the access permissions for the ION class files and any class files you create are such that the ION Daemon has read permission.
If your applet does not run and the Java Console shows something like the following:
# Applet exception: class myApplet not found
where you know that the myApplet.class file exists and is located in the designated place, you may have a file permissions problem.
If you get a license manager error on Windows stating that the license file cannot be found, your ION Java installation may not have been properly licensed. Review the licensing instructions in the Installing and Licensing IDL manual and make sure you have properly licensed ION.
| Note You can use the LM_LICENSE_FILE environment variable to point to where you have located your license file. The file does not have to be located in the default location ITT_DIR\license\license.dat, where ITT_DIR is the name of the main installation directory where you selected to install ION Java. |
| Note Licensing errors appear on the server machine, not the client machine. |
The IDL Search Path is used to specify the search path used by IDL for .pro and .sav files. If you call user-written IDL routines from an applet, make sure that the .pro files are located in IDL's path. You can set the IDL Path using one of the following methods:
.pro files in the path specified by the IDL_PATH preference. (See IDL Preferences for details on setting preferences.)
To specify multiple IDL Path search directories, separate each directory with a semicolon (Windows) or a colon (UNIX). Place the "+" symbol at the beginning of a directory to indicate that all subdirectories of a specified directory should be searched. For example the following Windows IDL Search Path specifies that the directory C:\Program Files\Apache Group\apache2\htdocs\IONJava and all its subdirectories be searched as well as the C:\java_source directory:
+C:\Program Files\Apache Group\apache2\htdocs\ IONJava;C:\java_source
On UNIX, the following IDL Search Path specifies that the directory /usr/local/apache2/htdocs/ionjava and all of its subdirectories be searched as well as the /home/java directory:
+/usr/local/apache2/htdocs/ionjava:/home/java
If ION attempts to compile and run a .pro file that is not in the path, no output will be generated but no error will be displayed. The best way to catch errors like this is to enable the ION applet Debug Mode and check the IDL command log output. See Debug Mode for more information.
Security errors result when attempting to open HTML files containing applets using the IE browser's File
Open command or when double-clicking an .html file to open it in the browser. When using Internet Explorer, always use an URL to specify the file location, for example, http://www.mydomain.com/htmlfiles/index.html.
Applets that violate the screening process specified by security command settings will result in errors. See Command Security to see if your applet is failing the ION Service's security criteria.
If you do encounter an error when running a Java applet, some browsers' Java virtual machines will "hang," requiring you to shut down and restart the browser. It is generally a good idea to restart your browser after a Java error.
When the error is in an ION applet, there is a chance that the connection to the ION Server is still active when you close your browser. In this case, your browser may not start again immediately; it will wait for the ION socket connection to time out before shutting down and allowing you to start the browser again.
On Unix systems, you can use the kill command to prematurely kill the browser process and close the socket connection. On Windows NT systems, use the "Processes" tab of the Task Manager dialog to end a browser process. If you do not manually kill the browser process, the socket connection will automatically time out in 60 seconds.
The ION Server may time out if you leave an applet unattended. You can change the amount of time the ION Server will wait before timing out. For more information, see Configuring ION Java.
Clients may encounter problems if they are using a pre-JDK 1.2 virtual machine. JDK 1.2, 1.3, or 1.4 is required for connections to ION Java 6.4. Users can check their browser configurations for information on which version they are using.
IDL Online Help (March 06, 2007)