Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
daniele_uboldi
Contributor
Contributor

Apache Karaf and APM agent

Hi everybody!

I'm trying to monitor the apache karaf container used under Talend Open Studio for ESB (v 7.2.1).

I've configured the ELK APM server in the right way and it is reacheable by Kibana, nevertheless I've some problems configuring the APM agent, in particular, attaching it to the .jar process of the karaf.

I've tried both with the main karaf jar file (org.apache.karaf.main-4.2.4) located under /container/lib/boot/ folder and with the wrapper installed within the karaf itself, which .jar file is located under /container/lib/wrapper (karaf-wrapper).

Is there a way to configure the agent correctly?

I'm always getting the same error reported below:

>> 1 PS C:\talend\TOS_ESB-20190620_1446-V7.2.1\Runtime_ESBSE\container\lib\wrapper> java -javaagent:C:\Users\daniele.uboldi\Downloads\jar\agents\elk\elastic-apm-agent-1.18.1.jar -Delastic.apm.service_name=Main -Delastic.apm.server_url=http://localhost:8020 -Delastic.apm.secret_token= -Delastic.apm.application_packages=org.apache.karaf.wrapper -jar karaf-wrapper-main.jar

>> 2 2020-11-02 11:18:27,899 [main] INFO co.elastic.apm.agent.util.JmxUtils - Found JVM-specific OperatingSystemMXBean interface: com.sun.management.OperatingSystemMXBean

>> 3 2020-11-02 11:18:27,910 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - Starting Elastic APM 1.18.1 as karaf-wrapper-main on Java 1.8.0_251 Runtime version: 1.8.0_251- b08 VM version: 25.251-b08 (Oracle Corporation) Windows 10 10.0

>> 4 2020-11-02 11:18:27,915 [main] WARN co.elastic.apm.agent.configuration.StartupInfo - To enable all features and decrease startup time, please configure application_packages

>> 5 2020-11-02 11:18:29,848 [elastic-apm-server-healthcheck] INFO co.elastic.apm.agent.report.ApmServerHealthChecker - Elastic APM server is available: { "build_date": "2020-10-16T08:02:43Z", "build_sha": "af7b123f289d79c34c9da11471803f457eafa5c0", "version": "7.9.3"}

>> 6 2020-11-02 11:18:30,033 [main] INFO co.elastic.apm.agent.impl.ElasticApmTracer - Tracer switched to RUNNING state

>> 7 Errore: impossibile trovare o caricare la classe principale .apm.service_name=Main

>> 8 2020-11-02 11:18:30,053 [elastic-apm-init-instrumentation-shutdown-hook] INFO co.elastic.apm.agent.impl.ElasticApmTracer - Tracer switched to STOPPED state

For those who are not italian, line 7 is:

>> Error: unable to find or load the main class .apm.service-name=Main

I solved this problem adding all the properties for the elastic apm to a .properties file and now I'm gettina different error like this one:

>> PS C:\talend\TOS_ESB-20190620_1446-V7.2.1\Runtime_ESBSE\container\lib\boot> java -javaagent:C:\Users\daniele.uboldi\Downloads\jar\agents\elk\elastic-apm-agent-1.18.1.jar -jar org.apache.karaf.main-4.2.4.jar

>> 2020-11-03 09:58:30,118 [main] INFO co.elastic.apm.agent.util.JmxUtils - Found JVM-specific OperatingSystemMXBean interface: com.sun.management.OperatingSystemMXBean

>> 2020-11-03 09:58:30,130 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - Starting Elastic APM 1.18.1 as karaf-monitoring on Java 1.8.0_251 Runtime version: 1.8.0_251-b08 VM version: 25.251-b08 (Oracle Corporation) Windows 10 10.0

>> 2020-11-03 09:58:32,241 [main] INFO co.elastic.apm.agent.impl.ElasticApmTracer - Tracer switched to RUNNING state

Error: A JNI error has occurred, please check your installation and try again

Exception in thread "main" java.lang.NoClassDefFoundError: org/osgi/framework/BundleException

at java.lang.Class.getDeclaredMethods0(Native Method)

at java.lang.Class.privateGetDeclaredMethods(Unknown Source)

at java.lang.Class.privateGetMethodRecursive(Unknown Source)

at java.lang.Class.getMethod0(Unknown Source)

at java.lang.Class.getMethod(Unknown Source)

at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)

at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

Caused by: java.lang.ClassNotFoundException: org.osgi.framework.BundleException

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

... 7 more

>> 2020-11-03 09:58:32,268 [elastic-apm-init-instrumentation-shutdown-hook] INFO co.elastic.apm.agent.impl.ElasticApmTracer - Tracer switched to STOPPED state

Labels (2)
0 Replies