title: netdiagnostics Java agent startup error with Adobe Experience Manager
body: <p>We are using Adobe Experience Manager, and I need to set up monitoring for it via javaagent (we have the special tool for java application monitoring called netdiagnostics).
  Usually, for enabling monitoring I only need to pass parameters of netdiagnostics to the application via javaagent option.
  But after passed javaagent option to the Adobe Experience Manager, it doesn't start and I see the errors in the logs:</p>
  
  <pre><code>su[16168]: 14.01.2020 08:31:05.615 *INFO * [Apache Sling Terminator] Java VM is shutting down
  su[16168]: 14.01.2020 08:31:05.615 *INFO * [Apache Sling Terminator] Stopping Apache Sling
  su[16168]: MAIN process: shutdown hook
  su[16168]: MAIN process: exiting
  su[16168]: Exception in thread "UnregisteringFilterThread for ServiceUnavailableFilter with tags [systemalive]" java.lang.NoClassDefFoundError: com/cavisson/ndutils/ThreadCallOutHandler
  su[16168]: at org.apache.felix.hc.core.impl.filter.ServiceUnavailableFilter$UnregisteringFilterThread.run(ServiceUnavailableFilter.java)
  su[16168]: Caused by: java.lang.ClassNotFoundException: com.cavisson.ndutils.ThreadCallOutHandler not found by org.apache.felix.healthcheck.core [579]
  su[16168]: at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1597)
  su[16168]: at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79)
  su[16168]: at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1982)
  su[16168]: at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  su[16168]: ... 1 more
  su[16168]: 14.01.2020 08:31:33.418 *INFO * [Sling Notifier] Apache Sling has been stopped
  </code></pre>
  
  <p>Also, when I try to check systemready I get the next error:</p>
  
  <pre><code>curl http://127.0.0.1:4502/systemready
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8"/&gt;
  &lt;title&gt;Error 500 Server Error&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;&lt;h2&gt;HTTP ERROR 500&lt;/h2&gt;
  &lt;p&gt;Problem accessing /systemready. Reason:
  &lt;pre&gt;    Server Error&lt;/pre&gt;&lt;/p&gt;&lt;h3&gt;Caused by:&lt;/h3&gt;&lt;pre&gt;java.lang.NoClassDefFoundError: com/cavisson/ndutils/NDHttpCapture
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:671)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
      at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:123)
      at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:86)
      at com.adobe.granite.license.impl.LicenseCheckFilter.doFilter(LicenseCheckFilter.java:308)
      at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:142)
      at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)
      at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:131)
      at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:142)
      at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)
      at org.apache.felix.http.base.internal.dispatch.Dispatcher$1.doFilter(Dispatcher.java:146)
      at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1002)
      at org.apache.sling.security.impl.ReferrerFilter.doFilter(ReferrerFilter.java:326)
      at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:136)
      at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1008)
      at org.apache.felix.http.sslfilter.internal.SslFilter.doFilter(SslFilter.java:97)
      at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:136)
      at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1008)
      at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager.invokePreprocessors(WhiteboardManager.java:1012)
      at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:91)
      at org.apache.felix.http.base.internal.dispatch.DispatcherServlet.service(DispatcherServlet.java:49)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
      at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:873)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:542)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1701)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1668)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
      at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
      at org.eclipse.jetty.server.Server.handle(Server.java:502)
      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
      at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
      at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
      at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
      at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
      at java.lang.Thread.run(Thread.java:748)
  &lt;/pre&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I founded a similar issue, but with another agent:
  <a href="https://discuss.elastic.co/t/apm-java-agent-startup-error-with-adobe-experience-manager/153451" rel="nofollow noreferrer">https://discuss.elastic.co/t/apm-java-agent-startup-error-with-adobe-experience-manager/153451</a></p>
  
  <p>As mentioned in that issue I trying to pass sling.bootdelegation parameter via the command line ("-Dsling.bootdelegation.com.cavisson=com.cavisson.* ") but without luck.</p>
  
  <p>Also, AEM successfully started without a javaagent option ...</p>