Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 43408 invoked from network); 11 Apr 2008 19:46:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Apr 2008 19:46:18 -0000 Received: (qmail 86814 invoked by uid 500); 11 Apr 2008 19:46:10 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 86767 invoked by uid 500); 11 Apr 2008 19:46:10 -0000 Mailing-List: contact cxf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-commits@incubator.apache.org Received: (qmail 86754 invoked by uid 99); 11 Apr 2008 19:46:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Apr 2008 12:46:10 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Apr 2008 19:45:13 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id DF6331A9832; Fri, 11 Apr 2008 12:45:31 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r647285 - in /incubator/cxf/branches/2.0.x-fixes: ./ distribution/bundle/pom.xml rt/core/src/main/java/org/apache/cxf/bus/spring/TunedDocumentLoader.java Date: Fri, 11 Apr 2008 19:45:31 -0000 To: cxf-commits@incubator.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080411194531.DF6331A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Fri Apr 11 12:45:30 2008 New Revision: 647285 URL: http://svn.apache.org/viewvc?rev=647285&view=rev Log: Merged revisions 647008 via svnmerge from https://svn.apache.org/repos/asf/incubator/cxf/trunk ........ r647008 | dkulp | 2008-04-10 19:29:16 -0400 (Thu, 10 Apr 2008) | 4 lines Remove direct dependency on woodstox from the code Mark the woodstox import as optional in osgi manifest Update other deps in osgi manifest as optional ........ Modified: incubator/cxf/branches/2.0.x-fixes/ (props changed) incubator/cxf/branches/2.0.x-fixes/distribution/bundle/pom.xml incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/TunedDocumentLoader.java Propchange: incubator/cxf/branches/2.0.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: incubator/cxf/branches/2.0.x-fixes/distribution/bundle/pom.xml URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/distribution/bundle/pom.xml?rev=647285&r1=647284&r2=647285&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/distribution/bundle/pom.xml (original) +++ incubator/cxf/branches/2.0.x-fixes/distribution/bundle/pom.xml Fri Apr 11 12:45:30 2008 @@ -229,6 +229,8 @@ + antlr*;resolution:=optional, + com.ctc.wstx*;resolution:=optional, com.ibm*;resolution:=optional, com.sun*;resolution:=optional, javanet.staxutils*;resolution:=optional, @@ -236,12 +238,14 @@ javax.xml.soap, junit.framework*;resolution:=optional, org.apache.commons.lang*;resolution:=optional, + org.apache.commons.codec*;resolution:=optional, org.apache.log4j*;resolution:=optional, org.apache.tools.ant*;resolution:=optional, org.apache.velocity*;resolution:=optional, org.apache.xmlbeans*;resolution:=optional, org.apache.ws.security*;resolution:=optional, org.codehaus.jra*;resolution:=optional, + org.codehaus.jettison*;resolution:=optional, org.jdom*;resolution:=optional, org.junit*;resolution:=optional, org.mortbay*;resolution:=optional, Modified: incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/TunedDocumentLoader.java URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/TunedDocumentLoader.java?rev=647285&r1=647284&r2=647285&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/TunedDocumentLoader.java (original) +++ incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/TunedDocumentLoader.java Fri Apr 11 12:45:30 2008 @@ -23,6 +23,9 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMResult; import javax.xml.transform.sax.SAXSource; @@ -34,7 +37,6 @@ import org.xml.sax.InputSource; import org.xml.sax.XMLReader; -import com.ctc.wstx.sax.WstxSAXParserFactory; import org.springframework.beans.factory.xml.DefaultDocumentLoader; import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; @@ -57,9 +59,28 @@ } } private TransformerFactory transformerFactory; + private SAXParserFactory saxParserFactory; + private SAXParserFactory nsasaxParserFactory; TunedDocumentLoader() { transformerFactory = TransformerFactory.newInstance(); + + try { + Class cls = Class.forName("com.ctc.wstx.sax.WstxSAXParserFactory"); + saxParserFactory = (SAXParserFactory)cls.newInstance(); + nsasaxParserFactory = (SAXParserFactory)cls.newInstance(); + } catch (Exception e) { + //woodstox not found, use any other Stax parser + saxParserFactory = SAXParserFactory.newInstance(); + nsasaxParserFactory = SAXParserFactory.newInstance(); + } + + try { + nsasaxParserFactory.setFeature("http://xml.org/sax/features/namespace-prefixes", + true); + } catch (Exception e) { + //ignore + } } @Override @@ -67,11 +88,9 @@ ErrorHandler errorHandler, int validationMode, boolean namespaceAware) throws Exception { if (validationMode == XmlBeanDefinitionReader.VALIDATION_NONE) { - WstxSAXParserFactory woodstoxParserFactory; - woodstoxParserFactory = new WstxSAXParserFactory(); - woodstoxParserFactory.setFeature("http://xml.org/sax/features/namespace-prefixes", - namespaceAware); - SAXParser parser = woodstoxParserFactory.newSAXParser(); + SAXParserFactory parserFactory = + namespaceAware ? nsasaxParserFactory : saxParserFactory; + SAXParser parser = parserFactory.newSAXParser(); XMLReader reader = parser.getXMLReader(); reader.setEntityResolver(entityResolver); reader.setErrorHandler(errorHandler);