title: Exception in thread "main" java.lang.NoClassDefFoundError: io/restassured/response/Response
body: <p>POJO class for login to Jira localhost.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>package com.rest.requestpojo;
  
  import com.google.gson.annotations.Expose;
  import com.google.gson.annotations.SerializedName;
  
  public class LoginApi {
   
   @SerializedName("username")
   @Expose
   private String username;
   @SerializedName("password")
   @Expose
   private String password;
  
   public String getUsername() {
   return username;
   }
  
   public void setUsername(String username) {
   this.username = username;
   }
  
   public String getPassword() {
   return password;
   }
  
   public void setPassword(String password) {
   this.password = password;
   }
  
  
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>service classs to get the response from JIRA post call for login. I am just using main method to check the response.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>package com.rest.services;
  
  
  import org.json.JSONObject;
  
  import com.rest.requestpojo.LoginApi;
  
  import io.restassured.RestAssured;
  import io.restassured.response.Response;
  import io.restassured.specification.RequestSpecification;
  
  public class Service 
  {
   public Response jiraLoginAuth(String username, String password)
   {
    LoginApi login = new LoginApi();
    login.setUsername(username);
    login.setPassword(password);
    
    JSONObject jsonObject = new JSONObject(login);
    
    RequestSpecification requestSpecification = RestAssured.given();
    requestSpecification.contentType("application/json");
    requestSpecification.body(jsonObject);
    Response response =requestSpecification.post(ServiceURL.jiraLoginUrl);
    
    System.out.println(response);
    
    return response;
    
   }
   
   public static void main(String[] args) {
    Service service = new Service();
    service.jiraLoginAuth("chinmaya","ck2016d");
   }
  
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Service url to post.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>package com.rest.services;
  
  public class ServiceURL {
   
   public final static String jiraLoginUrl ="http://localhost:8080/rest/auth/1/session";
   
  
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Below is the POM.XML page where all the dependecies are available.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
   &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
   &lt;groupId&gt;com.restAPIFramework&lt;/groupId&gt;
   &lt;artifactId&gt;restAPIFramework&lt;/artifactId&gt;
   &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  
  
   &lt;dependencies&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;io.rest-assured&lt;/groupId&gt;
     &lt;artifactId&gt;rest-assured&lt;/artifactId&gt;
     &lt;version&gt;3.0.7&lt;/version&gt;
     &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;io.rest-assured&lt;/groupId&gt;
     &lt;artifactId&gt;json-schema-validator&lt;/artifactId&gt;
     &lt;version&gt;3.0.7&lt;/version&gt;
     &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;!-- https://mvnrepository.com/artifact/com.google.code.gson/gson --&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;
     &lt;artifactId&gt;gson&lt;/artifactId&gt;
     &lt;version&gt;2.8.2&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;org.json&lt;/groupId&gt;
     &lt;artifactId&gt;json&lt;/artifactId&gt;
     &lt;version&gt;20180130&lt;/version&gt;
    &lt;/dependency&gt;
   &lt;/dependencies&gt;
  
  
  &lt;/project&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Below is the error i am getting during run time. Is there any dependencies or jars missing in POM which causing the issue? Please help me with this i am new to restassured.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Exception in thread "main" java.lang.NoClassDefFoundError: io/restassured/response/Response
   at java.lang.Class.getDeclaredMethods0(Native Method)
   at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
   at java.lang.Class.privateGetMethodRecursive(Unknown Source)
   at java.lang.Class.getMethod0(Unknown Source)
   at java.lang.Class.getMethod(Unknown Source)
   at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
   at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
  Caused by: java.lang.ClassNotFoundException: io.restassured.response.Response
   at java.net.URLClassLoader.findClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)</code></pre>
  </div>
  </div>
  </p>