--- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/MtomCodec.java 2014-03-28 17:28:39.000000000 +0100 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/MtomCodec.java 2014-03-28 17:28:39.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -112,9 +112,15 @@ } public static ContentType getStaticContentTypeStatic(Packet packet, SOAPVersion version) { - ContentType ct = (ContentType) packet.getInternalContentType(); - if ( ct != null ) return ct; - + ContentTypeImpl ct = (ContentTypeImpl) packet.getInternalContentType(); + if ( ct != null ) { + //Note - this case of boundary = null or root content ID = null should never happen + //after a recent bug fix in Packet.shouldUseMtom logic, but just in + //case we get here with a Packet that has a non-null content type with + //a null boundary, the content type of the Packet will be reset + if (ct.getBoundary() != null && ct.getRootId() != null) + return ct; + } String uuid = UUID.randomUUID().toString(); String boundary = "uuid:" + uuid; String rootId = ""; @@ -327,7 +333,7 @@ } public static class MtomStreamWriterImpl extends XMLStreamWriterFilter implements XMLStreamWriterEx, - MtomStreamWriter, HasEncoding { + com.sun.xml.internal.org.jvnet.staxex.util.MtomStreamWriter, HasEncoding { private final List mtomAttachments; private final String boundary; private final MTOMFeature myMtomFeature;