2
votes

Trying to get New Relic to work with my Play 2.3.4 app.

Here's the error I'm getting:

Exception in thread "main" java.lang.ClassNotFoundException: com.newrelic.bootstrap.BootstrapAgent
    at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:304)
    at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
FATAL ERROR in native method: processing of -javaagent failed

and my start command is:

sudo ./app -J-javaagent:../../newrelic/newrelic.jar

Any help really appreciated.

2

2 Answers

0
votes

Try adding the javaagent flag as part of the JAVA_OPTS env variable and running your application:

export JAVA_OPTS="$JAVA_OPTS -javaagent:/full/path/to/newrelic.jar"
sudo ./app

If this doesn't work, try the New Relic community forum for additional help. https://discuss.newrelic.com/

0
votes

It is not recommended to use relative paths when setting your agent.

Try using the full path to the jar file.