CA7 RestApi upgrade Java to version 17
search cancel

CA7 RestApi upgrade Java to version 17

book

Article ID: 385386

calendar_today

Updated On:

Products

CA 7 Workload Automation

Issue/Introduction

Currently running on 7Restservices.12.1.06/apache-tomcat-9.0.91 and wanting to upgrade JAVA to version 17. What changes should be made within the configuration of the REST API to account for JAVA 17?

Resolution

You'll need all the java opts for java. In the Tomcat bin directory, there is a script, called setenv.sh change the content of the script to the text below and restart.

#
#
# Copyright (c) 2024. Broadcom.  All rights reserved.
#
# This software and all information contained therein is confidential and
# proprietary and shall not be duplicated, used, disclosed or disseminated
# in any way except as authorized by the applicable license agreement,
# without the express written permission of BROADCOM. All authorized reproductions
# must be marked with this language.
#
# EXCEPT AS SET FORTH IN THE APPLICABLE LICENSE AGREEMENT, TO THE EXTENT
# PERMITTED BY APPLICABLE LAW, BROADCOM PROVIDES THIS SOFTWARE WITHOUT
# WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION, ANY IMPLIED
# WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  IN
# NO EVENT WILL BROADCOM BE LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY
# LOSS OR DAMAGE, DIRECT OR INDIRECT, FROM THE USE OF THIS SOFTWARE,
# INCLUDING WITHOUT LIMITATION, LOST PROFITS, BUSINESS INTERRUPTION,
# GOODWILL, OR LOST DATA, EVEN IF CA IS EXPRESSLY ADVISED OF SUCH LOSS OR
# DAMAGE.
#
# The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
#
#

export logging_config=file:$CATALINA_HOME/ca7services_config/logback.xml
export SPRING_CONFIG_LOCATION=classpath:/application.yml,file:$CATALINA_HOME/ca7services_config/application.yml
export JAVA_OPTS="$JAVA_OPTS \
  -Dfile.encoding=UTF8 -Xms128m -Xmx1024m -XX:MaxPermSize=256m \
  --add-opens=java.base/jdk.internal.access=ALL-UNNAMED \
  --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED \
  --add-opens=java.base/sun.nio.ch=ALL-UNNAMED \
  --add-opens=java.base/sun.util.calendar=ALL-UNNAMED \
  --add-opens=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \
  --add-opens=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \
  --add-opens=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \
  --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED \
  --add-opens=java.base/java.io=ALL-UNNAMED \
  --add-opens=java.base/java.nio=ALL-UNNAMED \
  --add-opens=java.base/java.net=ALL-UNNAMED \
  --add-opens=java.base/java.util=ALL-UNNAMED \
  --add-opens=java.base/java.util.concurrent=ALL-UNNAMED \
  --add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED \
  --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED \
  --add-opens=java.base/java.lang=ALL-UNNAMED \
  --add-opens=java.base/java.lang.invoke=ALL-UNNAMED \
  --add-opens=java.base/java.math=ALL-UNNAMED \
  --add-opens=java.sql/java.sql=ALL-UNNAMED \
  --add-opens=java.base/java.lang.reflect=ALL-UNNAMED \
  --add-opens=java.base/java.time=ALL-UNNAMED \
  --add-opens=java.base/java.text=ALL-UNNAMED \
  --add-opens=java.management/sun.management=ALL-UNNAMED \
  --add-opens=java.desktop/java.awt.font=ALL-UNNAMED \
  -server"
export CATALINA_PID=/$CATALINA_HOME/bin/pid.txt
echo "SPRING_CONFIG_LOCATION:$SPRING_CONFIG_LOCATION"
echo "JAVA_OPTS:$JAVA_OPTS"
echo "logging_config:$logging_config"

 

Additional Information

Note: You may see the following message within the Catalina log 

SEVERE [main] org.apache.catalina.util.LifecycleBase.handleSubClassException Failed to initialize component [Connector....]

Caused by: java.lang.IllegalArgumentException: unknown protocol: safkeyring
Caused by: java.net.MalformedURLException: unknown protocol: safkeyring

For Java 11/17, update server.xml ssl connector - use safkeyringjce 

Update the server.xml file with the following
Find the "<Connector SSLEnabled" line                 
Change "safkeyring" to "safkeyringjce"                
Change the algorithm="IbmX509" to algorithm="SunX509"

Recycle Tomcat after the change.