Thanks Freeman for the quick response. Actually, that was the first action
that I did: to increase the allocated memory. However this did not fix my
issue. So I did take a look at the source code in
servicemix-cxf-bc-2011.02-sources: org.apache.servicemix.cxfbc.SchemaUtil
The code was going in an infinite loop in this function:

private void inlineTransformer(String key, Element inlineSchema, Element
outerSchema, boolean isInclude) {
        NodeList nl = null;
        if (isInclude) {
            nl = outerSchema.getElementsByTagNameNS(
                    "http://www.w3.org/2001/XMLSchema";, "include");
        } else {
            nl = outerSchema.getElementsByTagNameNS(
                    "http://www.w3.org/2001/XMLSchema";, "import");
        }

//Comment by Abdo: this loop can go infinite!!!!
        for (int j = 0; j < nl.getLength(); j++) {

            String schemaLocation =
((Element)nl.item(j)).getAttribute("schemaLocation");

//Added by abdo----start
if(inlineList.contains(schemaLocation))continue;
else
inlineList.add( schemaLocation );
//Added by abdo----end


            if (schemaLocation != null && getXsdFileName(schemaLocation,
"/").
                    equals(getXsdFileName(key, "/"))) {

                outerSchema.removeChild(nl.item(j));


                for (int i = 0; i <
inlineSchema.getChildNodes().getLength(); i++) {
                    outerSchema.appendChild(
                            outerSchema.getOwnerDocument().importNode(
                                inlineSchema.getChildNodes().item(i),
true));
                }
                outerSchema.setPrefix("xs");
                outerSchema.setAttribute("xmlns:xs",
"http://www.w3.org/2001/XMLSchema";);
            }
        }
    }

Even this patch fixed my issue for now, I don't think its the best solution.
let me know what you think.

Thanks.
Abdo.



--
View this message in context: 
http://servicemix.396122.n5.nabble.com/cxfbc-java-lang-OutOfMemoryError-Java-heap-space-tp5713838p5713856.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to