How to troubleshoot Java applet and component download problems


When an error occurs while downloading and executing or installing Java code using Microsoft Internet Explorer, it may at first be difficult to determine exactly what error occurred and why. This article describes several tools and techniques for getting more information about why an applet or Java-based ActiveX control failed to download, failed to install, or failed to execute.


Internet Explorer status bar

The first potential source of information in the event of a code download problem is in the status bar of Internet Explorer itself. If there is an object in the document window that indicates a problem, such as a gray box where an applet should be, positioning the cursor over that box causes Internet Explorer to show any error information it has in the left portion of the status bar.

To see this, create an HTML file containing the following HTML code:
<HTML><HEAD></HEAD><BODY><applet code=DoesntExist.class name=DoesntExist        width=320 height=240>        <param name=cabbase></applet></BODY></HTML>
Open this page in Internet Explorer and make sure that the status bar is showing. Check the "Status Bar" item in the View menu if necessary. At first, the status bar may simply display the word "Done," or it may display no message at all, though the applet appears as an empty gray box. If you move the mouse so that the cursor is positioned over the applet, the status bar displays the following message:
"load: class DoesntExist not found"

This technique is useful for any error involving a Java applet, whether it uses code download techniques or not. For long messages, maximizing the browser window provides more space in the status bar and allows you to see more of the message. However, the information in the status bar is limited to a single line.

Java Console or output log

For applets, the Microsoft Virtual Machine (Microsoft VM) also prints error information to a file, or to the Java Console. The file is Javalog.txt in the windows\java or winnt\java directory. Both the Java output log file and the Java Console can be enabled in the Advanced tab of the Internet Options dialog.

