COBOL2JAVA jobs Abort -  java.lang.ExceptionInInitializerError
search cancel

COBOL2JAVA jobs Abort -  java.lang.ExceptionInInitializerError

book

Article ID: 268225

calendar_today

Updated On:

Products

CA Automic Applications Manager (AM)

Issue/Introduction

COBOL2JAVA jobs like GLBDATAJ RPEPELLJ  RPEDISBJ do not run-  Exception in thread "main" java.lang.ExceptionInInitializerError.

The error may appear in the App Mgr output file (ie. o123.00) or in other job files, such as rpedisbj_4444.clg

Picked up JAVA_TOOL_OPTIONS:  -Dlog4j1.compatibility=true
Exception in thread "main" java.lang.ExceptionInInitializerError
 at java.base/java.lang.Class.forName0(Native Method)
 at java.base/java.lang.Class.forName(Class.java:315)
 at com.sct.messaging.bif.banner.BannerBatchProcessor.main(BannerBatchProcessor.java:160)
Caused by: java.lang.UnsupportedOperationException: No class provided, and an appropriate one cannot be found.
 at org.apache.logging.log4j.LogManager.callerClass(LogManager.java:573)
 at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:598)
 at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:585)
 at net.hedtech.common.EllucianBaseBatchProcessor.<clinit>(EllucianBaseBatchProcessor.java:13)
 ... 3 more

Environment

Release : 9.4.x

Cause

If Applications Manager (ie Automic) is using OpenJDK 11, these errors may occur.  At this time Banner job submission supports Java 8, not Java 11. 

Resolution

Prior to running the Banner job, set JAVA_HOME to match the Java being used by job submission - gurjobs. 

In this example, java 8 is in this directory - /etc/alternatives/java_sdk_1.8.0_openjdk

You can set JAVA_HOME in one of two places - either in

1.  Banner Agent environment file (ie. $AW_HOME/Banner/TEST/TESTenv.sh )

Add the following lines to the bottom of the file

# New cobol2java jobs not working with openjdk11 so setting java_home to match Banner java_home
JAVA_HOME=/etc/alternatives/java_sdk_1.8.0_openjdk; export JAVA_HOME

**Stop and restart the Banner Agent in order to pick up this change.  From the Explorer Window - Agent Summary - Right click on the Banner Agent - Stop.  Once stopped, then right click again - Start

OR

2.  Edit Banner's $BANNER_HOME/general/misc/banjavaenv.shl (Linux) or %BANNER_HOME%\general\misc\banjavaenv.pm (Windows)

Linux:

- Connect to the server as the 'banner' user
- Edit $BANNER_HOME/general/misc/banjavaenv.shl
- Find these lines

  JAVA_HOME=$JAVA_HOME
  export JAVA_HOME

and edit similar to this, pointing to your java 8 home

#  JAVA_HOME=$JAVA_HOME
# New cobol2java jobs not working with openjdk11 so setting java_home to match Banner java_home
  JAVA_HOME=/etc/alternatives/java_sdk_1.8.0_openjdk
  export JAVA_HOME

 

Windows:  

Edit %BANNER_HOME%/general/misc/banjavaenv.pm

Find the line:

$ENV{'JAVA_TOOL_OPTIONS'}=$java_tool_options;

Add these additional lines to include your Java 1.8.x path

$ENV{'JAVA_TOOL_OPTIONS'}=$java_tool_options;
$java_home="C:\\Program Files\\Java\\jdk1.8.0_321";
$ENV{'JAVA_HOME'}= $java_home;
$path="$java_home\\bin;
$ENV{'PATH'}";
$ENV{'PATH'}= $path;