Java Runtime Environment Display Issues on NVIDIA GeForce FX 5200

June 2, 2011

The Java Runtime Environment (often called JRE, J2RE, Java Standard Edition, or JSE) is a set of software which allows your Windows system to run Java programs alongside your regular applications or within your web browser. Java is a programming language and software platform. Java applications run inside of a virtual machine which translates the portable Java code to native code on the host operating system. More information is available here.

On Windows, you usually use the Oracle (previously Sun Microsystems) version of the Java runtime (downloads available here), older versions available here. Note that there is a Microsoft Java VM (also called the MSJVM, or Microsoft VM), but because of a lawsuit from Sun, Microsoft is no longer allowed to distribute it. It can be downloaded from here and will still install into modern Windows versions, but it is quite old and unmaintained. There is also an IBM JVM (also known as J9), however IBM requires that you license it, so it is really only used internally or made available for IBM branded systems.

I’m currently running the current release of the JRE: Java 6 Standard Edition Version 6 Update 25 (build 1.6.0_25-b06). The issue I’m experiencing has appeared in many older releases which I was running under 32-bit Windows 7.

Basically what happens is that Java applications fail to display some contents of windows or controls. The objects which fail to be drawn correctly are different across various Java applications (ie. one might fail to draw the contents of a text box, another may fail to draw in a button caption, a third may not have any problems at all). However, for each application the same thing will always fail to be drawn no matter how many times you run it again (ie. the first application will fail to draw text box content, and this will happen every time the application is run). The buggy control will function normally even though you cannot see it’s contents (ie typed text will still be in the edit field, blank buttons can still be clicked). In a few cases the window is not functional at all (parts of the Java control panel even do this sometimes).

At first I thought my system was running out of handles, but Task Manager was able to load correctly with all of it’s window contents. Under Task Manager I was able to confirm that the Java process wasn’t using any resources excessively or doing anything else out of the ordinary. When I started troubleshooting the issue, I tried many different JRE versions, web browsers, and even a completely different installations of Windows 7. I also tried changing various settings under the Java control panel with no success. There were also not many other users who were reporting the same problem on the net, so it’s most likely not an issue caused directly by the Java Runtime.

I found that it would usually draw the missing content if I would minimize the window to the taskbar and then restore it (by clicking it’s icon in the taskbar). It also works sometimes if you drag the window onto another screen. As soon as the control refreshes or updates itself, the content will disappear again. You can keep minimizing and restoring the window over and over again in so you can view and interact with the missing contents…this can quickly become very annoying though!

Because the graphical content of the window is visible when it’s restored, it appears to be a problem with the display driver and some hardware accelerated graphics routines which Java uses. I tried lowering the graphics acceleration slider under the advanced display properties, but it didn’t have any effect (even at the lowest level).

I have an NVIDIA GeForce FX 5200 and am running the most current Windows 7 compatible driver release provided by NVIDIA (from their support/download page) for that adapter: version (09/10/2006). The NVIDIA drivers and tools don’t provide many options which you can customize, I changed a few of the 3D options but none of them had any effect on the problematic Java applications.

The driver is old and will never be updated to fix this bug. From the sounds of their release notes, this version fixes many more significant problems in other programs, so downgrading to older versions of the drivers is probably a really bad idea. Java has used hardware accelerated drawing for a long time now, and you’d have to downgrade to a much older version which probably leaves you open to some nasty exploits. In the end it’s probably going to be easier to just replace the video adapter! The GeForce FX 5200 is old and was never a great video card anyway (I just use it because it was the cheapest AGP card I was capable of running Aero).

So for now the best solution is to use the minimize/restore trick for the Java applications that have problems, or replace the video card. If I have any more ideas or discover anything else, I’ll post it here!


Fixes for a Few Lotus Notes Issues

June 1, 2011

A few years ago, I was an IBM employee and was introduced to their incredibly complex and broken groupware solution known as Lotus Notes/Lotus Domino.

You have to understand that Lotus Notes and Domino are an excellent system for rapidly developing and sharing database applications across large networks. IMHO there was some point where IBM needed a groupware system for handling stuff like messaging, calendars, meetings, contact lists and so on. Storing this information in database files is the most efficient way (when done right) for storing and retrieving that kind of data (Microsoft Exchange and Outlook do this and are extremely fast). Since Lotus Notes/Domino was already a capable database system, they shoe-horned the groupware features onto it. The bolted on features do work but they have many issues. They have continued to bolt on features as newer things (like internet e-mail, instant messaging, and web sites) have become more relevant, resulting in a lot of additional complexity. Although it often appears to be a huge mess, it’s configuration is very flexible and deep down in it’s design there some very intelligent features.

Over the years I learned quite a few little tricks which are quite handy and can make Notes less frustrating when you have to use it daily.

“An Error Occurred While Opening a Windows” When Notes is Launched

This error usually occurs when Lotus Notes is terminated unexpectedly from a crash or the user ending it’s task when it’s locked up. I’ve also seen it appear when Notes Minder (nminder.exe) has been loaded before the Notes (notes.exe) application itself.

Lotus Notes uses quite a few different executables other than just ‘notes.exe’ which work together in the background. When some are still left open from an older session this and other errors can pop up. I suspect that it is because of an important shared DLL which all of the Notes executables use.

Simply open Task Manager and kill off the Notes background processes (ntaskldr.exe nlnotes.exe). If the error persists kill off any other Notes processes, or just reboot the workstation.

Lotus Notes Opens and Immediately Exists Without and Error

