# APM Agent - Error: Could not find or load main class

**URL:** <https://discuss.elastic.co/t/apm-agent-error-could-not-find-or-load-main-class/251648>\
**Category:** APM\
**Tags:** elastic-stack-monitoring, java\
**Created:** [October 10, 2020, 2:43pm UTC](https://discuss.elastic.co/t/apm-agent-error-could-not-find-or-load-main-class/251648 "2020-10-10T14:43:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MfuentesG](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@MfuentesG](https://discuss.elastic.co/u/MfuentesG)\
**Post date:** [October 10, 2020, 2:43pm UTC](https://discuss.elastic.co/t/apm-agent-error-could-not-find-or-load-main-class/251648/1 "2020-10-10T14:43:14Z")

</div>

Good morning,  
Could someone please help me with this configuration.

WAS: 8.5.5.11  
Java SDK: 8.0.6.15  
APM Agent: 1.18.1  
Jar File: elastic-apm-agent-1.18.1.jar  
SO: RHEL7.9 - 64bits

Java server:  
[root@wasdev ~]# **java -version**  
openjdk version "1.8.0\_265"  
OpenJDK Runtime Environment (build 1.8.0\_265-b01)  
OpenJDK 64-Bit Server VM (build 25.265-b01, mixed mode)

Java WAS:  
[root@wasdev bin]# /opt/IBM/WebSphere/AppServer/java\_1.8\_64/jre/bin/java -version  
java version "1.8.0\_261"  
Java(TM) SE Runtime Environment (build 8.0.6.15 - pxa6480sr6fp15ifix-20200820\_01(SR6 FP15+IJ26443))  
IBM J9 VM (build 2.9, JRE 1.8.0 Linux amd64-64-Bit Compressed References 20200729\_452626 (JIT enabled, AOT enabled)  
OpenJ9 - 43296bc  
OMR - 08b0594  
IBM - 70917a2)  
JCL - 20200720\_01 based on Oracle jdk8u261-b13

[root@wasdev bin]# **jps -lv**  
3236 sun.tools.jps.Jps -Dapplication.home=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.265.b01-1.el7\_9.x86\_64 -Xms8m

Generic JVM arguments:  
-javaagent:/opt/AgentAPMElastic/elastic-apm-agent-1.18.1.jar   
-Delastic.apm.service\_name=BankIntbancapersonas   
-Delastic.apm.server\_urls=http://192.168.0.8:8200   
-Delastic.apm.application\_packages=org.bi,org.bankinternational

WAS native\_stderr.log:  
\*_Error: Could not find or load main class \*_  
ERROR IndyBootstrap null  
java.nio.channels.ClosedByInterruptException  
at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:220)  
at sun.nio.ch.FileChannelImpl.size(FileChannelImpl.java:327)  
at com.sun.nio.zipfs.ZipFileSystem.findEND(ZipFileSystem.java:975)  
at com.sun.nio.zipfs.ZipFileSystem.initCEN(ZipFileSystem.java:1042)  
at com.sun.nio.zipfs.ZipFileSystem.(ZipFileSystem.java:142)  
at com.sun.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemPr

WAS native\_stdout.log:  
Listening for transport dt\_socket at address: 7779  
2020-10-10 11:39:00,493 [main] INFO co.elastic.apm.agent.util.JmxUtils - Found JVM-specific OperatingSystemMXBean interface: com.ibm.lang.management.OperatingSystemMXBean  
2020-10-10 11:39:00,781 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - Starting Elastic APM 1.18.1 as - on Java 1.8.0\_261 Runtime version: 8.0.6.15 - pxa6480sr6fp15ifix-20200820\_01(SR6 FP15+IJ26443) VM version: 2.9 (IBM Corporation) Linux 3.10.0-1160.2.1.el7.x86\_64  
2020-10-10 11:39:00,783 [main] WARN co.elastic.apm.agent.configuration.StartupInfo - To enable all features and decrease startup time, please configure application\_packages  
2020-10-10 11:39:08,265 [main] INFO co.elastic.apm.agent.impl.ElasticApmTracer - Tracer switched to RUNNING state  
2020-10-10 11:39:08,339 [elastic-apm-init-instrumentation-shutdown-hook] INFO co.elastic.apm.agent.impl.ElasticApmTracer - Tracer switched to STOPPED state  
2020-10-10 11:39:08,700 elastic-apm-remote-config-poller ERROR No Log4j 2 configuration file found. Using default configuration (logging only errors to the console), or user programmatically provided configurations. Set system property 'log4j2.debug' to show Log4j 2 internal initialization logging. See [https://logging.apache.org/log4j/2.x/manual/configuration.html](https://logging.apache.org/log4j/2.x/manual/configuration.html) for instructions on how to configure Log4j 2  
"native\_stdout.log" 101L, 16237C

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [October 26, 2020, 8:45pm UTC](https://discuss.elastic.co/t/apm-agent-error-could-not-find-or-load-main-class/251648/2 "2020-10-26T20:45:36Z")

</div>

Hi @MfuentesG,

This issue seems quite similar to [APM Agent does not start](https://discuss.elastic.co/t/apm-agent-does-not-start/252054/), is it the same or is it a different one ? The other one was due to extra characters in configuration, thus if it's not the same you might double-check this first.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 16, 2020, 4:45pm UTC](https://discuss.elastic.co/t/apm-agent-error-could-not-find-or-load-main-class/251648/3 "2020-11-16T16:45:48Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
