You'll find links to everything you want to know about the Java Agent here.
Is there something you don't see here? Let us know.
Compatibility & Requirements
The Java agent will run on anything that runs within JVM 1.5 or greater.
Please note: If you do not see your particular configuration listed here, there's a good chance that you'll see useful data even if we do not provide you specific/enhanced instrumentation.
App/Web servers: ColdFusion, Jetty (5, 6, 7), OC4J, Resin (3.1.9), Tomcat (6.x), WebLogic (10.3.3), WebSphere (7.0)
Frameworks: CXF, Spring, Struts 2, JSF (Java Server Faces), Play 1.2.4
JDBC Drivers:
- Oracle (ojdbc14, ojdbc5, ojdbc6)
- jTDS open source JDBC 3.0 type 4 driver for Microsoft SQL Server (6.5 up to 2008) and Sybase ASE
- MySQL (mysql-connector-java-5.1.13-bin)
- Postgres (postgressql-8.4-701.jdbc3)
- SQLServer (sqljdbc4)
- "default" SQL instrumentation is built into the Java agent
Other:
Solr (1.4.0)
Quartz Job Scheduler (1.8.3)
Amazon Simple Storage Service (Amazon S3)
Hibernate (3.x)
HttpClient (3.0.1, 4.x)
JSP - Java Server Pages (2.0, 2.1)
JMX
Installation
To use the Java agent, you first need to have a New Relic account. Get sign-up instructions here.
The Java Agent self-installer (Tomcat, Jetty and JBoss)
Manual installation (Tomcat, Jetty, JBoss, Apache Geronimo, Play, more)
Installing on Glassfish
Installing on ColdFusion
Installing on WebSphere
Installing on Tomcat and Windows
Installing on AWS Elastic Beanstalk
Don't see your app server here? The New Relic Java agent should work on any application server by passing the -javaagent:/path/to/newrelic.jar switch to the JVM.
Configuration
Once your application is reporting data, you can configure it from one place in the New Relic web interface, starting with Java agent version 2.2.0. Select your app, then go to the Settings > Application menu. Changes you make here will be applied to all agents reporting for your app.
Startup Configuration
The agent reads startup configuration from a file, newrelic.yml, that lives in the same directory as newrelic.jar. You can also override settings using Java system properties.
Settings the agent needs at startup (bootstrap) time include license_key and app_name. You can also set the location of the log file. See newrelic.yml Settings for details.
Does your Java app server run multiple applications in the same JVM? See this article on Configuring multiple applications.
Troubleshooting
No Data Appearing
After sending a request to your web application, data should appear in the New Relic dashboard within 2-3 minutes. If no data appears after a few minutes, verify the following:
- You have re-started your web server.
- Your
newrelic.jar and newrelic.yml files are in the same directory.
- You have checked the above directory for a
log/newrelic_agent.log file.
No End User Monitoring Data Appearing
If your application server does not use the Jasper jsp compiler (WebSphere and WebLogic), you do not get auto-instrumentation and therefore will not get end user monitoring data without manual instrumentation.
See Manual Instrumentation Instructions.
All of your hosts are showing up as "localhost"
You likely need to add a host entry for each machine in /etc/hosts.
Advanced configuration and features
Recording deployments
Preventing a request from being instrumented
Ignoring transactions using Annotations
Component-based web transaction naming
Monitoring Java background processes
Apache Commons Daemon (jsvc)
Java Agent API
New & Noteworthy
v2.3.1
- bug fix: Agent logging breaks webapp log4j configuration (introduced in 2.3.0)
v2.3.0
- Play! framework support
- create web transactions using custom instrumentation
- use log4j instead of Java API logging
- bug fix: RUM auto instrumentation fixes
- bug fix: multiple app names in app_name setting out of order (introduced in 2.2.0)
- bug fix: possible java.lang.IllegalArgumentException with parameterized SQL (introduced in 2.2.0)
- bug fix: WebSphere instrumentation broken (introduced in 2.2.0)
v2.2.1
- bug fix: ClassFormatError and NoClassDefFoundError instrumenting proxy classes
- bug fix: transaction trace threshold not working (introduced in 2.2.0)
- bug fix: infinite loop instrumenting parameterized SQL statements
v2.2.0
- performance improvements
- support server-side configuration
- bug fix: byte-code instrumentation causes class loading deadlock and OS memory explosion
v2.1.2
- performance improvements
- bug fix: parse inner select SQL statements
- bug fix: execute SQL statement not recognized
v2.1.0
- report slow SQL statements
- performance improvements
- continue to record metrics after transaction trace limit is reached
- bug fix: never drop data
- bug fix: Agent destructively reads request parameters in Resin
- bug fix: default transaction trace threshold should be apdex_f
- bug fix: Don't obfuscate digits in SQL statements that are part of table name
v2.0.4
- bug fix: RUM: handle duplicate injection of our JS header and footer
- bug fix: fix the license key hint that is inserted into the auto-generated configuration file
- Allow logging to standard out
- Allow configuration of the agent via environment variables
v2.0.3
- bug fix: RUM: Tag files not compiling in Jasper
- bug fix: RUM: header not always inserted after meta tags
- bug fix: NullPointerException if filter config is null
- bug fix: Fix IE measurement problem in RUM footer
- bug fix: API calls should not throw exceptions
v2.0.2
- bug fix: Auto RUM compiler error instrumenting some JSPs
- bug fix: Auto RUM should inject header after meta tags
- bug fix: Installer does not modify start script if another javaagent switch is present
- bug fix: Agent breaks request URI parsing in Tomcat: JSESSIONID not removed (introduced in 1.4.0)
- bug fix: Some compilers unable to compile JSP with auto RUM
- Installer support for Glassfish
v2.0.1
- bug fix: JBoss fails to start with JMX errors (introduced in 1.4.0)
v2.0.0
- auto Real User Monitoring
- support for X-Request-Start, X-Queue-Start, and X-Queue-Time request headers
- bug fix: newrelic-api.jar does not work with Java 1.5
- bug fix: NullPointerException instrumenting HttpClient
- bug fix: setting request attribute "com.newrelic.agent.TRANSACTION_NAME" not working (broken in 1.4.0)
- bug fix: uncaught exceptions not logged during startup
- bug fix: thread profiling fails if CPU time not supported
- bug fix: error is ignored only if it is the root cause
v1.4.0
- Real User Monitoring
- bug fix: setting 'ignore_status_codes' to a single value is ignored
v1.3.0
- component-based transaction naming
- agent API
- multiple applications enhancements
- send data to RPM in UTF-8 format
- bug fix: ClassCastException setting record_sql: off