title: java.lang.NoClassDefFoundError: com/singularity/ee/agent/appagent/services/bciengine/templates/IHttpServletRequest
body: <p>I need to implement an <strong>application performance monitoring</strong> (APM) for my application so I implemented <a href="https://www.appdynamics.com" rel="nofollow noreferrer">appdynamic</a>.</p>
  
  <p>I am Using Payara server and in order to configure it for appdynamic I follow the below url 
  <a href="https://docs.appdynamics.com/display/PRO41/GlassFish+Startup+Settings" rel="nofollow noreferrer">GlassFish+Startup+Settings</a></p>
  
  <p>I setup every thing properly and I am able to connect with appdynamic. I am damn sure about it because I tested it with a demo application that is working properly. But when I am doing same thing for my actual application on server which is Struts2 based application then I am facing following two things.</p>
  
  <ol>
  <li>When I am trying to access root URL then server is asking username and password and it's showing error <strong>401</strong> (plz see the attached image 1)</li>
  <li>When I am trying to access login url then I am getting error <strong>404</strong> (plz see the attached image 2).</li>
  </ol>
  
  <p>My concern is this that why I am facing above two issues for my application ? if I remove the <strong>APM</strong> configuration from the application then the both points not occur for me. Everything work properly.</p>
  
  <p>I am using Struts 2.3.24  Payara Server(glassfish).</p>
  
  <p>If any one face this issue or have any idea then let me know I will be very thank full to you.</p>
  
  <p>Any think else is required from my side then let me know I will update.</p>
  
  <p><strong>Suggestion are most welcomed.</strong></p>
  
  <p><strong>This shows when I try to access root url</strong></p>
  
  <p><a href="https://i.stack.imgur.com/Nw64j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Nw64j.png" alt="this shows when I try to Root Access"></a></p>
  
  <p><strong>This shows when I try to access login url</strong>
  <a href="https://i.stack.imgur.com/cCbsP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cCbsP.png" alt="unable to access login page"></a>
  <strong>I am getting below error when I hit for root url (Error occur only when APM is configured with the server)</strong></p>
  
  <pre><code>java.lang.NoClassDefFoundError: com/singularity/ee/agent/appagent/services/bciengine/templates/IHttpServletRequest
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:1233)
      at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1763)
      at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1646)
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:1233)
      at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1763)
      at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1646)
      at org.apache.struts2.dispatcher.ng.InitOperations.createDispatcher(InitOperations.java:110)
      at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:73)
      at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
      at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
      at org.apache.catalina.core.ApplicationFilterConfig.&lt;init&gt;(ApplicationFilterConfig.java:131)
      at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:5329)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:5974)
      at com.sun.enterprise.web.WebModule.start(WebModule.java:692)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1041)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:747)
      at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2296)
      at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1942)
      at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
      at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
      at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
      at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:353)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:501)
      at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:406)
      at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:243)
      at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:326)
      at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:374)
      at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:471)
      at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:228)
      at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:85)
      at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2022)
      at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:114)
      at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:88)
      at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:1213)
      at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:1144)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: java.lang.ClassNotFoundException: com.singularity.ee.agent.appagent.services.bciengine.templates.IHttpServletRequest
      at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1796)
      at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1646)
      ... 45 more
  ]]
  </code></pre>