title: Access restriction on jdk1.7/jre/lib/rt.jar
body: <p>hi folks I faced a very strange while creating my JAXB parser. When i tried to generate JAXB classes from eclipse then in one class it shows a very Strange error which is</p>
  
  <pre><code>Access restriction: The type QName is not accessible due to restriction on required library /usr/lib/jvm/jdk1.7.0_02/jre/lib/rt.jar
  </code></pre>
  
  <p>this is my class</p>
  
  <pre><code>package generated;
  
  import javax.xml.bind.JAXBElement;
  import javax.xml.bind.annotation.XmlElementDecl;
  import javax.xml.bind.annotation.XmlRegistry;
  //import javax.xml.namespace.QName;
  import javax.xml.namespace.*;
  
  
  @XmlRegistry
  public class ObjectFactory {
  </code></pre>
  
  <p>AND HERE ON THIS LINE I AM GETTING THE ERROR MESSAGE</p>
  
  <p>private final static QName _ExpenseReport_QNAME = new QName("", "expenseReport");</p>
  
  <pre><code>    /**
       * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: generated
       * 
       */
      public ObjectFactory() {
      }
  
      /**
       * Create an instance of {@link ExpenseT }
       * 
       */
      public ExpenseT createExpenseT() {
          return new ExpenseT();
      }
  
      /**
       * Create an instance of {@link UserT }
       * 
       */
      public UserT createUserT() {
          return new UserT();
      }
  
      /**
       * Create an instance of {@link ItemT }
       * 
       */
      public ItemT createItemT() {
          return new ItemT();
      }
  
      /**
       * Create an instance of {@link ItemListT }
       * 
       */
      public ItemListT createItemListT() {
          return new ItemListT();
      }
  
      /**
       * Create an instance of {@link JAXBElement }{@code &lt;}{@link ExpenseT }{@code &gt;}}
       * 
       */
      @XmlElementDecl(namespace = "", name = "expenseReport")
      public JAXBElement&lt;ExpenseT&gt; createExpenseReport(ExpenseT value) {
          return new JAXBElement&lt;ExpenseT&gt;(_ExpenseReport_QNAME, ExpenseT.class, null, value);
      }
  
  }
  </code></pre>