Runtime Errors
Except for few runtime errors (e.g. "missing license" and "unsatisfied link error") runtime errors are identified by exception messages produced by the Java virtual machine. They can be printed on the console or returned as a graphical message box depending on the error type and on
iscobol.exception.message setting.
The exception message is usually followed by a stack that lists all programs and paragraphs that are involved, from the one that produced the error to the first one that were executed. Compile with -g option to see references to the COBOL source into the stack, otherwise you’ll see references to the intermediate java source that were generated by the isCOBOL Compiler to produce the final class object. When “unknown source” appears in place of the source reference, it means that the corresponding Java program didn’t include debug information (it usually happens with isCOBOL internal objects, since the isCOBOL Framework is compiled without debug information).
This article examines the most common runtime errors, providing suggestions about how to address them.
Standard runtime errors
The errors listed below are produced by the runtime system. They can be reproduced running in stand-alone mode as well as running in thin client mode.
Missing license: The license key is missing, invalid or has expired!Check your properties files or contact Veryant or your distributor for technical support. |
This error is returned at startup if the license is not found or is expired. Contact your Veryant’s representative to obtain a valid license. Consult the chapter
Getting Started to know how to install the license correctly.
java.lang.NoClassDefFoundError or java.lang.ClassNotFoundException |
These errors mean that a java class was not found by the JVM. It can be returned at startup if the main program name has not been passed correctly in the command line (consider that Java is case-sensitive and the .class extension must be omitted) or if a typo caused Java to treat an option in the command line as if it was the program to launch.
java.lang.OutOfMemoryError: Java heap space |
This error means that the JVM ran out of memory. To avoid it, you must increase the memory limit by adding -Xmx256m Java option to the command line. 256 means 256 MB and it specifies the maximum amount of RAM that the JVM can allocate. If it’s not enough, try with higher values.
java.lang.OutOfMemoryError: Metaspace |
This error may occur with Java version 8 or higher and it means that the non-heap memory limit of the JVM has been reached. The non-heap memory is used to store class descriptions, so this error may appear when running huge applications. To avoid it, you must increase the non-heap memory limit by adding -XX:MaxMetaspaceSize=1g and -XX:CompressedClassSpaceSize=1g Java options to the command line. "1g" means 1 GB and it specifies the maximum amount of non-heap memory that the JVM can allocate. Compressed Class Space contains internal representation of Java classes, while Metaspace holds all the rest metadata: methods, constant pools, annotations, etc. If these values are not enough, try with higher values.
java.lang.OutOfMemoryError: PermGen space |
This error occurred with Java version 7 or lower and it means that the non-heap memory limit of the JVM has been reached. The non-heap memory is used to store class descriptions, so this error may appear when running huge applications. To avoid it, you must increase the non-heap memory limit by adding -XX:MaxPermSize=256m Java option to the command line. "256m" means 256 MB and it specifies the maximum amount of non-heap memory that the JVM can allocate. If it’s not enough, try with higher values.
java.lang.OutOfMemoryError: unable to create new native thread |
This type of OutOfMemoryError is generated when an application isn’t able to create new threads. This error can occur if there is no room in the memory to accommodate new threads or if the number of threads exceeds the operating system limit. In order to know what’s the maximum number of thread allowed by the host operating system, you can run the ISCHECK program installed with isCOBOL in the folder “sample/limit-tests”.
java.lang.UnsatisfiedLinkError: no ### in java.library.path |
This error means that the JVM failed to load a native library. The library name is traced in the error message. A typical case in which this error can appear is when iscobol.file.index is set to work with c-tree (e.g. iscobol.file.index=ctreej) and isCOBOL is not able to find the c-tree client library (ctree.dll on Windows and libctree.so on Unix). On Windows machines, native libraries are loaded from the paths listed in %PATH% environment variable. On Unix, they’re loaded from the paths listed in $LD_LIBRARY_PATH environment variable (be aware that the name could be different depending on the o.s.). To specify the library path in a cross-platform way, you can take advantage of the -Djava.library.path Java property (i.e. java -Djava.library.path=/home/isCOBOL2010/native/lib MAIN).
java.lang.UnsatisfiedLinkError: Native Library ### already loaded in another classloader |
This error is typical in servlet containers like Tomcat. It occurs if two web applications try to load the same dynamic link library. It can happen with COBOL applications using file handlers that have native dependences, like
DCI for example. In order to avoid it, consider a file connector solution if available. For example, with DCI you can use
The DCI File Connector.
java.lang.NullPointerException |
This error is returned when the JVM tries to use an object that is not available. In COBOL programs it usually refers to a data item. A typical case in which this error appears is when a called program tries to use a linkage item that was not passed by the caller.
java.lang.ArrayIndexOutOfBoundsException |
This error means that a Java array has been referenced out of its bounds. In COBOL programs it usually refers to an OCCURS data item that it referenced outside of its occurrences (i.e. consider having 77 data-item1 PIC X(10) OCCURS 10. and performing MOVE SPACES TO data-item1(11). ).
java.lang.reflect.InvocationTargetException |
This error is returned when a problem occurs during the invocation of a Java object. In isCOBOL it’s usually caused by missing libraries. Check the exception stack to retrieve more information on the cause.
error_description logical_filename (physical_filename)FS=[file_status],EXFS=[extended_status]: error_description |
This kind of error is returned when an I/O error occurs while working with a file and the program doesn’t contain DECLARATIVES for the file and
iscobol.file.errors_ok is set to 0.
Could not load the main class |
This error is usually returned by javaw.exe on Windows. It means that the class has been found but there were problems while running it, for example if the license is missing. Use java.exe to see a more complex error message that will help in diagnosing the problem.
Invalid isCOBOL rts version build #xxx or later required |
This error is returned by Database Bridge subroutines when they’re not compatible with the current runtime version.
The error message "Native call not found" means that the COBOL program has called a C language (native) function that has the same name as the native library (.dll or .so), but the function does not exist. If you get the error "Native call not found" and you do not mean to call a native library (i.e. you are trying to call a COBOL program) then there may be a DLL or shared object library with the same name as the COBOL program in the library search path.
Internal error: IIOP: Communication problem(s) [java.io.IOException: Cannot run program "program-name" |
This error is returned when
iscobol.file.index is set either to “dcic”, “fscsc”, “mfc” or "vfc" and the isCOBOL Framework cannot find the proper executable file. Ensure that the executable is in the system Path or set
iscobol.file.connector.program.* properties to indicate where it is.
Active window is modal : cannot change the active window |
This error is returned when the program tries to activate another window but the current window is modal (floating windows are modal by default) and the focus cannot be moved until the current window is closed.
Active window is modal : can't create a modeless child window |
This error is returned when the program tries to create and activate a modeless window (e.g. an independent window) but the current window is modal (floating windows are modal by default) and the focus cannot be moved until the current window is closed.
Accept executed on an invisible window: "window's title" |
This error is returned when the program tries to accept the user input on a window whose
Visible property is set to zero
Internal error: java.lang.IllegalArgumentException: ct_init ERROR 19:133:0 |
This error is returned when isCOBOL is not able to connect to the c-tree server. The two common causes are
• the c-tree server is down or unreachable, or
• the c-tree client library version doesn’t match with the c-tree server version.
CALL not found: C function system() |
This error is returned when you call either C$SYSTEM or SYSTEM routines having iscobol.system.exec=c in the configuration and the dyncall library (installed with isCOBOL) can’t be found in the Java library path. Only on Windows, the error can be returned also if msvcrt.dll can’t be found in the Java library path.
CALL not found: <program_name> |
This error is returned when a called subroutine cannot be found and the CALL statement doesn’t have a ON EXCEPTION|OVERFLOW clause. The same error is returned when a remote subroutine crashes and doesn’t return to the calling program.
Action in event procedure |
This error is returned when the ACTION property of a Grid or Tree-View is modified within MSG events handling (e.g. MODIFY screen1-gr-1 ACTION ACTION-ENTRY within the handling of the MSG-GOTO-CELL event). Such operation is not allowed by isCOBOL.
java.lang.StackOverflowError |
This error means that the thread stack area in the Java virtual machine was overloaded. To avoid it, increase the thread stack size using the Xss Java option. The error may also depend by an error in the COBOL code, like a program that calls itself recursively a infinite number of times.
Internal error: Concurrent access to <item_name> group-item |
This error is returned when two threads access the same group data item at the same time. In order to avoid it, you may consider to include the statements that access the group data item in a
SYNCHRONIZED block.
Unmatching DYNAMIC LENGTH items in LINKAGE SECTION |
This error is returned when a called program receives a GROUP-DYNAMIC parameter (e.g. a group that includes dynamic length items like X ANY LENGTH or OCCURS DYNAMIC) that doesn’t match with the parameter definition in the Linkage Section. The error message is followed by the name of the data item that caused the mismatch.
This error is returned when the program performs a MODIFY or an INQUIRE on a graphical control that doesn’t exist yet or has been destroyed. You can avoid this error by setting
iscobol.gui.ignore_invalid_handle (boolean) to true in the configuration; in this way MODIFY and INQUIRE statements on invalid handles will have no effect, but nobody will be advised about it.
Application Server (Thin Client) errors
The errors listed below can occur only in a thin client environment.
java.net.BindException: Address already in use |
This error is returned starting the ApplicationServer if the port on which it must listen for connections is already used by another process.
com.iscobol.rts.IscobolRuntimeException: License exceeded # |
This error is returned when a client connects to the Application Server but there are no more slots available because they have been used by other clients. You must wait for another client to disconnect before being able to connect to the Application Server, or you can upgrade the license in order to have more concurrent connections to the Application Server. See
Users count for information about concurrent client connections to the Application Server.
Max number of connections reached: (n) |
This error is returned when the isCOBOL Client connects to an Application Server in thin client environment but there are no more connection slots available. The number at the end of the message is the current connection limit. See
Connections count for information about user count in Application Server environment
Unable to connect to <ip>, port <port> |
This error is returned when the server can’t be reached by the client. The most common causes are:
• wrong IP or port specified
• different hostname values used on client and server command-lines. E.g. the server was started with -hostname 127.0.0.1 (server’s localhost address) and the client is launched with -hostname 192.168.1.1 (server’s IP address)
• the server is down
• the server port is blocked by a firewall.
Disconnected from <ip>, port <port> |
This error is returned when the connection to the server terminates unexpectedly, e.g. if a severe exception occurs server side. If you don't want to be notified, you can add the -nodisconnecterr option to the isCOBOL Client command line.
Session terminated by the Server |
This error is returned when the connection to the server is terminated by the administrator.
ERROR: Client release (n1) is incompatible with Application Server (n2) |
This error is returned when the isCOBOL Client connects to an Application Server in thin client environment, but the versions of the two products are not compatible. Update the isCOBOL installation in order to make these versions match.
com.iscobol.rmi.RemoteInvocationHandler$1: Call timed out. Current timeout=0 |
This error is returned when the program invokes a method of a Java-Bean passing an object reference among parameters and the client JVM is not compatible with the server JVM for the transmission of the object reference. In order to ensure that the cause of this error is actually the invocation of a Java-Bean method, check the exception stack and look for occurrences of “com.iscobol.gui.server.CobolGUIJavaBean.callMethod”. Use the same JVM version on both client and server side to get rid of this error.
com.iscobol.rts.IscobolRuntimeException: Internal error: Missing CLSID |
This error is returned when the program displays a JAVA-BEAN control without the CLSID property set. Unlike most runtime errors, this error is always displayed on the console, regardless if a graphical environment is available or not.
Unmatching DYNAMIC LENGTH items in LINKAGE SECTION: <source_item_name> dyn count=<source_count>; <dest_item_name> dyn count=<dest_count> |
This error is returned when a GROUP-DYNAMIC data item (a group item that includes dynamic length items or dynamic capacity tables) is exchanged between two programs and the definition in the caller program doesn’t match with the definition in the called program. In particular, the error is returned when the number of dynamic elements expected by the called program is greater than the number of dynamic elements passed by the caller program.