title: CannotResolveClassException: org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy
body: <p>When I am trying to run the JMX file from eclipse through java code, i am getting the error code and error as follows.</p>
  
  <p>I have tried by adding plugin manager. </p>
  
  <pre><code>&lt;!-- https://mvnrepository.com/artifact/kg.apc/jmeter-plugins-manager --&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;kg.apc&lt;/groupId&gt;
      &lt;artifactId&gt;jmeter-plugins-manager&lt;/artifactId&gt;
      &lt;version&gt;1.3&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>package com.blazemeter.demo;
  
  import org.apache.jmeter.engine.StandardJMeterEngine;
  import org.apache.jmeter.save.SaveService;
  import org.apache.jmeter.util.JMeterUtils;
  import org.apache.jorphan.collections.HashTree;
  
  import com.thoughtworks.xstream.XStream;
  
  import java.io.File;
  import java.io.FileInputStream;
  
  public class RunTest {
  
      public static void main(String[] argv) throws Exception {
          // JMeter Engine
          StandardJMeterEngine jmeter = new StandardJMeterEngine();
  
  
          // Initialize Properties, logging, locale, etc.
          JMeterUtils.loadJMeterProperties("C:/Users/Public/softwares/apache-jmeter-5.0/bin/jmeter.properties");
          JMeterUtils.setJMeterHome("C:/Users/Public/softwares/apache-jmeter-5.0");
          JMeterUtils.initLogging();// you can comment this line out to see extra log messages of i.e. DEBUG level
          JMeterUtils.initLocale();
  
          // Initialize JMeter SaveService
          SaveService.loadProperties();
  
          // Load existing .jmx Test Plan
          File in = new File("C:\\Users\\Public\\SampleRun.jmx");
          HashTree testPlanTree = SaveService.loadTree(in);
          in.exists();
  
          // Run JMeter Test
          jmeter.configure(testPlanTree);
          jmeter.run();
      }
  }
  </code></pre>
  
  <hr>
  
  <pre><code>ERROR StatusLogger No Log4j 2 configuration file found. Using default configuration (logging only errors to the console), or user programmatically provided configurations. Set system property 'log4j2.debug' to show Log4j 2 internal initialization logging. See https://logging.apache.org/log4j/2.x/manual/configuration.html for instructions on how to configure Log4j 2
      Exception in thread "main" java.lang.IllegalArgumentException: Problem loading XML from:'C:\Users\Public\SampleRun.jmx'. 
      Cause:
      CannotResolveClassException: org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy
  
   Detail:com.thoughtworks.xstream.converters.ConversionException: 
  ---- Debugging information ----
  cause-exception     : com.thoughtworks.xstream.converters.ConversionException
  cause-message       : 
  first-jmeter-class  : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
  class               : org.apache.jmeter.save.ScriptWrapper
  required-type       : org.apache.jmeter.save.ScriptWrapper
  converter-type      : org.apache.jmeter.save.ScriptWrapperConverter
  path                : /jmeterTestPlan/hashTree/hashTree/hashTree/HTTPSamplerProxy
  line number         : 29
  version             : 5.1.1 r1855137
  -------------------------------
      at org.apache.jmeter.save.SaveService.readTree(SaveService.java:459)
      at org.apache.jmeter.save.SaveService.loadTree(SaveService.java:432)
      at com.blazemeter.demo.RunTest.main(RunTest.java:63)
  Caused by: com.thoughtworks.xstream.converters.ConversionException: 
  ---- Debugging information ----
  cause-exception     : com.thoughtworks.xstream.converters.ConversionException
  cause-message       : 
  first-jmeter-class  : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
  class               : org.apache.jmeter.save.ScriptWrapper
  required-type       : org.apache.jmeter.save.ScriptWrapper
  converter-type      : org.apache.jmeter.save.ScriptWrapperConverter
  path                : /jmeterTestPlan/hashTree/hashTree/hashTree/HTTPSamplerProxy
  line number         : 29
  version             : 5.1.1 r1855137
  -------------------------------
  </code></pre>