The Notes.ini file in the Lotus Notes program folder (usually “C:\Program Files\IBM\Lotus\Notes”) contains the bulk of the core Lotus Notes client configuration (most of the user configuration is stored in separate NSD files). You can open this file up in a text editor like notepad.exe and edit it.

If there are any invalid characters that appear in the file before the “[Notes]” section header, the Notes application will not read the configuration file and will fail to work. Usually Windows Notepad will display a bunch of black boxes to indicate that the character is not part of the regular ASCII range (which Notes expects). Remove any invalid characters you can see, or often it’s better just to delete all of the file contents at the beginning of the file, up to and including the “[Notes]” header, and then just re-type it so there is no way it is corrupt.

Clearing Notes.ini to Set Lotus Notes Back to it’s Original Configuration

The Notes.ini file in the Lotus Notes program folder (usually “C:\Program Files\IBM\Lotus\Notes”) contains the bulk of the core Lotus Notes client configuration (most of the user configuration is stored in separate NSD files). You can open this file up in a text editor like notepad.exe and delete all but the first three or four lines so that it reads:

Directory=C:\Program Files\IBM\Lotus\Notes\Data

The next time the Notes application is run, it will go through the initial  setup wizard and restore all of the deleted settings with fresh ones that will hopefully work properly. Note that user information like their mail, address book, workspace…even connection documents are all stored in separate NSD databases which are untouched and will be able to work again as soon as the wizard completes.

Create a New Connection Document Using the Server’s IP Address

If your connection documents are broken or if you notice that Lotus Notes is taking a long time searching for servers (by contacting other known servers) , you may have problems with corrupt connection documents.

It is easy to force Lotus Notes to create a new connection document. Bring up the open database dialog (CTRL-O) and paste the server’s IP address into the top (Look In) field. When you hit enter it will create a new set of correct connection documents for that server.

This also can work with servers that are connected to your Lotus Notes client via a passthru server. If the passthru is configured correctly, Notes can contact any of the other Domino servers behind the passthru and obtain the connection information for the server you want to create a connection document for.

Finding Missing Files Using “Add Documents” View

If you’re ever missing a file record that you know should be present in a database but you cannot see in the regular work views, you can always locate it under the “All Documents” view. If the file exists in the database it will appear under this view, you can view it’s properties to find the path if it’s been moved, or confirm if it’s not showing under the regular view (see the date issue below for an example). If it’s not there then it’s really been removed.

Improper Modification Dates on Databases (Future Date Issue)

Sometimes the dates on database files (especially e-mail boxes) become out of sync. When this happens, documents will not appear in the regular views because they have a delivery date which is in the future. They will become visible when the system date reaches the future date that Lotus Notes thinks is the present, however newer documents delivered in the present will continue to be delivered with a future date and will continue to be hidden.

You can spot it by checking the database properties. If it’s modification date is in the future, you have this problem. Database consistency checks (in the GUI or with nfixup.exe) will fail as a result of the bad dates.

I don’t recall the exact explanation of why this occurs, but it does happen in a few ways, and I remember it was often caused as a result of switching time zones under Windows, or from performing date adjustments while Lotus Notes is running. Lotus Notes probably maintains an internal time counter when it’s launched that goes out of sync with the actual system time.

Using NFIXUP.EXE to Perform Consistency Checks

Notes comes with a command line tool named NFIXUP.EXE in it’s program folder which can be used to manually perform consistency checks on database files. It requires the full path to the nsf file, and make sure Notes is closed before you use it.

Performing the check through the command line tools is much faster than checking the files in the Notes GUI, and it provides extra details about the problems fixed or any fatal errors. It sometimes has better success with fixing the files as well.

It should also be noted that templates and layouts are also regular database files, only with a different file extension, so they can be fixed with this tool as well.

Using NCOMPACT.EXE to Compact Databases

When you delete a record or series of items from a Notes database, it doesn’t actually remove the data or resize the database file. It most likely just marks the records or blocks as deleted in a bitmap. When it needs to copy new data into the database, it writes the new data into the blocks and space which were marked as deleted. This increases the performance of the database a lot because it doesn’t have to shift existing data blocks or resize the database file, it just fills the old blocks and updates a few pointers in an internal structure.

However, there may situations where the database file grows to a large size and remains that way, with only a small amount of it’s space actually being used for data. For example, your mail box may have a large number of messages and attachments which makes your mail file over 1GB in size. If you delete all of the messages and attachments, and only receive a couple of messages in the months afterward, you will still have a mail file over 1GB in size (even though it’s almost empty)! Compacting it will remove all of the extra blocks of space in the database which are empty and will never be used.

You can check the percentage of database space actually used against the database file size in the database properties, and compact it from here as well (if you have the permissions).

The command line tool NCOMPACT.EXE will also compact a provided database file, and is often faster at performing the operation from the command line (close Notes first).

Rebuilding Views and Indexes

Indexes speed up searching the database by and it’s beneficial to create one for all of your databases if you can. Indexes can become out-dated or corrupt causing problems. You can delete the old index (if corrupt or really old) and create a new one under the database properties.

Views also use their own indexes and these can also become corrupt and invalid. You can force them to be updated by pressing CTRL-SHIFT-F9.

Moving Records Between Databases With Cut and Paste

You can easily copy selected files/records or all of them into another database file using copy and paste. It is that easy! This is especially handy for doing manual archiving or backing up data from encrypted databases into other database files.

Corrupted Database Templates

This can be an issue when you are suddenly receiving strange errors related to variables or other Lotus Script elements while using the database layout, and it hadn’t been updated or reported the errors when used previously.

Replace the database template with a copy from server. Sometimes you may just have to use one of the generic ones that ships with Notes. Also remember to update the views again as well, since they may cause other errors after a template update/replace.