Old application server with elastic apm java agent

Kibana version: 8.6.2

Elasticsearch version: 8.6.2

APM Server version: 8.6.2

APM Agent language and version: Java 1.42.0

Hi folks!

Unfortunately, I need to monitoring an old legacy application.

This application run with Java 1.6 and Jboss 5.1.

My question is: Can I run elastic-apm-agent with this old application server?

I tested with version 1.42.0 of elastic-apm-agent, but obviously it doesn't run (log below).

# java -version
java version "1.6.0_171"
Java(TM) SE Runtime Environment (build 1.6.0_171-b13)
Oracle JRockit(R) (build R28.3.16-8-173817-1.6.0_171-20170927-0546-linux-x86_64, compiled mode)
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /usr/java/jboss

  JAVA: /usr/java/jdk/bin/java

JAVA_OPTS: -Dprogram.name=run.sh -Xms5G -Xmx5G -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -jrockit -d64 -Xss256K -Xgc:gencon -XXaggressive -XX:+UseCallProfiling -XXtlasize:min=4k,preferred=1024k -XXcompressedRefs:enable=true -XX:+UseLazyUnlocking -XX:+UseNewHashFunction -XX:-UseFatSpin -XX:+UseAllocPrefetch -XX:+RedoAllocPrefetch -XX:+UseAdaptiveFatSpin -XXnoSystemGC -XX:-FlightRecorder -XX:OptThreads=2 -Xns2G -Djavax.net.ssl.trustStore=xxxxx -Djavax.net.ssl.trustStorePassword=xxxxxx -Djava.rmi.server.hostname=xxxxx -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=xxxxx -Dorg.apache.tomcat.util.http.Parameters.MAX_COUNT=2000 -javaagent:/usr/java/jboss/elastic-apm-agent-1.42.1.jar -Delastic.apm.service_name=xxxxx -Delastic.apm.server_urls=https://xxxxxxxxx -Delastic.apm.secret_token=123456789

  CLASSPATH: /usr/java/jboss/bin/run.jar:/usr/java/jdk/lib/tools.jar

=========================================================================

Exception in thread "Main Thread" java.lang.UnsupportedClassVersionError: co/elastic/apm/agent/premain/AgentMain : unsupported classversion 51.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:304)
	at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:218)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:211)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:280)
	at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:338)
FATAL ERROR in native method: processing of -javaagent failed
[ERROR] aborted
JRockit aborted: Unknown error (50)

Is there any way to get this legacy application in APM?

Thanks in advance.

Hi,

Unfortunately the Elastic APM agent is only able to run on Java 7 and later JVMs.
Using OpenTelemetry agent is not an alternative in this case as it requires Java 8 or later.

What this means in your case is that if you can make this legacy application server RUN (no change in the application would be required) on a newer JVM (Java 7 or later), then you could make it work.

2 Likes

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