If you have enabled Java logging or the console and you open the HTML file created for the previous example, you will see a more detailed description of the error:
Skipping CAB:  due to: \D:\samples\Troubleshoot\NotThere.cabjava.lang.ClassNotFoundException: DoesntExistat com/ms/vm/loader/URLClassLoader.loadClass ( com/ms/vm/loader/URLClassLoader.loadClass ( com/ms/applet/AppletPanel.processSentEvent ( com/ms/applet/AppletPanel.processSentEvent ( com/ms/applet/ ( java/lang/ (
This error includes a Java exception and call stack, and is often more useful than the message from the status bar for determining the cause of an error and finding a solution. In this case, there is one exception indicating that the Microsoft VM could not locate the file The ClassNotFoundException indicates that the Microsoft VM could not locate DoesntExist.class. Correcting an earlier exception will often correct exceptions that follow.

Code Download Log Viewer

When using a CAB file to download Java classes or ActiveX controls and install them on the client computer, Internet Explorer also generates error log information for the code download process. This information may not be immediately visible, but you can view it using a tool called the Code Download Log Viewer.
Note: if nothing, not even a gray box, appears where there should be an applet, that frequently indicates that an error occurred while trying to install classes into the Java Package Manager. If you see this symptom, the code download log is the first place to look for information.
For a description of how to package Java classes so that the Java classes will be installed in the Java Package Manager on a client computer refer to the Microsoft Knowledge Base article:

193877 How to make your Java code trusted in Internet Explorer

To download the Code Download Log Viewer, visit the following Microsoft Developer Network (MSDN) Web site:
To see how this works, follow these steps:
  1. Create an HTML file with the following HTML code:
    <HTML><HEAD></HEAD><BODY><applet code=DoesntExist.class name=DoesntExist        width=320 height=240>        <param name=useslibrary value=NoSuchDU>        <param name=useslibrarycodebase>        <param name=useslibraryversion value="1,0,0,1"></applet></BODY></HTML>
  2. Open this HTML file with Internet Explorer. You may observe that there is nothing where the applet should be, not even a gray box, and that there is no error information either in the status bar or in the Java Console or Java output log. This often happens when an error occurs while trying to use a Distribution Unit via the "useslibrary" PARAM tags.
Please see the "References" section for more information about creating and using Distribution Units with Java applets.

In this case, the code download log displays something like this:
*** Code Download Log entry (05 Sep 1999 @ 21:57:28) ***Code Download Error: (hr = 8007007e) The specified module could not be found.Operation failed. Detailed Information:     CodeBase: file:///D:/samples/Troubleshoot/     CLSID: NoSuchDU     Extension: (null)     Type: (null)LOG: Reporting Code Download Completion: (hr:8007007e, CLASSID: 0..., szCODE:(file:///D:/samples/Troubleshoot/, MainType:(null), MainExt:(null))--- Detailed Error Log Follows ---LOG: URL Download Complete: hrStatus:800c0005, hrOSB:0, hrResponseHdr:0, URL:(file://D:\samples\Troubleshoot\ URL Download Complete: hrStatus:800c0005, hrOSB:0, hrResponseHdr:0, URL:( Reporting Code Download Completion: (hr:8007007e, CLASSID: 0..., szCODE:(file:///D:/samples/Troubleshoot/, MainType:(null), MainExt:(null))

The first line of the "Detailed Error Log" with a non-zero hrStatus indicates the first error that occurred. In this case, it shows that the "module" that "could not be found" is

Another way to view the Code Download Log

You can also view the code download log without the aid of the Code Download Log Viewer:
  1. Use Windows Explorer to open the "Temporary Internet Files" folder in your Windows (or \WINNT) directory.
  2. Look for a file in that folder with a name that begins with "?CodeDownloadErrorLog", and drag it to another location, such as your desktop.
    There may be many files with similar names, depending on how much code downloading you've been doing. To tell the files apart, widen the "name" column in Windows Explorer and look at the whole name. The HTML file in this example creates an entry names "?CodeDownloadErrorLog!name=NoSuchDU".
  3. Once you have copied the code download log to a regular file folder, you open it using Internet Explorer.

Using JPMView to examine installed Java packages

There is a utility, provided as an on-line sample for Visual J++, which allows you to explore the contents of the Java Package Manager, for example to verify that the Java packages you intended to download and install were actually installed on the client computer.

To download the Microsoft Package Manager Explorer, visit the following MSDN Web site:

Using WinFile to examine downloaded program files

Many downloaded items are stored in the Downloaded Program Files folder in your Windows directory. With Internet Explorer 4.0 or later installed, Windows Explorer shows a view of the downloaded objects when you view this folder instead of showing the files in the directory. If you need to view the actual files in the Downloaded Program Files directory, you can do so with the File Manager in Windows 95, Windows 98 and Windows NT 4:
  1. From the Windows Start menu, choose Run, type in the name Winfile as the file to open, and click OK. This will start the File Manager.
  2. From the View menu, choose By File Type, and make sure that the check box at the bottom, labeled Show Hidden/System Files is selected. If this check box is selected, the File Manager will display the Downloaded Program Files directory.
  3. Click OK.
  4. Go to the Windows directory (for Windows 95 and Windows 98) or the WINNT directory (for Windows NT). Open the directory named "Downloaded Program Files" (on Windows NT) or "downlo~1" (for Windows 95 or 98). You will see a list of the files that have been installed on your computer through Internet Explorer, and the OSD files and .inf files used to keep track of them.
IMPORTANT: It is recommended that you only view these files with the File Manager. If you need to remove any of them, use Windows Explorer to view the Downloaded Program Files folder, right-click on the appropriate downloaded object, and select Remove.

Using CABARC to check the contents of a CAB file.

The CABARC utility included in the Microsoft .NET Framework SDK is used to create CAB files. It can also be used to examine CAB files.

cabarc l filename.cabprints a listing of the files contained in a CAB file. It will also prints the path within the CAB to each file, and it prints all names with the same upper/lower case characters they have in the CAB file.
cabarc x *.osdextracts the .osd file from a Distribution Unit. You can then view the .osd file with a text editor to compare the package names, name of the DU, version, and so forth with the values used in the applet tag that downloads the DU.

Using ChkTrust to check digital signatures.

ChkTrust is a code signing tool that is included in the Microsoft SDK for Java, and documented there. You can use ChkTrust to confirm that a CAB file has been signed with as intended, and that the client-side code that checks digital signatures is operating correctly.

ChkTrust.exe verifies the digital signature of a CAB file.
For more information, visit the following Microsoft Web site:You use ChkTrust by typing the following command at a command prompt:
ChkTrust performs a check of the digital signature, and displays either the same security dialog box that is displayed to a user when the code is downloaded or an error dialog box. When you click Yes, No, or OK, ChkTrust prints the results of the signature check.

Sometimes this tool will skip the security dialog box and just print the results. One common cause for this is that the digital signature is "always trusted." You can confirm this and correct it if necessary in the security settings of Internet Explorer.

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

168941 Frequently asked questions about CAB Files


For additional iInformation about using CAB files to download Java code, visit the following Microsoft SDK for Java Web site:Specific references are

"Packaging and Distributing Software" in the Programmer's Guide and "Software Distribution Tools" in the Tools Reference.

Other useful Knowledge Base articles and a list of articles referenced above:

168941 Frequently asked questions about CAB Files

173469 How to enable the Javalog.txt file

175622 PRB: SecurityExceptionEx exception running a Java applet

193877 How to make your Java code trusted in Internet Explorer

For more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:

Specific references on MSDN Web Workshop:

For support information about Visual J++ and the SDK for Java, visit the following Microsoft Web site: