cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1510698 - in /cxf/branches/2.7.x-fixes: api/src/main/java/org/apache/cxf/common/jaxb/ rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/ rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/ rt/frontend/jaxrs/src/main/java/org/apache/...
Date Mon, 05 Aug 2013 20:13:20 GMT
Author: dkulp
Date: Mon Aug  5 20:13:18 2013
New Revision: 1510698

URL: http://svn.apache.org/r1510698
Log:
Merged revisions 1502893 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1502893 | dkulp | 2013-07-13 17:30:02 -0400 (Sat, 13 Jul 2013) | 2 lines

  Initial support for using eclipselink Moxy instead of the JAXB ri.  Many tests will still
fail with it, but most of the simpler things are now working.

........

Modified:
    cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java
    cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
    cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
    cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
    cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java

Modified: cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java?rev=1510698&r1=1510697&r2=1510698&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java (original)
+++ cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java Mon
Aug  5 20:13:18 2013
@@ -37,6 +37,8 @@ import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -68,7 +70,6 @@ import org.w3c.dom.Node;
 import org.xml.sax.EntityResolver;
 import org.xml.sax.InputSource;
 
-import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.ASMHelper;
 import org.apache.cxf.common.util.ASMHelper.ClassWriter;
 import org.apache.cxf.common.util.ASMHelper.FieldVisitor;
@@ -115,7 +116,6 @@ public final class JAXBUtils {
     
     private static final Map<String, String> BUILTIN_DATATYPES_MAP;
     private static final Map<String, Class<?>> HOLDER_TYPES_MAP;
-    private static final Logger LOG = LogUtils.getL7dLogger(JAXBUtils.class);
     private static ClassLoader jaxbXjcLoader;
 
     static {
@@ -578,28 +578,20 @@ public final class JAXBUtils {
             throw new JAXBException(e);
         }
     }
-    public static void setNamespaceWrapper(final Map<String, String> nspref,
+    public static Object setNamespaceWrapper(final Map<String, String> nspref,
                                            Marshaller marshaller) throws PropertyException
{
-        Object mapper = null;
+        Object mapper = createNamespaceWrapper(marshaller.getClass(), nspref);
         if (marshaller.getClass().getName().contains(".internal.")) {
-            mapper = createNamespaceWrapper(nspref);
-            if (mapper == null) {
-                LOG.log(Level.INFO, "Could not create namespace mapper for JDK internal"
-                        + " JAXB implementation.");
-            } else {
-                marshaller.setProperty("com.sun.xml.internal.bind.namespacePrefixMapper",
+            marshaller.setProperty("com.sun.xml.internal.bind.namespacePrefixMapper",
                                    mapper);
-            }
-        } else {
-            try {
-                Class<?> cls = Class.forName("org.apache.cxf.common.jaxb.NamespaceMapper");
-                mapper = cls.getConstructor(Map.class).newInstance(nspref);
-            } catch (Exception ex) {
-                LOG.log(Level.INFO, "Could not create NamespaceMapper", ex);
-            }
+        } else if (marshaller.getClass().getName().contains("com.sun")) {
             marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper",
                                    mapper);
+        } else if (marshaller.getClass().getName().contains("eclipse")) {
+            marshaller.setProperty("eclipselink.namespace-prefix-mapper",
+                                   mapper);
         }
+        return mapper;
     }
     public static BridgeWrapper createBridge(Set<Class<?>> ctxClasses,
                                       QName qname,
@@ -1028,16 +1020,26 @@ public final class JAXBUtils {
         return false;
     }
     
-    private static synchronized Object createNamespaceWrapper(Map<String, String> map)
{
+    private static synchronized Object createNamespaceWrapper(Class<?> mcls, Map<String,
String> map) {
         ASMHelper helper = new ASMHelper();
-        String className = "org.apache.cxf.jaxb.NamespaceMapperInternal";
+        String className = "org.apache.cxf.jaxb.NamespaceMapper";
+        String postFix = ""; 
+        if (mcls.getName().contains("eclipse")) {
+            //can use the map directly
+            return map;
+        } else if (mcls.getName().contains(".internal")) {
+            postFix = "Internal";
+        } else if (mcls.getName().contains("com.sun")) {
+            postFix = "RI";
+        }
+        className += postFix;
         Class<?> cls = helper.findClass(className, JAXBUtils.class);
         if (cls == null) {
             ClassWriter cw = helper.createClassWriter();
             if (cw == null) {
                 return null;
             }
-            cls = createNamespaceWrapperInternal(helper, cw);
+            cls = createNamespaceWrapperInternal(helper, cw, postFix, mcls);
         }
         try {
             return cls.getConstructor(Map.class).newInstance(map);
@@ -1045,14 +1047,18 @@ public final class JAXBUtils {
             return null;
         }
     }
-    private static Class<?> createNamespaceWrapperInternal(ASMHelper helper, ClassWriter
cw) {
-        String className = "org.apache.cxf.jaxb.NamespaceMapperInternal";
+    private static Class<?> createNamespaceWrapperInternal(ASMHelper helper, ClassWriter
cw, 
+                                                           String postFix, Class<?>
ref) {
+        String className = "org.apache.cxf.jaxb.NamespaceMapper" + postFix;
+        String superName = "com/sun/xml/" 
+            + ("RI".equals(postFix) ? "" : "internal/") 
+            + "bind/marshaller/NamespacePrefixMapper";
         FieldVisitor fv;
         MethodVisitor mv;
         cw.visit(Opcodes.V1_5, 
                  Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL + Opcodes.ACC_SUPER,
-                 "org/apache/cxf/jaxb/NamespaceMapperInternal", null,
-                 "com/sun/xml/internal/bind/marshaller/NamespacePrefixMapper", null);
+                 "org/apache/cxf/jaxb/NamespaceMapper" + postFix, null,
+                 superName, null);
 
         cw.visitSource("NamespaceMapper.java", null);
 
@@ -1070,13 +1076,13 @@ public final class JAXBUtils {
         mv.visitLineNumber(30, l0);
         mv.visitVarInsn(Opcodes.ALOAD, 0);
         mv.visitMethodInsn(Opcodes.INVOKESPECIAL,
-                           "com/sun/xml/internal/bind/marshaller/NamespacePrefixMapper",
"<init>", "()V");
+                           superName, "<init>", "()V");
         Label l1 = helper.createLabel();
         mv.visitLabel(l1);
         mv.visitLineNumber(31, l1);
         mv.visitVarInsn(Opcodes.ALOAD, 0);
         mv.visitVarInsn(Opcodes.ALOAD, 1);
-        mv.visitFieldInsn(Opcodes.PUTFIELD, "org/apache/cxf/jaxb/NamespaceMapperInternal",
+        mv.visitFieldInsn(Opcodes.PUTFIELD, "org/apache/cxf/jaxb/NamespaceMapper" + postFix,
                           "nspref", "Ljava/util/Map;");
         Label l2 = helper.createLabel();
         mv.visitLabel(l2);
@@ -1084,7 +1090,7 @@ public final class JAXBUtils {
         mv.visitInsn(Opcodes.RETURN);
         Label l3 = helper.createLabel();
         mv.visitLabel(l3);
-        mv.visitLocalVariable("this", "Lorg/apache/cxf/jaxb/NamespaceMapperInternal;", null,
l0, l3, 0);
+        mv.visitLocalVariable("this", "Lorg/apache/cxf/jaxb/NamespaceMapper" + postFix +
";", null, l0, l3, 0);
         mv.visitLocalVariable("nspref", "Ljava/util/Map;",
                               "Ljava/util/Map<Ljava/lang/String;Ljava/lang/String;>;",

                               l0, l3, 1);
@@ -1100,7 +1106,7 @@ public final class JAXBUtils {
         mv.visitLineNumber(38, l0);
         mv.visitVarInsn(Opcodes.ALOAD, 0);
         mv.visitFieldInsn(Opcodes.GETFIELD, 
-                          "org/apache/cxf/jaxb/NamespaceMapperInternal", 
+                          "org/apache/cxf/jaxb/NamespaceMapper" + postFix, 
                           "nspref", "Ljava/util/Map;");
         mv.visitVarInsn(Opcodes.ALOAD, 1);
         mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/Map", 
@@ -1124,7 +1130,7 @@ public final class JAXBUtils {
         mv.visitInsn(Opcodes.ARETURN);
         Label l4 = helper.createLabel();
         mv.visitLabel(l4);
-        mv.visitLocalVariable("this", "Lorg/apache/cxf/jaxb/NamespaceMapperInternal;", null,
l0, l4, 0);
+        mv.visitLocalVariable("this", "Lorg/apache/cxf/jaxb/NamespaceMapper" + postFix +
";", null, l0, l4, 0);
         mv.visitLocalVariable("namespaceUri", "Ljava/lang/String;", null, l0, l4, 1);
         mv.visitLocalVariable("suggestion", "Ljava/lang/String;", null, l0, l4, 2);
         mv.visitLocalVariable("requirePrefix", "Z", null, l0, l4, 3);
@@ -1134,22 +1140,8 @@ public final class JAXBUtils {
         cw.visitEnd();
 
         byte bts[] = cw.toByteArray();
-        
-        
-        Class<?> cls;
-        try {
-            cls = Class.forName("com.sun.xml.bind.api.JAXBRIContext");
-        } catch (ClassNotFoundException e) {
-            // TODO Auto-generated catch block
-            try {
-                cls = Class.forName("com.sun.xml.internal.bind.api.JAXBRIContext", true,
getXJCClassLoader());
-            } catch (ClassNotFoundException e1) {
-                cls = JAXBUtils.class;
-            }
-        }
-        
         return helper.loadClass(className,
-                                cls, bts);
+                                ref, bts);
     }
     
     public static JAXBContextProxy createJAXBContextProxy(final JAXBContext ctx) {
@@ -1170,6 +1162,9 @@ public final class JAXBUtils {
         if (o == null) {
             return null;
         }
+        if (o instanceof JAXBBeanInfo) {
+            return (JAXBBeanInfo)o;
+        }
         return ReflectionInvokationHandler.createProxyWrapper(o, JAXBBeanInfo.class);
     }
 

Modified: cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java?rev=1510698&r1=1510697&r2=1510698&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
Mon Aug  5 20:13:18 2013
@@ -71,7 +71,6 @@ import org.apache.cxf.common.logging.Log
 import org.apache.cxf.common.util.ModCountCopyOnWriteArrayList;
 import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.common.util.PropertyUtils;
-import org.apache.cxf.common.util.ReflectionInvokationHandler;
 import org.apache.cxf.common.util.ReflectionUtil;
 import org.apache.cxf.common.xmlschema.SchemaCollection;
 import org.apache.cxf.databinding.AbstractDataBinding;
@@ -432,14 +431,13 @@ public class JAXBDataBinding extends Abs
         Annotation[] anns = (Annotation[])mpi.getProperty("parameter.annotations");
         JAXBContextProxy ctx = JAXBUtils.createJAXBContextProxy(context, schemaCollection,
ns);
         XmlJavaTypeAdapter jta = JAXBSchemaInitializer.findFromTypeAdapter(ctx, mpi.getTypeClass(),
anns);
-        JAXBBeanInfo jtaBeanInfo = null;
         if (jta != null) {
-            jtaBeanInfo = JAXBSchemaInitializer.findFromTypeAdapter(ctx, jta.value());
-        }
-        JAXBBeanInfo beanInfo = JAXBSchemaInitializer.getBeanInfo(ctx, mpi.getTypeClass());
-        if (jtaBeanInfo != beanInfo && jta != null) {
-            mpi.setProperty("parameter.annotations", anns);
-            mpi.setProperty("honor.jaxb.annotations", Boolean.TRUE);
+            JAXBBeanInfo jtaBeanInfo = JAXBSchemaInitializer.findFromTypeAdapter(ctx, jta.value());
+            JAXBBeanInfo beanInfo = JAXBSchemaInitializer.getBeanInfo(ctx, mpi.getTypeClass());
+            if (jtaBeanInfo != beanInfo) {
+                mpi.setProperty("parameter.annotations", anns);
+                mpi.setProperty("honor.jaxb.annotations", Boolean.TRUE);
+            }
         }
     }
 

Modified: cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java?rev=1510698&r1=1510697&r2=1510698&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
Mon Aug  5 20:13:18 2013
@@ -552,6 +552,9 @@ public final class JAXBEncoderDecoder {
                         }
                     }                
                 }
+                if (reader.getEventType() == XMLStreamReader.END_ELEMENT && q.equals(reader.getName()))
{
+                    reader.next();
+                }
             }
             return (Exception)obj;
         } catch (Exception e) {

Modified: cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java?rev=1510698&r1=1510697&r2=1510698&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
Mon Aug  5 20:13:18 2013
@@ -51,7 +51,6 @@ import org.apache.cxf.common.jaxb.JAXBBe
 import org.apache.cxf.common.jaxb.JAXBContextProxy;
 import org.apache.cxf.common.jaxb.JAXBUtils;
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.common.util.ReflectionInvokationHandler;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.common.xmlschema.SchemaCollection;
 import org.apache.cxf.interceptor.Fault;

Modified: cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java?rev=1510698&r1=1510697&r2=1510698&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
Mon Aug  5 20:13:18 2013
@@ -48,8 +48,8 @@ import org.w3c.dom.Node;
 import org.apache.cxf.Bus;
 import org.apache.cxf.binding.BindingFactoryManager;
 import org.apache.cxf.common.jaxb.JAXBContextProxy;
+import org.apache.cxf.common.jaxb.JAXBUtils;
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.common.util.ReflectionInvokationHandler;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.databinding.DataWriter;
 import org.apache.cxf.helpers.CastUtils;
@@ -65,6 +65,7 @@ import org.apache.hello_world_soap_http.
 import org.apache.hello_world_soap_http.types.GreetMeOneWay;
 import org.easymock.EasyMock;
 import org.easymock.IMocksControl;
+
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -184,13 +185,16 @@ public class JAXBDataBindingTest extends
         Set<Class<?>> classes = new HashSet<Class<?>>();
         classes.add(ObjectFactory.class);
         JAXBContext ctx = db.createJAXBContext(classes);
-        JAXBContextProxy ctxp = ReflectionInvokationHandler.createProxyWrapper(ctx, JAXBContextProxy.class);
+        JAXBContextProxy ctxp = JAXBUtils.createJAXBContextProxy(ctx);
         assertNotNull(JAXBSchemaInitializer.getBeanInfo(ctxp, TestJAXBClass.class));
     }
     
     @Test 
     public void testContextProperties() throws Exception {
         JAXBDataBinding db = new JAXBDataBinding();
+        Map<String, String> nsMap = new HashMap<String, String>();
+        nsMap.put("uri:ultima:thule", "");
+        db.setNamespaceMap(nsMap);
         Map<String, Object> contextProperties = new HashMap<String, Object>();
         contextProperties.put("com.sun.xml.bind.defaultNamespaceRemap", "uri:ultima:thule");
         db.setContextProperties(contextProperties);
@@ -206,7 +210,7 @@ public class JAXBDataBindingTest extends
         writer.write(bean, xmlWriter);
         xmlWriter.flush();
         String xml = stringWriter.toString();
-        assertTrue(xml.contains("uri:ultima:thule"));
+        assertTrue(xml, xml.contains("uri:ultima:thule"));
     }
     
     @Test
@@ -216,7 +220,7 @@ public class JAXBDataBindingTest extends
         nsMap.put("uri:ultima:thule", "greenland");
         db.setNamespaceMap(nsMap);
         Map<String, Object> contextProperties = new HashMap<String, Object>();
-        contextProperties.put("com.sun.xml.bind.defaultNamespaceRemap", "uri:ultima:thule");
+        //contextProperties.put("com.sun.xml.bind.defaultNamespaceRemap", "uri:ultima:thule");
         db.setContextProperties(contextProperties);
         Set<Class<?>> classes = new HashSet<Class<?>>();
         classes.add(QualifiedBean.class);

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java?rev=1510698&r1=1510697&r2=1510698&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
Mon Aug  5 20:13:18 2013
@@ -76,7 +76,6 @@ import org.apache.cxf.common.jaxb.JAXBCo
 import org.apache.cxf.common.jaxb.JAXBUtils;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.PackageUtils;
-import org.apache.cxf.common.util.ReflectionInvokationHandler;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.common.util.XmlSchemaPrimitiveUtils;
 import org.apache.cxf.common.xmlschema.SchemaCollection;
@@ -1327,8 +1326,7 @@ public class WadlGenerator implements Re
         }
         if (useJaxbContextForQnames) {
             if (context != null) {
-                JAXBContextProxy proxy = ReflectionInvokationHandler
-                    .createProxyWrapper(context, JAXBContextProxy.class);
+                JAXBContextProxy proxy = JAXBUtils.createJAXBContextProxy(context);
                 return new JaxbContextQNameResolver(proxy);
             } else {
                 return null;

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java?rev=1510698&r1=1510697&r2=1510698&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
Mon Aug  5 20:13:18 2013
@@ -68,7 +68,6 @@ import org.xml.sax.helpers.DefaultHandle
 
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.jaxb.JAXBUtils;
-import org.apache.cxf.common.jaxb.NamespaceMapper;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.jaxrs.ext.MessageContext;
@@ -140,11 +139,9 @@ public abstract class AbstractJAXBProvid
     
     protected void setNamespaceMapper(Marshaller ms, 
                                       Map<String, String> map) throws Exception {
-        NamespaceMapper nsMapper = new NamespaceMapper(map);
+        Object nsMapper = JAXBUtils.setNamespaceWrapper(map, ms);
         if (namespaceMapperPropertyName != null) {
             setMarshallerProp(ms, nsMapper, namespaceMapperPropertyName, null);
-        } else {
-            setMarshallerProp(ms, nsMapper, NS_MAPPER_PROPERTY_RI, NS_MAPPER_PROPERTY_RI_INT);
         }
     }
     



Mime
View raw message