cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Java agent on Jetty 9.3

Salih.Tilkici
Wanderer

Hi,

 

Trying out the Java agent using Jetty 9.3/ JDK8.

 

Agent is dowloaded and installed inside the location /opt/appdynamics/appagent

 

Inside the jetty jvm.ini file I have the following defined

 

[message redacted to protect privacy]

 

 

But I don't see any date pushed, neither I see any log file created.

 

What did I missed in the setup?

 

6 REPLIES 6

Peter.Holditch
Moderator
Moderator

I noticed that your ps output is missing the "appagent" part from the argument to -javaagent.

 

This raises the question why your JVM starts at all, since it should fail to start if it cannot find the configured agent.

 

You don't have a second agent install at /opt/appdynamics, with some agent logs written beneath it do you?

 

Warm regards,

Peter



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

For some reason, wrong ps output was copied in, here the correct one

 

[message redacted to protect privacy]

 

 

Any update on this?

To diagnose why the agent isn't reporting to the controller, you need to diagnose why it isn't generating any logs, to troubleshoot.

 

Does the "bambooa" user have permission to write log files to the directory under the /opt/appdynamics/appagent/ver4.x.y.z/logs directory?

 

What happens if you run "java -javaagent:/opt/appdynamics/appagent/javaagent.jar -Dappdynamics.agent.nodeName=telematicsmm13 -Dappname=telematicsmm13 -Dappdynamics.agent.tierName=test -Dconfig.home=/opt/apps/telematicsmm13 -Dappdynamics.agent.applicationName=b2c -version"

 

Does the agent connect then?

 

 

 

 



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Hi,

 

yes the bambooa user has access to write to the logs location.

 

java -javaagent:/opt/appdynamics/appagent/javaagent.jar -Dappdynamics.agent.nodeName=telematicsmm13 -Dappname=telematicsmm13 -Dappdynamics.agent.tierName=test -Dconfig.home=/opt/apps/telematicsmm13 -Dappdynamics.agent.applicationName=b2c -version

 

This one I got to work. There was some issue in the first xml line with the double quotes

 

<?xml version=“1.0” encoding=“UTF-8"?>

 

Corrected that and then it was workign fine for the standalone Java command

 

[bambooa@lxb2capa01 ~]$ java -javaagent:/opt/appdynamics/appagent/javaagent.jar -Dappdynamics.agent.nodeName=telematicsmm13 -Dappname=telematicsmm13 -Dappdynamics.agent.tierName=test -Dconfig.home=/opt/apps/telematicsmm13 -Dappdynamics.agent.applicationName=b2c -version
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
Full Agent Registration Info Resolver found system property [appdynamics.agent.applicationName] for application name [b2c]
Full Agent Registration Info Resolver found system property [appdynamics.agent.tierName] for tier name [test]
Full Agent Registration Info Resolver found system property [appdynamics.agent.nodeName] for node name [telematicsmm13]
Full Agent Registration Info Resolver using selfService [false]
Full Agent Registration Info Resolver using application name [b2c]
Full Agent Registration Info Resolver using tier name [test]
Full Agent Registration Info Resolver using node name [telematicsmm13]
Install Directory resolved to[/opt/appdynamics/appagent]
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
[Thread-0] Mon Nov 12 17:06:24 CET 2018[DEBUG]: AgentInstallManager - Full Agent Registration Info Resolver is running
[Thread-0] Mon Nov 12 17:06:24 CET 2018[INFO]: AgentInstallManager - Full Agent Registration Info Resolver found system property [appdynamics.agent.applicationName] for application name [b2c]
[Thread-0] Mon Nov 12 17:06:24 CET 2018[INFO]: AgentInstallManager - Full Agent Registration Info Resolver found system property [appdynamics.agent.tierName] for tier name [test]
[Thread-0] Mon Nov 12 17:06:24 CET 2018[INFO]: AgentInstallManager - Full Agent Registration Info Resolver found system property [appdynamics.agent.nodeName] for node name [telematicsmm13]
[Thread-0] Mon Nov 12 17:06:24 CET 2018[INFO]: AgentInstallManager - Full Agent Registration Info Resolver using selfService [false]
[Thread-0] Mon Nov 12 17:06:24 CET 2018[INFO]: AgentInstallManager - Full Agent Registration Info Resolver using application name [b2c]
[Thread-0] Mon Nov 12 17:06:24 CET 2018[INFO]: AgentInstallManager - Full Agent Registration Info Resolver using tier name [test]
[Thread-0] Mon Nov 12 17:06:24 CET 2018[INFO]: AgentInstallManager - Full Agent Registration Info Resolver using node name [telematicsmm13]
[Thread-0] Mon Nov 12 17:06:24 CET 2018[DEBUG]: AgentInstallManager - Full Agent Registration Info Resolver finished running
[Thread-0] Mon Nov 12 17:06:24 CET 2018[INFO]: AgentInstallManager - Agent runtime directory set to [/opt/appdynamics/appagent/ver4.5.4.24355]
[Thread-0] Mon Nov 12 17:06:24 CET 2018[INFO]: AgentInstallManager - Agent node directory set to [telematicsmm13]
[Thread-0] Mon Nov 12 17:06:24 CET 2018[INFO]: JavaAgent - Using Java Agent Version [Server Agent #4.5.4.24355 v4.5.4 GA compatible with 4.4.1.0 r58c8235fa4d18a18b59d7cbc578f1ba1a93453db pull-requests/1725]
[Thread-0] Mon Nov 12 17:06:24 CET 2018[INFO]: JavaAgent - Running IBM Java Agent [No]
[Thread-0] Mon Nov 12 17:06:24 CET 2018[INFO]: JavaAgent - Java Agent Directory [/opt/appdynamics/appagent/ver4.5.4.24355]
[Thread-0] Mon Nov 12 17:06:24 CET 2018[INFO]: JavaAgent - Java Agent AppAgent directory [/opt/appdynamics/appagent/ver4.5.4.24355]
Agent Logging Directory [/opt/appdynamics/appagent/ver4.5.4.24355/logs/telematicsmm13]
2018-11-12 17:06:25,593 INFO Log4j appears to be running in a Servlet environment, but there's no log4j-web module available. If you want better web container support, please add the log4j-web JAR to your web archive or server lib directory.
Running obfuscated agent
Started AppDynamics Java Agent Successfully.
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

 

I will restest the Jetty one and keep you ifnormed later thsi evening.

Walter

 

 

I have tested with this java command with success, the agent is used and logs are created, some defaults are taken from the config XML file

 

java -javaagent:/opt/appdynamics/appagent/ver4.5.4.24355/javaagent.jar -Dappdynamics.agent.nodeName=telematicsmm13  -version

 

Now I added the same logic to my Jetty environment, Jetty 9.3 and Java 8.

 

We are using the startd.d location for the module ini files, so the JVM arguments need to be specified inside the file jvm.ini.

 

# ---------------------------------------
# Module: jvm
# ---------------------------------------
--module=jvm

--exec

-javaagent:/opt/appdynamics/appagent/ver4.5.4.24355/javaagent.jar
-Dappdynamics.agent.nodeName=telematicsmm13

...

...

 

bambooa 13061 13042 5 20:07 ? 00:00:01 java -Djetty.logging.dir=/opt/apps/telematicsmm13/logs -Djetty.home=/opt/apps/telematicsmm13/jetty -Djetty.base=/opt/apps/telematicsmm13 -Djava.io.tmpdir=/opt/apps/telematicsmm13/work -jar /opt/apps/telematicsmm13/jetty/start.jar jetty.state=/opt/apps/telematicsmm13/run/jetty.state jetty-started.xml

 

bambooa 13100 13061 99 20:07 ? 00:00:37 /opt/jdk/jdk1.8.0_171-x64/jre/bin/java -javaagent:/opt/appdynamics/appagent/ver4.5.4.24355/javaagent.jar -Xms64m -Xmx256m -XX:+UseConcMarkSweepGC -XX:ParallelCMSThreads=2 -XX:+CMSClassUnloadingEnabled -XX:CMSInitiatingOccupancyFraction=80 -verbose:gc -Xloggc:/opt/apps/telematicsmm13/monitoring/gc.log -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintGC -XX:+PrintGCDetails -XX:+DisableExplicitGC -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/apps/telematicsmm13/heapdump -XX:+PrintCommandLineFlags -Djava.io.tmpdir=/opt/apps/telematicsmm13/work -Djetty.home=/opt/apps/telematicsmm13/jetty -Djetty.base=/opt/apps/telematicsmm13 -Djava.io.tmpdir=/opt/apps/telematicsmm13/work -Dappdynamics.agent.nodeName=telematicsmm13 -Dappname=telematicsmm13 -Dconfig.home=/opt/apps/telematicsmm13 -Djava.awt.headless=true -DSTOP.KEY=secret8883 -Drun.environment=uat -DSTOP.PORT=8883 -cp /opt/jetty/jetty-distribution-9.3.24.v20180605/lib/apache-jsp/org.eclipse.jdt.core.compiler.ecj-4.4.2.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/apache-jsp/org.eclipse.jetty.apache-jsp-9.3.24.v20180605.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/apache-jsp/org.mortbay.jasper.apache-el-8.0.33.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/apache-jsp/org.mortbay.jasper.apache-jsp-8.0.33.jar:/opt/jetty/jetty-9.3-toyota/lib/ext/commons-codec-1.11.jar:/opt/jetty/jetty-9.3-toyota/lib/ext/log4j-1.2.17.jar:/opt/jetty/jetty-9.3-toyota/lib/ext/ojdbc6-11.2.0.3.0.jar:/opt/jetty/jetty-9.3-toyota/lib/ext/sqljdbc42.jar:/opt/jetty/jetty-9.3-toyota/lib/ext/tme-log4j-1-gdpr.1.0.jar:/opt/apps/telematicsmm13/resources:/opt/jetty/jetty-9.3-toyota/resources:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/servlet-api-3.1.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/jetty-schemas-3.1.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/jetty-http-9.3.24.v20180605.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/jetty-server-9.3.24.v20180605.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/jetty-xml-9.3.24.v20180605.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/jetty-util-9.3.24.v20180605.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/jetty-io-9.3.24.v20180605.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/jetty-jmx-9.3.24.v20180605.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/jetty-jndi-9.3.24.v20180605.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/jndi/javax.mail.glassfish-1.4.1.v201005082020.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/jndi/javax.transaction-api-1.2.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/jetty-rewrite-9.3.24.v20180605.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/jetty-security-9.3.24.v20180605.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/jetty-servlet-9.3.24.v20180605.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/setuid/jetty-setuid-java-1.0.3.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/jetty-webapp-9.3.24.v20180605.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/jetty-deploy-9.3.24.v20180605.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/jetty-plus-9.3.24.v20180605.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/jetty-annotations-9.3.24.v20180605.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/annotations/asm-6.0.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/annotations/asm-commons-6.0.jar:/opt/jetty/jetty-distribution-9.3.24.v20180605/lib/annotations/javax.annotation-api-1.2.jar org.eclipse.jetty.xml.XmlConfiguration /opt/apps/telematicsmm13/work/start_7725015596849107897.properties /opt/jetty/jetty-9.3-toyota/etc/jetty-logging.xml /opt/jetty/jetty-9.3-toyota/etc/jetty.xml /opt/jetty/jetty-9.3-toyota/etc/customize-systemclasses.xml /opt/jetty/jetty-distribution-9.3.24.v20180605/etc/jetty-http.xml /opt/jetty/jetty-distribution-9.3.24.v20180605/etc/jetty-jmx.xml /opt/jetty/jetty-9.3-toyota/etc/jetty-requestlog.xml /opt/jetty/jetty-9.3-toyota/etc/jetty-rewrite.xml /opt/jetty/jetty-distribution-9.3.24.v20180605/etc/jetty-setuid.xml /opt/jetty/jetty-distri

 

But I don't see any logs created this time.