title: IllegalAnnotationExceptions There's no ObjectFactory with an @XmlElementDecl for the element
body: <p>I got the following error while running the project on the command prompt with </p>
  
  <pre><code>java com.javavids.jaxb.sitemap.main.Main
  </code></pre>
  
  <p>I got the following error </p>
  
  <pre><code>Exception in thread "main"    com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
  There's no ObjectFactory with an @XmlElementDecl for the element {unison}FromTime.
      this problem is related to the following location:
              at protected java.util.List com.javavids.jaxb.sitemap.UPM.Test.dateOrStartDateOrEndDate
              at com.javavids.jaxb.sitemap.UPM.Test
              at protected java.util.List com.javavids.jaxb.sitemap.UPM.Condition.content
              at com.javavids.jaxb.sitemap.UPM.Condition
              at protected com.javavids.jaxb.sitemap.UPM.Condition com.javavids.jaxb.sitemap.UPM.Rule.condition
              at com.javavids.jaxb.sitemap.UPM.Rule
              at protected java.util.List com.javavids.jaxb.sitemap.UPM.Policy.rule
              at com.javavids.jaxb.sitemap.UPM.Policy
              at protected java.util.List com.javavids.jaxb.sitemap.UPM.Configuration.policyOrConditionOrActionList
              at com.javavids.jaxb.sitemap.UPM.Configuration
              at protected com.javavids.jaxb.sitemap.UPM.Configuration com.javavids.jaxb.sitemap.UPM.BMWebgateConf.configuration
  at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(Unknown Source)
  at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(Unknown Source)
  at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.&lt;init&gt;(Unknown Source)
  at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.&lt;init&gt;(Unknown Source)
  at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(Unknown Source)
  at com.sun.xml.internal.bind.v2.ContextFactory.createContext(Unknown Source)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
  at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
  at javax.xml.bind.ContextFinder.find(Unknown Source)
  at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
  at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
  at com.javavids.jaxb.sitemap.main.Main.main(Main.java:55)
  </code></pre>
  
  <p>Source:
  com/javavids/jaxb/sitemap/UPM/Test.java</p>
  
  <pre><code>@XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(name = "", propOrder = {
  "conditionRef",
  "attribute",
  "op",
  "dateOrStartDateOrEndDate",
  "listRef",
  "value"
   })
  @XmlRootElement(name = "Test")
  
  public class Test {
  
  @XmlElement(name = "ConditionRef")
  protected String conditionRef;
  @XmlElement(name = "Attribute")
  protected String attribute;
  @XmlElement(name = "Op")
  protected String op;
  @XmlElementRefs({
  
      @XmlElementRef(name = "FromTime", namespace = "unison", type = JAXBElement.class, required = false),
      @XmlElementRef(name = "Date", namespace = "unison", type = JAXBElement.class, required = false),
      @XmlElementRef(name = "DurationInDays", namespace = "unison", type = JAXBElement.class, required = false),
      @XmlElementRef(name = "EndDate", namespace = "unison", type = JAXBElement.class, required = false),
      @XmlElementRef(name = "StartDate", namespace = "unison", type = JAXBElement.class, required = false),
      @XmlElementRef(name = "ToTime", namespace = "unison", type = JAXBElement.class, required = false),
      @XmlElementRef(name = "Weekday", namespace = "unison", type = JAXBElement.class, required = false),
      @XmlElementRef(name = "Frequency", namespace = "unison", type = JAXBElement.class, required = false)
  })
  protected List&lt;JAXBElement&lt;? extends Serializable&gt;&gt; dateOrStartDateOrEndDate;
  @XmlElement(name = "ListRef")
  protected String listRef;
  @XmlElement(name = "Value")
  protected String value;
  @XmlAttribute(name = "Type", required = true)
  protected String type;
  
  
   public List&lt;JAXBElement&lt;? extends Serializable&gt;&gt; getDateOrStartDateOrEndDate() {
      if (dateOrStartDateOrEndDate == null) {
          dateOrStartDateOrEndDate = new ArrayList&lt;JAXBElement&lt;? extends Serializable&gt;&gt;();
      }
      return this.dateOrStartDateOrEndDate;
  }
  </code></pre>
  
  <p>Source:
  com/javavids/jaxb/sitemap/UPM/ObjectFactory.java</p>
  
  <pre><code>@XmlRegistry
  public class ObjectFactory {
  
  private final static QName _StartDate_QNAME = new QName("unison", "StartDate");    
  private final static QName _Date_QNAME = new QName("unison", "Date");
  private final static QName _ToTime_QNAME = new QName("unison", "ToTime");
  private final static QName _CreateTime_QNAME = new QName("unison", "CreateTime");
  private final static QName _EndDate_QNAME = new QName("unison", "EndDate");
  private final static QName _FromTime_QNAME = new QName("unison", "FromTime");
  private final static QName _DurationInDays_QNAME = new QName("unison", "DurationInDays");
  private final static QName _ImportTime_QNAME = new QName("unison", "ImportTime");
  private final static QName _Frequency_QNAME = new QName("unison", "Frequency");
  private final static QName _Weekday_QNAME = new QName("unison", "Weekday");
  
  @XmlElementDecl(namespace = "unison", name = "StartDate")
  public JAXBElement&lt;String&gt; createStartDate(String value) {
      return new JAXBElement&lt;String&gt;(_StartDate_QNAME, String.class, null, value);
  }
  
  @XmlElementDecl(namespace = "unison", name = "FromTime")
  public JAXBElement&lt;String&gt; createFromTime(String value) {
      return new JAXBElement&lt;String&gt;(_FromTime_QNAME, String.class, null, value);
  }
  </code></pre>
  
  <p>Source: 
  com/javavids/jaxb/sitemap/main/Main.java</p>
  
  <pre><code>public static void main(String[] args) throws JAXBException {
  
      File file = new File("C:\\Users\\t_pavans\\workspace\\jaxbTest1\\medialossy.xml");
  
      JAXBContext jaxbContext = JAXBContext.newInstance(com.javavids.jaxb.sitemap.UPM.BMWebgateConf.class);
      Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
  
      //BMWebgate Root element variables
      bmw = (BMWebgateConf) jaxbUnmarshaller.unmarshal(file);
  </code></pre>
  
  <p>NOTE: The code work completely fine on my Eclipse. But when I try to run on command prompt, it throws and exception</p>