Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8163841

Compiler error package javax.xml.bind does not exist

XMLWordPrintable

    • generic
    • generic

      FULL PRODUCT VERSION :
      java version "9-ea"
      Java(TM) SE Runtime Environment (build 9-ea+130)
      Java HotSpot(TM) 64-Bit Server VM (build 9-ea+130, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Centos 64-bit 6.7
      Linux x2270-01 2.6.32-573.8.1.el6.x86_64 #1 SMP Tue Nov 10 18:01:38 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      This program does not compile:

      package com.unboundid.qa;

      import javax.xml.bind.*;

      public class MaxJaxbTest {
          public static void main(String[] args) {
              try {
                  JAXBContext jc = JAXBContext.newInstance("com.unboundid.qa");
              }
              catch(JAXBException e) {
                  System.err.println("Caught JAXBException.");
              }
          }
      }

      Compiler output:

      MaxJaxbTest.java:3: error: package javax.xml.bind does not exist
      import javax.xml.bind.*;

      REGRESSION. Last worked in version 8u102

      ADDITIONAL REGRESSION INFORMATION:
      java version "9-ea"
      Java(TM) SE Runtime Environment (build 9-ea+130)
      Java HotSpot(TM) 64-Bit Server VM (build 9-ea+130, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      save to file named MaxJaxbTest.java and run javac MaxJaxbTest.java

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      With Java 8 this program compiles
      ACTUAL -
      With JDK 9-130, compiler error package javax.xml.bind does not exist

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      javac MaxJaxbTest.java
      MaxJaxbTest.java:3: error: package javax.xml.bind does not exist
      import javax.xml.bind.*;
      ^
      MaxJaxbTest.java:8: error: cannot find symbol
                  JAXBContext jc = JAXBContext.newInstance("com.unboundid.qa");
                  ^
        symbol: class JAXBContext
        location: class MaxJaxbTest
      MaxJaxbTest.java:8: error: cannot find symbol
                  JAXBContext jc = JAXBContext.newInstance("com.unboundid.qa");
                                   ^
        symbol: variable JAXBContext
        location: class MaxJaxbTest
      MaxJaxbTest.java:10: error: cannot find symbol
              catch(JAXBException e) {
                    ^
        symbol: class JAXBException
        location: class MaxJaxbTest
      4 errors


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package com.unboundid.qa;

      import javax.xml.bind.*;

      public class MaxJaxbTest {
          public static void main(String[] args) {
              try {
                  JAXBContext jc = JAXBContext.newInstance("com.unboundid.qa");
              }
              catch(JAXBException e) {
                  System.err.println("Caught JAXBException.");
              }
          }
      }
      ---------- END SOURCE ----------

            psonal Pallavi Sonal (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: