You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2008/05/01 16:42:39 UTC

svn commit: r652536 - in /cxf/branches/2.0.x-fixes: ./ api/src/main/java/org/apache/cxf/message/ api/src/main/java/org/apache/cxf/service/model/ api/src/main/java/org/apache/cxf/wsdl/ common/common/src/main/java/org/apache/cxf/staxutils/ rt/core/src/ma...

Author: dkulp
Date: Thu May  1 07:42:38 2008
New Revision: 652536

URL: http://svn.apache.org/viewvc?rev=652536&view=rev
Log:
Merged revisions 652503 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r652503 | dkulp | 2008-05-01 08:56:20 -0400 (Thu, 01 May 2008) | 7 lines
  
  [CXF-1560, CXF-1559, CXF-1546]
  * Fix some syncronization issues around the schema access
  * Fix cdata outputting in StaxUtils
  * Add support for querying the Attachments from client side with JAX-WS
........

Modified:
    cxf/branches/2.0.x-fixes/   (props changed)
    cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/message/Message.java
    cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/message/MessageImpl.java
    cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/service/model/SchemaInfo.java
    cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java
    cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
    cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/AbstractDataBinding.java
    cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java
    cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java
    cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java
    cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidatorUtil.java
    cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java

Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/message/Message.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/message/Message.java?rev=652536&r1=652535&r2=652536&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/message/Message.java (original)
+++ cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/message/Message.java Thu May  1 07:42:38 2008
@@ -56,6 +56,7 @@
     String ENCODING = Message.class.getName() + ".ENCODING";
     String FIXED_PARAMETER_ORDER = Message.class.getName() + "FIXED_PARAMETER_ORDER";
     String MAINTAIN_SESSION = Message.class.getName() + ".MAINTAIN_SESSION";
+    String ATTACHMENTS = Message.class.getName() + ".ATTACHMENTS";
 
     String WSDL_DESCRIPTION = "javax.xml.ws.wsdl.description";
     String WSDL_SERVICE = "javax.xml.ws.wsdl.service";

Modified: cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/message/MessageImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/message/MessageImpl.java?rev=652536&r1=652535&r2=652536&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/message/MessageImpl.java (original)
+++ cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/message/MessageImpl.java Thu May  1 07:42:38 2008
@@ -47,6 +47,7 @@
 
     public void setAttachments(Collection<Attachment> attachments) {
         this.attachments = attachments;
+        put(ATTACHMENTS, attachments);
     }
 
     public String getAttachmentMimeType() {

Modified: cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/service/model/SchemaInfo.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/service/model/SchemaInfo.java?rev=652536&r1=652535&r2=652536&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/service/model/SchemaInfo.java (original)
+++ cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/service/model/SchemaInfo.java Thu May  1 07:42:38 2008
@@ -76,10 +76,13 @@
         this.namespaceUri = nsUri;
     }
 
-    public Element getElement() {
+    public synchronized Element getElement() {
         if (element == null && getSchema() != null) {
             CachedOutputStream cout = new CachedOutputStream();
-            getSchema().write(cout);
+            XmlSchema sch = getSchema();
+            synchronized (sch) {
+                getSchema().write(cout);
+            }
             Document sdoc = null;
             try {
                 sdoc = XMLUtils.parse(cout.getInputStream());

Modified: cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java?rev=652536&r1=652535&r2=652536&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java (original)
+++ cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java Thu May  1 07:42:38 2008
@@ -528,14 +528,11 @@
         return null;
     }
     
-    public static Schema getSchema(ServiceInfo serviceInfo) {
-        if (serviceInfo == null) {
-            return null;
-        }
+    
+    private static Schema createSchema(ServiceInfo serviceInfo) {
         Schema schema = serviceInfo.getProperty(Schema.class.getName(), Schema.class);
-        if (schema == null && !serviceInfo.hasProperty(Schema.class.getName())) {
-            SchemaFactory factory = SchemaFactory.newInstance(
-                XMLConstants.W3C_XML_SCHEMA_NS_URI);
+        if (schema == null) {
+            SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
             List<Source> schemaSources = new ArrayList<Source>();
             for (SchemaInfo schemaInfo : serviceInfo.getSchemas()) {
                 Source source = new DOMSource(schemaInfo.getElement());
@@ -558,7 +555,20 @@
                     LOG.log(Level.WARNING, "Schema for: " + schemaInfo.getNamespaceURI() + "\n" + s);
                 }
             }
-            serviceInfo.setProperty(Schema.class.getName(), schema);            
+            serviceInfo.setProperty(Schema.class.getName(), schema);
+        }
+        return schema;
+    }
+    
+    public static Schema getSchema(ServiceInfo serviceInfo) {
+        if (serviceInfo == null) {
+            return null;
+        }
+        Schema schema = serviceInfo.getProperty(Schema.class.getName(), Schema.class);
+        if (schema == null && !serviceInfo.hasProperty(Schema.class.getName())) {
+            synchronized (serviceInfo) {
+                return createSchema(serviceInfo);
+            }
         }
         return schema;
     }

Modified: cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java?rev=652536&r1=652535&r2=652536&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java (original)
+++ cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java Thu May  1 07:42:38 2008
@@ -50,7 +50,6 @@
 import org.w3c.dom.EntityReference;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
 import org.w3c.dom.ProcessingInstruction;
 import org.w3c.dom.Text;
 
@@ -530,11 +529,11 @@
             }
         }
 
-        NodeList nodes = e.getChildNodes();
-        for (int i = 0; i < nodes.getLength(); i++) {
-            Node n = nodes.item(i);
-            writeNode(n, writer, repairing);
-        }
+        Node nd = e.getFirstChild();
+        while (nd != null) {
+            writeNode(nd, writer, repairing);
+            nd = nd.getNextSibling();
+        }       
 
         if (endElement) {
             writer.writeEndElement();
@@ -545,10 +544,10 @@
         throws XMLStreamException {
         if (n instanceof Element) {
             writeElement((Element)n, writer, repairing);
-        } else if (n instanceof Text) {
-            writer.writeCharacters(((Text)n).getNodeValue());
         } else if (n instanceof CDATASection) {
             writer.writeCData(((CDATASection)n).getData());
+        } else if (n instanceof Text) {
+            writer.writeCharacters(((Text)n).getNodeValue());
         } else if (n instanceof Comment) {
             writer.writeComment(((Comment)n).getData());
         } else if (n instanceof EntityReference) {

Modified: cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/AbstractDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/AbstractDataBinding.java?rev=652536&r1=652535&r2=652536&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/AbstractDataBinding.java (original)
+++ cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/AbstractDataBinding.java Thu May  1 07:42:38 2008
@@ -30,7 +30,6 @@
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
 
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.common.xmlschema.SchemaCollection;
@@ -62,20 +61,24 @@
             d.getDocumentElement().setAttribute("targetNamespace", ns);
         }
 
-        NodeList nodes = d.getDocumentElement().getChildNodes();
-        for (int i = 0; i < nodes.getLength(); i++) {
-            Node n = nodes.item(i);
+        Node n = d.getDocumentElement().getFirstChild();
+        while (n != null) { 
             if (n instanceof Element) {
                 Element e = (Element)n;
                 if (e.getLocalName().equals("import")) {
                     e.removeAttribute("schemaLocation");
                 }
             }
+            n = n.getNextSibling();
         }
+
         SchemaInfo schema = new SchemaInfo(serviceInfo, ns);
         schema.setSystemId(systemId);
-        XmlSchema xmlSchema = col.read(d, systemId, null);
-        schema.setSchema(xmlSchema);
+        XmlSchema xmlSchema;
+        synchronized (d) {
+            xmlSchema = col.read(d, systemId, null);
+            schema.setSchema(xmlSchema);
+        }
         serviceInfo.addSchema(schema);
         return xmlSchema;
     }

Modified: cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java?rev=652536&r1=652535&r2=652536&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java (original)
+++ cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java Thu May  1 07:42:38 2008
@@ -93,27 +93,29 @@
                     }
                 }
                 if (schemaElem != null) {
-                    for (Object prefix : def.getNamespaces().keySet()) {
-                        String ns = (String)def.getNamespaces().get(prefix);
-                        if (!"".equals(prefix) && !schemaElem.hasAttribute("xmlns:" + prefix)) {
-                            schemaElem.setAttributeNS(javax.xml.XMLConstants.XMLNS_ATTRIBUTE_NS_URI,
-                                                      "xmlns:" + prefix, ns);
+                    synchronized (schemaElem.getOwnerDocument()) {
+                        for (Object prefix : def.getNamespaces().keySet()) {
+                            String ns = (String)def.getNamespaces().get(prefix);
+                            if (!"".equals(prefix) && !schemaElem.hasAttribute("xmlns:" + prefix)) {
+                                schemaElem.setAttributeNS(javax.xml.XMLConstants.XMLNS_ATTRIBUTE_NS_URI,
+                                                          "xmlns:" + prefix, ns);
+                            }
                         }
+                        String systemId = def.getDocumentBaseURI() + "#types" + schemaCount;
+    
+                        schemaCol.setBaseUri(def.getDocumentBaseURI());
+                        CatalogXmlSchemaURIResolver schemaResolver =
+                            new CatalogXmlSchemaURIResolver(OASISCatalogManager.getCatalogManager(bus));
+                        schemaCol.setSchemaResolver(schemaResolver);
+                        
+                        XmlSchema xmlSchema = schemaCol.read(schemaElem, systemId);
+                        SchemaInfo schemaInfo = new SchemaInfo(serviceInfo, xmlSchema.getTargetNamespace());
+                        schemaInfo.setElement(schemaElem);
+                        schemaInfo.setSchema(xmlSchema);
+                        schemaInfo.setSystemId(systemId);
+                        serviceInfo.addSchema(schemaInfo);
+                        schemaCount++;
                     }
-                    String systemId = def.getDocumentBaseURI() + "#types" + schemaCount;
-
-                    schemaCol.setBaseUri(def.getDocumentBaseURI());
-                    CatalogXmlSchemaURIResolver schemaResolver =
-                        new CatalogXmlSchemaURIResolver(OASISCatalogManager.getCatalogManager(bus));
-                    schemaCol.setSchemaResolver(schemaResolver);
-                    
-                    XmlSchema xmlSchema = schemaCol.read(schemaElem, systemId);
-                    SchemaInfo schemaInfo = new SchemaInfo(serviceInfo, xmlSchema.getTargetNamespace());
-                    schemaInfo.setElement(schemaElem);
-                    schemaInfo.setSchema(xmlSchema);
-                    schemaInfo.setSystemId(systemId);
-                    serviceInfo.addSchema(schemaInfo);
-                    schemaCount++;
                 }
             }
         }

Modified: cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java?rev=652536&r1=652535&r2=652536&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java (original)
+++ cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java Thu May  1 07:42:38 2008
@@ -21,8 +21,8 @@
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
-import java.util.Collection;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
@@ -309,7 +309,7 @@
             Class<?> tp = getMethods[x].getReturnType();
             mv.visitVarInsn(Opcodes.ALOAD, 2);            
             
-            if (Collection.class.isAssignableFrom(tp)) {
+            if (List.class.isAssignableFrom(tp)) {
                 doCollection(mv, x);
             } else { 
                 if (JAXBElement.class.isAssignableFrom(tp)) {

Modified: cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java?rev=652536&r1=652535&r2=652536&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java (original)
+++ cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java Thu May  1 07:42:38 2008
@@ -127,6 +127,15 @@
             context.put(MessageContext.HTTP_RESPONSE_HEADERS, responseHeaders);
         }  
         mapContext(context, cxf2jaxwsMap);
+        
+        Collection<Attachment> attachments 
+            = CastUtils.cast((Collection<?>)context.get(Message.ATTACHMENTS));
+        Map<String, DataHandler> dataHandlers = getDHMap(attachments);
+        context.put(MessageContext.INBOUND_MESSAGE_ATTACHMENTS, dataHandlers);
+        Map<String, Scope> scopes = CastUtils.cast((Map<?, ?>)context.get(WrappedMessageContext.SCOPES));
+        if (scopes != null) {
+            scopes.put(MessageContext.INBOUND_MESSAGE_ATTACHMENTS, Scope.APPLICATION);
+        }
     }
     
     private static void mapJaxws2Cxf(Map<String, Object> context) {
@@ -227,13 +236,9 @@
         }
 
     }
-    
-    private static void addMessageAttachments(WrappedMessageContext ctx,
-                                              Message message,
-                                              String propertyName) {
-        Map<String, DataHandler> dataHandlers = null;
 
-        Collection<Attachment> attachments = message.getAttachments();
+    private static Map<String, DataHandler> getDHMap(Collection<Attachment> attachments) {
+        Map<String, DataHandler> dataHandlers = null;
         if (attachments != null) {
             
             //preserve the order of iteration
@@ -242,7 +247,14 @@
                 dataHandlers.put(attachment.getId(), attachment.getDataHandler());
             }
         }
+        return dataHandlers;
+    }
+    private static void addMessageAttachments(WrappedMessageContext ctx,
+                                              Message message,
+                                              String propertyName) {
 
+        Collection<Attachment> attachments = message.getAttachments();
+        Map<String, DataHandler> dataHandlers = getDHMap(attachments);
         ctx.put(propertyName, 
                 dataHandlers == null ? Collections.EMPTY_MAP
                                      : Collections.unmodifiableMap(dataHandlers),

Modified: cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidatorUtil.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidatorUtil.java?rev=652536&r1=652535&r2=652536&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidatorUtil.java (original)
+++ cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidatorUtil.java Thu May  1 07:42:38 2008
@@ -84,43 +84,44 @@
         if (document == null) {
             return schemaList;
         }
-        // URL might need encoding for special characters.
-        baseURI = URLEncoder.encode(baseURI, "utf-8");
-        SchemaCollection schemaCol = new SchemaCollection();
-        schemaCol.setBaseUri(baseURI);
-        NodeList nodes = document.getElementsByTagNameNS(
-            WSDLConstants.NU_SCHEMA_XSD, "schema");
-        for (int x = 0; x < nodes.getLength(); x++) {
-            Node schemaNode = nodes.item(x);
-            Element schemaEl = (Element) schemaNode;
-            String tns = schemaEl.getAttribute("targetNamespace");
-            try {
-                schemaCol.read(schemaEl, tns);
-            } catch (RuntimeException ex) {
-                LOG.log(Level.WARNING, "SCHEMA_READ_FAIL", tns);
-                //
-                // Couldn't find schema... check if it's relative to wsdl.
-                // XXX - Using setBaseUri() on the XmlSchemaCollection,
-                // only seems to work for the first imported xsd... so pass
-                // in the baseURI here.
-                //
+        synchronized (document) {
+            // URL might need encoding for special characters.
+            baseURI = URLEncoder.encode(baseURI, "utf-8");
+            SchemaCollection schemaCol = new SchemaCollection();
+            schemaCol.setBaseUri(baseURI);
+            NodeList nodes = document.getElementsByTagNameNS(
+                WSDLConstants.NU_SCHEMA_XSD, "schema");
+            for (int x = 0; x < nodes.getLength(); x++) {
+                Node schemaNode = nodes.item(x);
+                Element schemaEl = (Element) schemaNode;
+                String tns = schemaEl.getAttribute("targetNamespace");
                 try {
-                    schemaCol.read(schemaEl, baseURI);
-                } catch (RuntimeException ex2) {
-                    LOG.log(Level.WARNING, "SCHEMA_READ_FAIL", baseURI);
-                    continue;
+                    schemaCol.read(schemaEl, tns);
+                } catch (RuntimeException ex) {
+                    LOG.log(Level.WARNING, "SCHEMA_READ_FAIL", tns);
+                    //
+                    // Couldn't find schema... check if it's relative to wsdl.
+                    // XXX - Using setBaseUri() on the XmlSchemaCollection,
+                    // only seems to work for the first imported xsd... so pass
+                    // in the baseURI here.
+                    //
+                    try {
+                        schemaCol.read(schemaEl, baseURI);
+                    } catch (RuntimeException ex2) {
+                        LOG.log(Level.WARNING, "SCHEMA_READ_FAIL", baseURI);
+                        continue;
+                    }
                 }
             }
-        }
-        schemaList.add(schemaCol);
-        
-        // Now add schemas from imported wsdl files.
-        Map<String, Document> wsdlImports = getImportedWsdlMap(
-            document, baseURI);
-        for (Document wsdlImport : wsdlImports.values()) {
-            schemaList.addAll(getSchemaList(wsdlImport, baseURI));
-        }
-        
+            schemaList.add(schemaCol);
+            
+            // Now add schemas from imported wsdl files.
+            Map<String, Document> wsdlImports = getImportedWsdlMap(
+                document, baseURI);
+            for (Document wsdlImport : wsdlImports.values()) {
+                schemaList.addAll(getSchemaList(wsdlImport, baseURI));
+            }
+        }        
         return schemaList;
     }
     

Modified: cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java?rev=652536&r1=652535&r2=652536&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java (original)
+++ cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java Thu May  1 07:42:38 2008
@@ -364,7 +364,9 @@
             Map<String, Element> maps = CastUtils.cast((Map<?, ?>)context.get(ToolConstants.SCHEMA_MAP));
             if (maps != null) {
                 for (Element ele : maps.values()) {
-                    schema.read(ele);
+                    synchronized (ele.getOwnerDocument()) {
+                        schema.read(ele);
+                    }
                 }
                 elementByName = schema.getElementByQName(partElement);
             }