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

arg0 element with empty default namespace declaration is assigned namespace

    XMLWordPrintable

Details

    • generic
    • generic

    Description

      FULL PRODUCT VERSION :
      java version "1.8.0_45"
      Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Development: Darwin jackmac 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
      Deployment: Linux linuxserver116 2.6.32-431.5.1.el6.x86_64 #1 SMP Fri Jan 10 14:46:43 EST 2014 x86_64 x86_64 x86_64 GNU/Linux

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      The web service project uses Spring 4.1.6.RELEASE and Jetty 4.1.6.RELEASE.

      A DESCRIPTION OF THE PROBLEM :
      XML messages which uses default namespaces for qualified names are not parsed correctly. The arg0 element of requests, that requires the null namespace, is assigned the previous default namespace even when it has an empty default namespace attribute (xmlns="").

      Same messages work when the parent element of arg0 has its namespace prefixed instead of defaulted, the arg0 element is then parsed correctly with no namespace.

      Debugging has revealed that the method com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl#circumventBug5034339 is responsible for the incorrect namespace assignment. It is called by the parser in Java 8 but not Java 6.

      REGRESSION. Last worked in version 6u45

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.6.0_65"
      Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
      Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Parse the message
      "<?xml version="1.0" encoding="utf-16"?>
      <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
        <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <railAvail xmlns="http://www.opentravel.org/OTA/2003/05">
            <arg0 xmlns="" CorrelationID="6e4a61f0-7da7-414a-b392-9e841c6aec64">
              <POS xmlns="http://www.opentravel.org/OTA/2003/05">
                <Source TerminalID="70000001" />
              </POS>
              <RailAvailQuery xmlns="http://www.opentravel.org/OTA/2003/05">
                <AvailBaseQueryCriteria>
                  <OriginDestinationInformation>
                    <DepartureDateTime WindowBefore="PT4H" WindowAfter="PT12H" CrossDateAllowedIndicator="false">2015-06-15T08:00:00.0000000+02:00</DepartureDateTime>
                    <OriginLocation LocationCode="7622340" CodeContext="NSB-STATION" />
                    <DestinationLocation LocationCode="7601000" CodeContext="NSB-STATION" />
                  </OriginDestinationInformation>
                </AvailBaseQueryCriteria>
              </RailAvailQuery>
            </arg0>
          </railAvail>
        </s:Body>
      </s:Envelope>"

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The attribute xmlns="" should prevent the arg0 element from being assigned the default namespace during parsing, and a RailAvail message object should be provided to the web service.
      ACTUAL -
      The arg0 element is assigned its parent's default namespace during parsing, the message is not recognized and a null pointer is provided to the web service.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Using prefixed namespaces is a possible workaround, but our customers are unable to do so.

      Attachments

        Issue Links

          Activity

            People

              aefimov Aleksej Efimov
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: