Troubleshooting zero.core

Consult this documentation to troubleshoot problems starting and running an IBM® WebSphere® sMash application

How do I enable logging and tracing ?

IBM WebSphere sMash uses standard java.util.logging logging specifications. Tracing and Logging can be enabled in 2 ways.
  1. Specify -loglevel and -logfile as arguments on the command line. If there is a problem running any of the zero commands specify the -loglevel option on the command line.
    zero -loglevel=ALL
    This is equivalent adding .level=ALL in the logging.properties file.
    zero -loglevel:zero.core.config.level=ALL -loglevel:zero.core.context.level=ALL
    This is equivalent of adding the following lines in logging.properties.
    zero.core.config.level=ALL zero.core.context.level=ALL
    This option can be specified multiple times. Optional -logile can be set to redirect the log/traces in to the specified file rather than standard out.
  2. Place logging.properties file in application config directory If you need to debug an application that starts without a problem, copy logging.properties file from the WebSphere® sMash repository. Find this file at expanded/zero.kernel-1.0-${rev}/config/logging.properties in INSTALL_ROOT/zero-repository. Place additional trace specifications at the top of the file as shown in the previous section.

How can I verify incoming requests or outgoing responses ?

IBM WebSphere sMash runtime can log all request and response traffic including headers and the payload body to help debug application code. This can be done as follows.

  • Set the /config/requestLogging configuration attribute in the application's zero.config file to true.

    /config/requestLogging = true

    The WebSphere sMash runtime will write the request and response headers and, body, if any, to a log file named request-log-"timestamp" in the logs directory of the application. One log file will be written per request. Do not set this property to true in a production environment.

    The maximum amount of request and response data written to the file is configurable by changing the /config/requestLoggingLimit value to the maximum size of the log file. The default value of this configuration directive is 16384 bytes.

What do I do when I see "At least one request did not return before the stop/recycle timeout" in the logs

This means that the application could not be cleanly quiesced during a recycle because one or more requests did not complete processing. This timeout can be adjusted by specifying the time in seconds for the configuration property /config/maxStopTime. This value defaults to 60 seconds.

To help with identifying the requests that do not complete, you can set the configuration property /config/createDumpOnErrantRequest to true to generate a java thread dump of the process.

/config/createDumpOnErrantRequest=true

The request dump files are created in the application's root directory.

Known Issues

Application does not stop using the zero stop command

If you see the following error message while trying to stop an application
[ ~/MyApp1 ]zero stop CWPZC8134E: The attempt to reach another application stop URL failed: Application status is UNKNOWN CWPZT0601E: Error: Command stop failed, use -loglevel for more detail
It indicates that the name of the application directory MyApp1 does not match the name of the application. Find out the configured name of the application by checking the contents of MyApp1/config/ivy.xml. The name of the application is the 'module' attribute of the 'info' tag near the top of the file. For the application to work correctly :
  1. Rename the application directory to match the name of the application
  2. Delete .zero/shared/resolve.history and .zero/private/resolved.properties
  3. Run zero resolve in the new application directory
The problem is encountered when you create an application and copy it to another directory.
It is being tracked under Bug 5022 This issue is being tracked under Bug 5044

SEVERE: java.io.StreamCorruptedException in the error logs

If you see the following message in the error logs after a server recycle but the application otherwise works OK, this error can be safely ignored. Ensure that it says key=null.
2008-05-20 10:26:46 zero.core.context.zones.support.DefaultZoneHandlerImpl::getExternal Thread-11 SEVERE [ CWPZC0020E: Unable to load /app, key=null zone ] java.io.StreamCorruptedException: invalid stream header
This error only occurs in Java 1.5. It is being tracked under Bug 5070

UTF-8 JSON text file can not be parsed correctly

When a text (JSON) file is saved as UTF-8 format by using notepad editor, a byte of mark (BOM) tag will be inserted at the beginning of the file. However, Java does not support BOMs and this will cause the failure of JSON parser in WebSphere sMash. To avoid this situation, the BOM tag should be removed from the UTF-8 file by using editors such as gedit, etc.

Version 1.1.0.0.21442