Error starting Analytics Backend | Could not find or load main class
search cancel

Error starting Analytics Backend | Could not find or load main class

book

Article ID: 261923

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine CA Automic One Automation

Issue/Introduction

I am installing Analytics Backend for V21.0.5, but when I try to start it I get the following Java error:

> java -version
openjdk version "11.0.17" 2022-10-18 LTS
OpenJDK Runtime Environment (Red_Hat-11.0.17.0.8-2.el8_6) (build 11.0.17+8-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-11.0.17.0.8-2.el8_6) (build 11.0.17+8-LTS, mixed mode, sharing)
> cd <Automic>/Analytics/backend
> java -Xmx2g -Xms512m -XX:+UseG1GC -jar analytics-backend.jar
Error: Could not find or load main class com.automic.analytics.backend.Agent
Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContextAware

Can you suggest why this error occurs, please?

Environment

Release : 21.0.5

Cause

The IA agent log (ia_log_xx.txt) only shows that a trace is generated:

20230313/084519.288 - U00003620 Routine 'UCEX_R' forces trace because of error.
20230313/084519.312 - U02000048 TRACE file opened with flags '0000000000000001', max.trace: '9', memory trace: '0', search type: 'S', search string: ''.
20230313/084519.359 - U00003449 Output to the TRACE file is finished.

But the trace file shows the problem: 

20230313/084519.324 - 1      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flyway' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.flywaydb.core.Flyway]: Factory method 'flyway' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ds_analytics' defined in class path resource [com/automic/analytics/backend/config/datasource/DataSourceConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'analyticsDataSource' threw exception; nested exception is java.lang.IllegalArgumentException: URL must start with 'jdbc'

Resolution

Either of the 2 main data sources parameters is not well defined in the file application.properties and misses the prefix 'jdbc':

datasource.analytics.url=jdbc:postgresql://<analytics_postgres_server>:5434/analytics

or

datasource.ae.url=jdbc:<db_type>://<ae_db_server>:<port>/<DB_NAME>