Optimizeit Code Coverage Troubleshooting for Linux

By: Christopher Moeller

Abstract: Troubleshooting guide for Otimizeit on Linux

Troubleshooting

I cannot start the testing of my application from Optimizeit Code Coverage

  1. I cannot start Optimizeit Code Coverage. The CCoverage script fails with the error "Class not found: intuitive.optit.coverage.CodeCoverage"
  2. My application starts correctly, however an alert explaining that Optimizeit failed to attach is displayed
  3. My application ran successfully, however the Optimizeit Code Coverage is not working correctly. Most of the classes show 0% of coverage, mots of the buttons are disabled
  4. When starting my application, I get an alert reporting a Class not found
  5. When starting my applet, the console throws an error: "java.util.MissingResourceException: Can't find resource at java.util.ResourceBundle.getObject"
  6. The previous statements did not help. What should I do next?

I cannot start my application server with Optimizeit Code Coverage

  1. My application server no longer starts since I configured it with Optimizeit
  2. I cannot attach from the Optimizeit GUI? Which port should I use to attach?

  3. When I attach from the Optimizeit GUI no coverage information is displayed?

I have a problem during the testing session

  1. While testing my application, my application stops or crashes unexpectedly
  2. While testing my application, the application stops, the console shows a java.lang.OutOfMemoryError

Miscellaneous

  1. The Optimizeit GUI looks wrong. The text is clipped, the windows are the wrong size
  2. Why can't I test applets with my JRE?

I cannot start the testing of my application from Optimizeit Code Coverage

1. I cannot start Optimizeit Code Coverage. The CCoverage script fails with the error "Class not found: intuitive.optit.coverage.CodeCoverage"

If your DISPLAY environment variable is set to a display that does not exist, the CCoverage script fails with the message "Class not found: intuitive.optit.coverage.CodeCoverage". This message is sent by the virtual machine that Optimizeit uses and is bogus. Make sure to set your DISPLAY to a correct value.
For example on a machine named asterix, the DISPLAY is set with the command:
export DISPLAY=asterix:0


2. My application starts correctly, however an alert explaining that Optimizeit failed to attach is displayed.

Optimizeit uses a default connection time-out of 20 seconds to attach to the virtual machine.
In some environments, the Optimizeit audit system may require more than 20 seconds to initialize. If this happens, select "Preferences" from the edit menu, select the "Launch" section and increase the connection time-out value.

3. My application ran successfully, however the Optimizeit Code Coverage is not working correctly. Most of the classes show 0% of coverage, mots of the buttons are disabled.

Optimizeit Code Coverage Audit System runs inside the same virtual machine as the tested application. If the tested application ends, the virtual machine exits and Optimizeit loses contact with its Audit System and cannot retrieve coverage data (an alert saying "Test program exited" pops up in Optimizeit).
To resolve this problem, Optimizeit Code Coverage provides an option to disable the Java method System.exit(). This option can be enabled either by using the option VM cannot exit in the settings editor or by using the command line option "-noexit" (java ... intuitive.audit.Cover -noexit ...). That way the virtual machine will not exit when your application ends. Use the Stop button in Optimizeit Code Coverage to exit the program when your testing is complete.

4. When starting my application, I get an alert reporting a Class not found.

This error is very likely related to a CLASSPATH setting problem. Open the setting editor from the File/Settings menu, and make sure that the Class path section includes the paths to the packages and classes required by your application.

5. When starting my applet, the console throws an error: "java.util.MissingResourceException: Can't find resource at java.util.ResourceBundle.getObject".

Optimizeit starts your applet in the Sun applet viewer in order to test it. The applet viewer throws that error when the HTML file of your applet specifies the size of your applet in percent. Make sure that the HTML file you are using to start your applet uses hard values for the width and height.

6. The previous statements did not help. What should I do next?

The best way to investigate the cause of the problem is to start your application from the command line.
In the following <OptIt_Dir> is the directory where you installed Optimizeit (e. g. : /home/jay/OptimizeitSuite)
In order to do that:

  • open a command prompt
  • set your LD_LIBRARY_PATH to include the Optimizeit lib directory:

  • export LD_LIBRARY_PATH=<OptIt_Dir>/lib:$LD_LIBRARY_PATH
  • set your CLASSPATH to include the Optimizeit optit.jar package:

  • export CLASSPATH=<OptIt_Dir>/lib/optit.jar:$CLASSPATH
  • start your application with Optimizeit Code Coverage Audit System:
    • with Sun's JDK 1.2.x and JDK 1.3:

    • java -classic -Xruncci:'filters={patternList=(java.*,javax.*,sun.*)}' -Xbootclasspath/a:<OptIt_Dir>/lib/oibcp.jar -Djava.compiler=NONE intuitive.audit.Cover MyApplication
    • with Sun's JDK 1.3.1 and IBM's JDKs:

    • java -Xruncci:'filters={patternList=(java.*,javax.*,sun.*)}' -Xbootclasspath/a:<OptIt_Dir>/lib/oibcp.jar intuitive.audit.Cover MyApplication
       
    or if you are testing an applet:
    • with Sun's JDK 1.2.x and JDK 1.3:
      java -Xruncci:'filters={patternList=(java.*,javax.*,sun.*)}' -Xbootclasspath/a:<OptIt_Dir>/lib/oibcp.jar intuitive.audit.Cover  sun.applet.AppletViewer MyApplet.html
    • with Sun's JDK 1.3.1 and IBM's JDKs:
      java -Xruncci:'filters={patternList=(java.*,javax.*,sun.*)}' -Xbootclasspath/a:<OptIt_Dir>/lib/oibcp.jar intuitive.audit.Cover  sun.applet.AppletViewer MyApplet.html

