title: javax.xml.bind.MarshalException nor any of its super class is known to this context
body: <p>I am getting above exception, looking for solution, any help will be much appreciated. Found the same issue in some other messages, but they were not working for me. Please see the below code.</p>
  
  <pre><code>javax.xml.bind.MarshalException
   - with linked exception:
  [com.sun.istack.SAXException2: class com.mycompany.soma.ws.rest.v1.model.test.EmployeeConstruction nor any of its super class is known to this context.
  javax.xml.bind.JAXBException: class com.mycompany.soma.ws.rest.v1.model.test.EmployeeConstruction nor any of its super class is known to this context.]
      at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:326)
      at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:251)
      at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(Unknown Source)
      at com.mycompany.soma.ws.rest.v1.model.test.Test.main(Test.java:39)
  </code></pre>
  
  <p>.</p>
  
  <pre><code>&lt;snapshots&gt;
      &lt;employees&gt;
          &lt;employee&gt;
              &lt;name&gt;Dan&lt;/name&gt;
          &lt;/employee&gt;
          &lt;employee&gt;
              &lt;name&gt;Samy&lt;/name&gt;
          &lt;/employee&gt;
      &lt;/employees&gt;
  &lt;/shapshots&gt;
  </code></pre>
  
  <p>.</p>
  
  <pre><code>    package com.mycompany.soma.ws.rest.v1.model.test;
  
  import java.util.ArrayList;
  import java.util.List;
  
  import javax.xml.bind.JAXBContext;
  import javax.xml.bind.JAXBException;
  import javax.xml.bind.Marshaller;
  
  public class Test {
      public static void main(String[] args) {
  
          EmployeeConstruction ec = new EmployeeConstruction();
          ec.setName("Construction employee");
          ec.setSomeContrction("construction bulding");
  
          EmployeesElement&lt;EmployeeConstruction&gt; ee = new EmployeesElement&lt;EmployeeConstruction&gt;();
  
          List&lt;EmployeeConstruction&gt; list = new ArrayList&lt;EmployeeConstruction&gt;();
          list.add(ec);
          ee.setEmployees(list);
  
          Snapshots&lt;EmployeeConstruction&gt; snapshots = new Snapshots&lt;EmployeeConstruction&gt;();
          snapshots.setEmployeesElement(ee);
  
          JAXBContext jaxbContext;
          try {
              jaxbContext = JAXBContext.newInstance(Snapshots.class);
  
              Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
  
              jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
  
              jaxbMarshaller.marshal(snapshots, System.out);
  
          } catch (JAXBException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
      }
  }
  
  
  package com.mycompany.soma.ws.rest.v1.model.test;
  
  import javax.xml.bind.annotation.XmlAccessType;
  import javax.xml.bind.annotation.XmlAccessorType;
  import javax.xml.bind.annotation.XmlElement;
  import javax.xml.bind.annotation.XmlRootElement;
  import javax.xml.bind.annotation.XmlType;
  
  
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(name = "", propOrder = {"employeesElement"})
  @XmlRootElement(name = "snapshots")
  public class Snapshots&lt;T&gt; {
  
      @XmlElement(name = "employees")
      private EmployeesElement&lt;T&gt; employeesElement;
  
  
      public EmployeesElement&lt;T&gt; getEmployeesElement() {
          return employeesElement;
      }
  
      public void setEmployeesElement(EmployeesElement&lt;T&gt; employeesElement) {
          this.employeesElement = employeesElement;
      }
  }
  
  
  
  package com.mycompany.soma.ws.rest.v1.model.test;
  
  import java.util.List;
  
  import javax.xml.bind.annotation.XmlAccessType;
  import javax.xml.bind.annotation.XmlAccessorType;
  import javax.xml.bind.annotation.XmlElement;
  import javax.xml.bind.annotation.XmlRootElement;
  import javax.xml.bind.annotation.XmlType;
  
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlRootElement(name = "employees")
  public class EmployeesElement&lt;T&gt; {
      @XmlElement(name = "employees", nillable = true, required = false)
      List&lt;T&gt; employees;
  
      public List&lt;T&gt; getEmployees() {
          return employees;
      }
  
      public void setEmployees(List&lt;T&gt; employees) {
          this.employees = employees;
      }
  
  }
  
  
  package com.mycompany.soma.ws.rest.v1.model.test;
  
  import javax.xml.bind.annotation.XmlAccessType;
  import javax.xml.bind.annotation.XmlAccessorType;
  import javax.xml.bind.annotation.XmlElement;
  import javax.xml.bind.annotation.XmlRootElement;
  import javax.xml.bind.annotation.XmlSeeAlso;
  import javax.xml.bind.annotation.XmlType;
  
  @XmlRootElement(name = "wsemployee")
  @XmlType(name = "", propOrder = {"name"})
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlSeeAlso({EmployeeConstruction.class, EmployeeManager.class})
  public class Employee {
      @XmlElement(required = true)
      protected String name;
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
  
  }
  
  
  package com.mycompany.soma.ws.rest.v1.model.test;
  
  import javax.xml.bind.annotation.XmlAccessType;
  import javax.xml.bind.annotation.XmlAccessorType;
  import javax.xml.bind.annotation.XmlElement;
  import javax.xml.bind.annotation.XmlRootElement;
  import javax.xml.bind.annotation.XmlType;
  import javax.xml.bind.annotation.XmlSeeAlso;
  
  
  @XmlRootElement(name = "employee")
  @XmlType(name = "", propOrder = {"someContrction"})
  @XmlAccessorType(XmlAccessType.FIELD)
  public class EmployeeConstruction extends Employee {
  
      @XmlElement(required = true)
      protected String someContrction;
  
      public String getSomeContrction() {
          return someContrction;
      }
  
      public void setSomeContrction(String someContrction) {
          this.someContrction = someContrction;
      }
  
  }
  
  
  package com.mycompany.soma.ws.rest.v1.model.test;
  
  import java.util.List;
  
  import javax.xml.bind.annotation.XmlAccessType;
  import javax.xml.bind.annotation.XmlAccessorType;
  import javax.xml.bind.annotation.XmlElement;
  import javax.xml.bind.annotation.XmlRootElement;
  import javax.xml.bind.annotation.XmlType;
  
  @XmlRootElement(name = "employee")
  @XmlType(name = "", propOrder = {"someManaging"})
  @XmlAccessorType(XmlAccessType.FIELD)
  public class EmployeeManager extends Employee {
  
      @XmlElement(required = true)
      protected String someManaging;
  
      public String getSomeManaging() {
          return someManaging;
      }
  
      public void setSomeManaging(String someManaging) {
          this.someManaging = someManaging;
      }
  
  }
  </code></pre>