search cancel

util.bat fails with Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/logging/log4j/LogManager

book

Article ID: 244448

calendar_today

Updated On:

Products

CA Client Automation - IT Client Manager CA Client Automation

Issue/Introduction

CIC util.bat command is failing with error 
 
"Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/logging/log4j/LogManager"
 
Example :
 
C:\Program Files (x86)\CA\SC\CIC\bin>util -X "test"
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/logging/lo
g4j/LogManager
        at com.ca.sccc.CCBatchUtil.<clinit>(CCBatchUtil.java:1450)
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.LogManager

        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 1 more
Completed due to Shutdown (return code: 1)
See Util log file for details

Environment

CA Client Automation 14.5 CU2 and CU3

Cause

For security reasons (log4j vulnerabilities), since CU2 file C:\Program Files (x86)\CA\SC\CIC\lib\log4j-1.2.8.jar has been removed and replaced by these 2 files :
 
C:\Program Files (x86)\CA\SC\CIC\lib\log4j-api-2.17.1.jar
C:\Program Files (x86)\CA\SC\CIC\lib\log4j-core-2.17.1.jar
 
But file CIC\bin\util.bat was not updated and still using command line with deleted log4j file :

..\jre\bin\java -Xms16m -Xmx32m -cp %l%CACIC.jar;%l%commons-codec-1.3.jar;%l%commons-collections.jar;%l%commons-dbcp-1.2.2.jar;%l%commons-httpclient-3.0.jar;%l%commons-logging.jar;%l%commons-pool-1.1.jar;%l%concurrent.jar;%l%dom.jar;%l%iClient_Java.jar;%l%iClient_Java_NProxy.jar;%l%iTech.jar;%l%jaxp-api.jar;%l%log4j-1.2.8.jar;%l%CACICMPS.jar;%l%sqljdbc4.jar;%l%xercesImpl.jar;%l%ojdbc7.jar;%l%jsafeFIPS.jar com.ca.sccc.CCBatchUtil %Mode% %a2% %a3% %a4% %a5% %a6% %a7% %a8% %a9%

Resolution

- Download attached file util.bat.txt and rename it as util.bat
- On Domain Manager rename the file C:\Program Files (x86)\CA\SC\CIC\bin\util.bat as util.bat.ori
- Copy the new util.bat into C:\Program Files (x86)\CA\SC\CIC\bin

Additional Information

- In the new util.bat, java command line has been updated to use the 2 new log4j jar file

..\jre\bin\java -Xms16m -Xmx32m -cp %l%CACIC.jar;%l%commons-codec-1.3.jar;%l%commons-collections.jar;%l%commons-dbcp-1.2.2.jar;%l%commons-httpclient-3.0.jar;%l%commons-logging.jar;%l%commons-pool-1.1.jar;%l%concurrent.jar;%l%dom.jar;%l%iClient_Java.jar;%l%iClient_Java_NProxy.jar;%l%iTech.jar;%l%jaxp-api.jar;%l%log4j-api-2.17.1.jar;%l%log4j-core-2.17.1.jar;%l%CACICMPS.jar;%l%sqljdbc4.jar;%l%xercesImpl.jar;%l%ojdbc7.jar;%l%jsafeFIPS.jar com.ca.sccc.CCBatchUtil %Mode% %a2% %a3% %a4% %a5% %a6% %a7% %a8% %a9%

 

- This correction will be included in new CU4

Attachments

1655913913220__Util.bat.txt get_app