Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-249

NPE on DatatypeConverter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0.0
    • 1.5.0
    • None
    • None
    • MacOS JDK 1.7.0_05 & Windows JDK 1.7.0_04

    Description

      When using the method DatatypeConverter.printBase64Binary a NullPointerException occurs.

      java.lang.NullPointerException
      javax.xml.bind.DatatypeConverter.printBase64Binary(DatatypeConverter.java:173)
      Servlet.doGet(Servlet.java:17)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

      The following example servlet will throw the NPE:

      @WebServlet("/npe")
      public class Servlet extends HttpServlet {

      @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException

      { String s = DatatypeConverter.printBase64Binary("TomEE & JAXB!".getBytes(StandardCharsets.UTF_8)); resp.getWriter().write(s); }

      }

      A workaround is to remove the JAXB jars from the lib & endorsed directories. My application seems to work fine but I have no idea what (hidden) problems this might cause.

      Attachments

        Activity

          People

            Unassigned Unassigned
            harrol Harro Lissenberg
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: