question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wildfly 8 doesn't work with elastic-apm-agent-0.5.1

See original GitHub issue

Hi I am trying to connect the java-apm-agent to wildfly but notice that wildfly won’t run correctly. If i comment out the -javaagent part wildfly runs normaly.

Caused by: java.lang.NoClassDefFoundError: co/elastic/apm/jdbc/StatementInstrumentation
        at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:266)
        at org.postgresql.jdbc.PgConnection.execSQLQuery(PgConnection.java:455)
        at org.postgresql.jdbc.PgConnection.execSQLQuery(PgConnection.java:449)
        at org.postgresql.jdbc.PgConnection.getTransactionIsolation(PgConnection.java:833)
        at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source) [:1.8.0_161]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_161]
        at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_161]
        at org.postgresql.ds.PGPooledConnection$ConnectionHandler.invoke(PGPooledConnection.java:333)
        at com.sun.proxy.$Proxy77.getTransactionIsolation(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source) [:1.8.0_161]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_161]
        at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_161]
        at org.postgresql.xa.PGXAConnection$ConnectionHandler.invoke(PGXAConnection.java:166)
        at com.sun.proxy.$Proxy77.getTransactionIsolation(Unknown Source)
        at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.<init>(BaseWrapperManagedConnection.java:197)
        at org.jboss.jca.adapters.jdbc.xa.XAManagedConnection.<init>(XAManagedConnection.java:68)
        at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.newXAManagedConnection(XAManagedConnectionFactory.java:523)
        at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXAManagedConnection(XAManagedConnectionFactory.java:496)

standalone.conf

JBOSS_LOG_MANAGER_LIB="$(echo $JBOSS_HOME/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-*.jar)" # resolve logmanager jar
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:$JBOSS_LOG_MANAGER_LIB"
JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager"
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager"


JAVA_OPTS="$JAVA_OPTS -Delastic.apm.service_name=lnk-timetable-wf-b-f11"
JAVA_OPTS="$JAVA_OPTS -Delastic.apm.application_packages=se.linkon"
JAVA_OPTS="$JAVA_OPTS -Delastic.apm.server_url=http://192.168.72.1:8300"

JAVA_OPTS="$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=10.0.2.15:9090,server=y,suspend=n"
JAVA_OPTS="$JAVA_OPTS -javaagent:/opt/monitoring/elastic-apm-agent-0.5.1.jar"

Wildfly 8 elastic-apm-agent-0.5.1.jar jre-1.8.0-openjdk

/Regards Fredrik

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
felixbarnycommented, Jun 20, 2018

WildFly now works out-of-the-box without any configuration changes apart from adding the -javaagent flag 🙂

1reaction
KyongSik-Yooncommented, Jun 15, 2018

@lk95jofr This problem related with OSGI class loading. You should configure specific setting to standalone.conf or domain.conf for install java agent. Maybe you can find parts below.

if [ "x$JBOSS_MODULES_SYSTEM_PKGS" = "x" ]; then
   JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman"
fi

Try attach elastic package to there as like JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman,co.elastic"

So WildFly will load all class of co.elastic package ignoring normal OSGI delegation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

APM and wildfly integration. Couldn't get response from APM ...
APM Agent language and version: elastic-apm-agent-1.18.0.RC1.jar: ... The java application is started as a wildfly service: java-wildfly
Read more >
Bug listing with status RESOLVED with resolution OBSOLETE ...
Bug:1523 - "[IDEA] Offload work by distributing trivial ebuild ... with custom FTP-port doesn't work" status:RESOLVED resolution:OBSOLETE severity:major ...
Read more >
Administrators Guide - OpenNMS Projects
This documentation provides information and procedures on setup, configuration, and use of the OpenNMS Horizon platform. Using a task-based approach, chapters ...
Read more >
Search Results - CVE
CVE-2022-46153, Traefik is an open source HTTP reverse proxy and load balancer. ... CVE-2019-7617, When the Elastic APM agent for Python versions before ......
Read more >
FreeBSD Ports Collection Index
GiNaC-1.3.8 -- A C++ library for symbolic mathematical calculations ... bpatch-1.0_1 -- A hex editor that doesn't load the whole file at once...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found