Hello there,
I am trying to use the Automatic setup with apm-agent-attach-standalone.jar
. I am running the agent with Oracle Java 8, and the java application I want to monitor is running with Java 7.
Kibana version: 7.9.0
Elasticsearch version: 7.9.2
APM Server version: 7.9.2
APM Agent language and version: Java Oracle 8, 1.18.0
Browser version: Google Chrome 80.0.3987.149
Original install method (e.g. download page, yum, deb, from source, etc.) and version: The agent was installed from the link: https://search.maven.org/remotecontent?filepath=co/elastic/apm/apm-agent-attach/1.18.0/apm-agent-attach-1.18.0-standalone.jar
Fresh install or upgraded from other version? Fresh install
Is there anything special in your setup? The communication between the agent and the APM server is plain within an internal network. The problem is the agent won't attach to the Java VM, so it has nothing to do with a communication issue with APM server.
Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):
[root@company jboss-as-7.1.1]# java -jar apm-agent-attach-1.18.0-standalone.jar --pid 27769 --config service_name=comerzzia-pre server_urls=http://192.168.250.114:8200
2020-10-01 13:16:17.631 INFO Attaching the Elastic APM agent to 27769
Exception in thread "main" java.lang.IllegalStateException: Error during attachment using: co.elastic.apm.attach.bytebuddy.agent.ByteBuddyAgent$AttachmentProvider$Compound@3f8f9dd6
at co.elastic.apm.attach.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:613)
at co.elastic.apm.attach.bytebuddy.agent.ByteBuddyAgent.attach(ByteBuddyAgent.java:273)
at co.elastic.apm.attach.ElasticApmAttacher.attach(ElasticApmAttacher.java:159)
at co.elastic.apm.attach.RemoteAttacher.main(RemoteAttacher.java:88)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at co.elastic.apm.attach.bytebuddy.agent.Attacher.install(Attacher.java:106)
at co.elastic.apm.attach.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:608)
... 3 more
Caused by: java.lang.IllegalStateException: Target VM did not respond: 27769
at co.elastic.apm.attach.bytebuddy.agent.VirtualMachine$ForHotSpot$Connection$Factory$ForSocketFile.connect(VirtualMachine.java:541)
at co.elastic.apm.attach.bytebuddy.agent.VirtualMachine$ForHotSpot.attach(VirtualMachine.java:256)
at co.elastic.apm.attach.bytebuddy.agent.VirtualMachine$ForHotSpot.attach(VirtualMachine.java:243)
... 9 more
Apparently, no matter the java version I use when launching the agent (Java 7 or Java 8), it won't attach to the JVM of the Java 7 process.
The command I use to launch the agent is the following:
java -jar $(pwd)/apm-agent-attach-1.18.0-standalone.jar --pid $(ps -C java -f | grep -i standalone | awk '{print $2}') --config service_name=comerzzia-pre server_urls=http://192.168.250.114 :8200 applicaion_packages=bin.comerzzia,org.apache.jsp.backoffice,org.jboss.byteman log_file=/apps/bin/comerzzia/jboss-as-7.1.1/standalone/log/apm.log log_level=DEBUG
Is there any additional step I am missing? Any help provided is welcome!
Thanks in advance!