WLS 10.3: Java.Lang.IllegalArgumentException: The Local Name Of An Attribute May Not Be Null

(Doc ID 1118445.1)

Last updated on MARCH 29, 2017

Applies to:

Oracle Weblogic Server - Version 10.3 and later
Information in this document applies to any platform.
***Checked for relevance on 3-Sept-2013***

Symptoms

During the creation of the SOAP Headers in the SOAP Message by the W3C or DOM API's the below exception would be thrown.

<WSEE:14>****** About to unmarshal the following xml text:

<WSEE:14>java.lang.IllegalArgumentException: The local name of an attribute may not be null
at weblogic.xml.dom.DOMStreamWriter.writeAttribute(DOMStreamWriter.java:196)
at weblogic.xml.stax.ReaderToWriter.write(ReaderToWriter.java:75)
at weblogic.xml.stax.ChildReaderToWriter.writeChildren(ChildReaderToWriter.java:43)
at weblogic.wsee.message.UnknownMsgHeader.write(UnknownMsgHeader.java:102)
at weblogic.wsee.message.MsgHeader.writeToParent(MsgHeader.java:142)
at weblogic.wsee.message.soap.SoapMsgHeaders.addHeaderInternal(SoapMsgHeaders.java:103)
at weblogic.wsee.message.soap.SoapMsgHeaders.addHeader(SoapMsgHeaders.java:87)
at weblogic.wsee.ws.dispatch.client.ConnectionHandler.writeOutputHeaders(ConnectionHandler.java:163)
at weblogic.wsee.ws.dispatch.client.ConnectionHandler.handleRequest(ConnectionHandler.java:70)
at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:141)
at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:107)

The code for creating SOAP headers in the SOAP message is given below:

Document document = builder.newDocument();
Element idElement = document.createElementNS( "http://ws.iona.com/sessionmanager","sm:id" );
idElement.setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance","xsi:type","ses:SessionId");
Element endpointElement = document.createElement( "endpoint_group" );
endpointElement.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:type","http://www.w3.org/2001/XMLSchema:string");
endpointElement.appendChild(document.createTextNode(sessionEndPointGroup));
Element nameElement = document.createElement("name");
...
binaryTokenElement.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:type","oas:BinarySecurityTokenType");
binaryTokenElement.setAttribute( "ValueType", "..." );
...

Changes

This happened when the application was upgraded from WLS 8.1 SP5 to WLS 10.3. They are
facing errors after upgrading the controls in their application.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms