title: NULL values in JAXB unmarshalling
body: <p>HI I want to fetch the value of nested xml using un-marshaling using maven dependency but the <strong>final output is returning me null values</strong>.I have used the 3 packages in maven project and vehicle.xml contains the values of car after fetching the values  I have to insert them into access Database </p>
  
  <h1>MY XML file---> Vehicle.xml</h1>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Vehicle&gt;
     &lt;Car&gt;
        &lt;manufacturer&gt;Maruti&lt;/manufacturer&gt;
        &lt;cost&gt;675000&lt;/cost&gt;
        &lt;name&gt;Ciaz&lt;/name&gt;
        &lt;fueType&gt;Petrol&lt;/fueType&gt;
        &lt;driverTye&gt;Manual&lt;/driverTye&gt;
     &lt;/Car&gt;
     &lt;Car&gt;
        &lt;manufacturer&gt;Maruti&lt;/manufacturer&gt;
        &lt;cost&gt;575000&lt;/cost&gt;
        &lt;name&gt;Dezire&lt;/name&gt;
        &lt;fueType&gt;Petrol&lt;/fueType&gt;
        &lt;driverTye&gt;Manual&lt;/driverTye&gt;
     &lt;/Car&gt;
  &lt;/Vehicle&gt;
  </code></pre>
  
  <h1>POJO CLASS</h1>
  
  <h2>Vehicle.java</h2>
  
  <pre><code>package jaxb;
  
  import java.util.List;
  
  import javax.xml.bind.annotation.XmlElement;
  import javax.xml.bind.annotation.XmlRootElement;
  
  @XmlRootElement(name="Vehicle")
  public class Vehicle {
  
      @XmlElement
      private List&lt;Car&gt; car;
  
      public List&lt;Car&gt; getCar() {
          return car;
      }
  
      /*
       * public Vehicle(List&lt;Car&gt; car) { super(); this.car = car; }
       */
  
      @Override
      public String toString() {
          return "Vehicle[ Car="+car+"]";
      }
  
  }
  </code></pre>
  
  <h2>Car.java (This is child POJO)</h2>
  
  <pre><code>package jaxb;
  
  import javax.xml.bind.annotation.XmlElement;
  import javax.xml.bind.annotation.XmlRootElement;
  
  @XmlRootElement(name="Car")
  public class Car {
  
      private String manufacturer;
      private String name;
      private String driverType;
      private String fuelType;
      private int cost;
  
      @XmlElement
      public String getManufacturer() {
          return manufacturer;
      }
      public void setManufacturer(String manufacturer) {
          this.manufacturer = manufacturer;
      }
  
      @XmlElement
      public String getName() {
          return name;
      }
      public void setName(String name) {
          this.name = name;
      }
  
      @XmlElement
      public String getDriverType() {
          return driverType;
      }
      public void setDriverType(String driverType) {
          this.driverType = driverType;
      }
  
      @XmlElement
      public String getFuelType() {
          return fuelType;
      }
      public void setFuelType(String fuelType) {
          this.fuelType = fuelType;
      }
  
      @XmlElement
      public int getCost() {
          return cost;
      }
      public void setCost(int cost) {
          this.cost = cost;
      }
  
  
       @Override
          public String toString() {
              return "Car [name=" + name + ", fuelType=" + fuelType + ", cost=" + cost+",driverType="+driverType +"]";
          }
  </code></pre>
  
  <h2>VehicleJxb.java</h2>
  
  <p>This file  contains the implementation of our unmarshalling  method</p>
  
  <pre><code>package jaxb;
  
  import java.io.File;
  
  import javax.xml.bind.JAXBContext;
  import javax.xml.bind.JAXBException;
  import javax.xml.bind.Unmarshaller;
  
  public class VehicleJxb {
  
  
  
      public void unmarhalling() {
  
  
          try {
              JAXBContext jaxbContext = JAXBContext.newInstance(Vehicle.class);  
  
              Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();  
  
             Vehicle  vehicle = (Vehicle) jaxbUnmarshaller.unmarshal(new File("src\\main\\java\\Data\\Vehicle.xml"));
               System.out.println(vehicle);  
          } catch (JAXBException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }  
  
  
  
      }
  
  }
  </code></pre>
  
  <h2>App.java</h2>
  
  <pre><code>package com.project.XMLDB;
  import jaxb.*;
  public class App 
  {
      public static void main( String[] args ) 
      {
          VehicleJxb obj= new VehicleJxb();
         obj.unmarhalling();
      }
  }
  </code></pre>
  
  <p>My Output is coming </p>
  
  <pre><code>WARNING: An illegal reflective access operation has occurred
  WARNING: Illegal reflective access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector (file:/C:/Users/Shivam%20Sharma/.m2/repository/com/sun/xml/bind/jaxb-impl/2.2.11/jaxb-impl-2.2.11.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
  WARNING: Please consider reporting this to the maintainers of com.sun.xml.bind.v2.runtime.reflect.opt.Injector
  WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
  WARNING: All illegal access operations will be denied in a future release
  Vehicle[ Car=null]
  </code></pre>
  
  <p>I want to get the values as final output is returned null</p>