Internet Explorer status barThe 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 value=NotThere.cab></applet></BODY></HTML>
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 logFor 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: NotThere.cab due to: java.io.FileNotFoundException: \D:\samples\Troubleshoot\NotThere.cabjava.lang.ClassNotFoundException: DoesntExistat com/ms/vm/loader/URLClassLoader.loadClass (URLClassLoader.java)at com/ms/vm/loader/URLClassLoader.loadClass (URLClassLoader.java)at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)at com/ms/applet/AppletPanel.run (AppletPanel.java)at java/lang/Thread.run (Thread.java)
Code Download Log ViewerWhen 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.
- 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 value=NotThere.cab> <param name=useslibraryversion value="1,0,0,1"></applet></BODY></HTML>
- 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.
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/NotThere.cab CLSID: NoSuchDU Extension: (null) Type: (null)LOG: Reporting Code Download Completion: (hr:8007007e, CLASSID: 0..., szCODE:(file:///D:/samples/Troubleshoot/NotThere.cab), MainType:(null), MainExt:(null))--- Detailed Error Log Follows ---LOG: URL Download Complete: hrStatus:800c0005, hrOSB:0, hrResponseHdr:0, URL:(file://D:\samples\Troubleshoot\NotThere.cab)LOG: URL Download Complete: hrStatus:800c0005, hrOSB:0, hrResponseHdr:0, URL:(http://activex.microsoft.com/objects/ocget.dll)LOG: Reporting Code Download Completion: (hr:8007007e, CLASSID: 0..., szCODE:(file:///D:/samples/Troubleshoot/NotThere.cab), 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 NotThere.cab.
Another way to view the Code Download LogYou can also view the code download log without the aid of the Code Download Log Viewer:
- Use Windows Explorer to open the "Temporary Internet Files" folder in your Windows (or \WINNT) directory.
- 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".
- 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 packagesThere 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 filesMany 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:
- 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.
- 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.
- Click OK.
- 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.
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:
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:
"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:
Specific references on MSDN Web Workshop:
Internet component download http://msdn.microsoft.com/library/default.asp?url=/workshop/delivery/download/download_node_entry.asp