For additional developer support options, please visit http://www.borland.com/devsupport


I cannot start my application server with Optimizeit Code Coverage

1. My application server no longer starts since I configured it with Optimizeit.

First, make sure to check the outputs and/or log files of your application server for any error message.
Here are the most common issues:
- you are using the JDK 1.2.x production release rather then the JDK 1.2.x reference implementation. Make sure to read the JDK 1.2 section for more information
- in your application server configuration, the LD_LIBRARY_PATH (or native library path) does not include the Optimizeit lib directory. When you configure an application server with Optimizeit and JDK 1.2, you add the parameter -Xruncci (or -Xrunoii for a generic integration with the other Optimizeit tools). When the virtual machine is started with this parameter, it loads the Optimizeit library libcci.so (or liboii.so if you used -Xrunoii). If it cannot find it in the LD_LIBRARY_PATH, the virtual machine fails to start. Make sure that the LD_LIBRARY_PATH, or the library path of your application server points to the Optimizeit lib directory.

2. I cannot attach from the Optimizeit GUI? Which port should I use to attach?
When I attach from the Optimizeit GUI no coverage information is displayed?

When you integrate Optimizeit with an application server, you start the Optimizeit audit system inside the virtual machine of the application server. By attaching the Optimizeit GUI to the audit system, you test the virtual machine of your application server and get the coverage information for your servlets/JSPs/EJBs. Optimizeit uses a port to get the coverage information from the audit system running in your application server. This port is only used by Optimizeit and is not related to any port of your application server. The default value for that port is 1472. If you start your application with Optimizeit from a script, the port is specified in the script.


I have a problem during the test session.

1.  While testing my application, my application stops or crashes unexpectedly

Take a look at the external console. It may give more information on what went wrong. If you do not have an external console, it means you have not selected the option "Open a console" in the settings editor. Make sure to select the option, and start the testing session again.

2. While testing my application, the application stops, the console shows a java.lang.OutOfMemoryError

The virtual machine ran out of memory. You can increase the size of the Java heap by using the extra Java parameters -ms -mx (JDK 1.1) or -Xms -Xmx (JDK 1.2 and 1.3). For example -Xms128m -Xmx128m sets the size of the Java heap to 128 Mb.
If you are starting the testing session from Optimizeit, add those parameters in the settings editor, in the field "Extra Java parameters".
If you are starting your application from the command line, add those parameters to the command line. The following command line starts for example the testing of BusyApp with the JDK 1.3.1, setting the size of the Java heap to 256 Mb:
java -Xruncci:'filters={patternList=(java.*,javax.*,sun.*)}' -Xbootclasspath/a:<OptIt_Dir>/lib/oibcp.jar -Xms256m -Xmx256m intuitive.audit.Cover BusyApp


Miscellaneous

1. The Optimizeit GUI looks wrong. The text is clipped, the windows are the wrong size.

Some X-servers, including Exceed, have problems with Swing applications. Fonts are too big, windows are the wrong size...
The best way to test remotely is to run the Optimizeit GUI locally. If you test remotely from your Windows platform on your Linux machine, make sure to use Optimizeit for Windows on the Windows platform.

Here are instructions on how to configure Exceed 7 to display the right fonts with Optimizeit:

  • Open the Exceed Xconfig window from the Windows Start menu, Hummingbird.../Exceed/Xconfig
  • Double click the Font icon to open the "Font Settings" window
  • Click the "Font Database..." button
  • Unselect the option "Automatic Font Substitution" then click OK
  • Restart Exceed

2. Why can't I test applets with my JRE?

When you test applets with JDK 1.2 or 1.3, Optimizeit runs your applet in the applet viewer using oldjava rather than java, in order to avoid security exceptions. JRE 1.2 and 1.3 do not include oldjava. This is why Optimizeit requires a JDK to test applets .
However you can still test applets with a JRE from Optimizeit by following these steps:
- edit the java.policy file of your JRE located under the lib/security directory of your jre
- at the end of the file include the following lines:
  grant codeBase "file:<OptIt_Dir>/lib/optit.jar" {
   permission java.security.AllPermission;
  };

  You should replace <OptIt_Dir> with the directory where you installed Optimizeit (for example: /home/jay/OptimizeitSuite).
- set the environment variable OI_APPLET_JRE to true

 


Copyright (c) 1997, 1998, 1999, 2000, 2001 Borland. All rights reserved. Specifications subject to change without notice.
Optimizeit is a trademark of Borland.
Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc.
All other brand names and products are trademarks or registered trademarks of their respective holders.


Server Response from: ETNASC03